-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
127 lines (110 loc) · 3.94 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
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")
// 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.getByName("afterReleaseBuild").dependsOn("bintrayUpload")
publishing {
publications {
create<MavenPublication>("default") {
artifact(dokkaJar)
artifact(sourcesJar)
from(components["java"])
pom {
name.set("JSON Blob")
description.set("Utility for building JSON documents")
url.set("https://github.com/basepair-tech/json-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/json-blob.git")
developerConnection.set("scm:git:ssh:[email protected]:basepair-tech/json-blob.git")
url.set("https://github.com/basepair-tech/json-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 = "json-blob"
desc = "Utility for building JSON objects with a simple interface"
userOrg = "basepair"
setLicenses("Apache-2.0")
websiteUrl = "https://github.com/basepair-tech/json-blob"
vcsUrl = "https://github.com/basepair-tech/json-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?
})
})
})
}