-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
58 lines (50 loc) · 1.36 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
kotlin("jvm") version "1.5.10"
`maven-publish`
signing
}
group = "com.louiscad.incubator"
version = "0.2.1-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
testImplementation("junit", "junit", "4.12")
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
kotlinOptions.jvmTarget = "1.6" //TODO: Switch back to 1.8 when https://youtrack.jetbrains.com/issue/KT-39211 is fixed.
}
java {
withSourcesJar()
}
signing {
useInMemoryPgpKeys(
propertyOrEnvOrNull("GPG_key_id"),
propertyOrEnvOrNull("GPG_private_key") ?: return@signing,
propertyOrEnv("GPG_private_password")
)
sign(publishing.publications)
}
publishing {
publications.withType<MavenPublication> {
artifact(tasks.emptyJavadocJar())
setupPom()
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
mavenCentralStagingPublishing(
project = project,
repositoryId = System.getenv("sonatype_staging_repo_id")
)
sonatypeSnapshotsPublishing(project = project)
}
}