-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
147 lines (127 loc) · 4.49 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.jfrog.bintray.gradle.BintrayExtension
project.group = "tech.basepair"
project.version = "${version}"
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin.
id("org.jetbrains.kotlin.jvm") version "1.4.21"
id("org.jetbrains.dokka") version "1.4.20"
id("com.jfrog.bintray") version "1.8.5"
id("net.researchgate.release") version "2.8.1"
// Apply the java-library plugin for API and implementation separation.
`java-library`
`maven-publish`
}
repositories {
jcenter()
}
dependencies {
// Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
// Use the Kotlin JDK 8 standard library.
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.apache.commons", "commons-text" , "1.8")
implementation("org.jetbrains.kotlinx", "kotlinx-collections-immutable-jvm", "0.3.3")
// Use the Kotlin test library.
testImplementation("org.jetbrains.kotlin:kotlin-test")
// Use the Kotlin JUnit integration.
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}
tasks.withType<KotlinCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjvm-default=compatibility")
}
}
tasks.withType<Jar> {
from(project.projectDir) {
include("LICENSE")
into("META-INF")
}
}
tasks.dokkaHtml.configure {
outputDirectory.set(buildDir.resolve("javadoc"))
}
val dokkaJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin docs with Dokka"
archiveClassifier.set("javadoc")
from(tasks.dokkaHtml)
}
val sourcesJar by tasks.creating(Jar::class) {
dependsOn(JavaPlugin.CLASSES_TASK_NAME)
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
//tasks.register("bintrayUpload") {
// description = "Uploads to Bintray"
// dependsOn("publish")
// dependsOn("bintrayUpload")
// tasks.getByName("bintrayUpload").mustRunAfter("publish")
//}
//
tasks.getByName("afterReleaseBuild").dependsOn("bintrayUpload")
publishing {
publications {
create<MavenPublication>("default") {
artifact(dokkaJar)
artifact(sourcesJar)
from(components["java"])
pom {
name.set("Xml Blob")
description.set("Utility for building Xml documents")
url.set("https://github.com/basepair-tech/xml-blob")
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("jaiew")
name.set("Jaie Wilson")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:https://github.com/basepair-tech/xml-blob.git")
developerConnection.set("scm:git:ssh:[email protected]:basepair-tech/xml-blob.git")
url.set("https://github.com/basepair-tech/xml-blob.git")
}
}
}
}
}
bintray {
user = findProperty("bintray.basepair.user") as String?
key = findProperty("bintray.basepair.apiKey") as String?
publish = true
setPublications("default")
pkg(delegateClosureOf<BintrayExtension.PackageConfig> {
repo = "maven"
name = "xml-blob"
desc = "Utility for building XML documents with a simple interface"
userOrg = "basepair"
setLicenses("Apache-2.0")
websiteUrl = "https://github.com/basepair-tech/xml-blob"
vcsUrl = "https://github.com/basepair-tech/xml-blob.git"
publicDownloadNumbers = true
version(delegateClosureOf<BintrayExtension.VersionConfig> {
name = project.version as String
gpg(delegateClosureOf<BintrayExtension.GpgConfig> {
sign = true
passphrase = findProperty("signing.basepair.password") as String?
})
})
})
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}