-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
102 lines (89 loc) · 2.69 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.0.0"
`maven-publish`
signing
}
defaultTasks("clean", "build")
group = "com.github.mvysny.kotlin-unsigned-jvm"
version = "0.3-SNAPSHOT"
repositories {
mavenCentral()
}
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
}
}
tasks.compileJava {
options.javaModuleVersion = provider { version as String }
}
kotlin {
explicitApi()
}
dependencies {
testImplementation("com.github.mvysny.dynatest:dynatest:0.25")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.withType<Javadoc> {
isFailOnError = false
}
publishing {
repositories {
maven {
setUrl("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.properties["ossrhUsername"] as String? ?: "Unknown user"
password = project.properties["ossrhPassword"] as String? ?: "Unknown user"
}
}
}
publications {
create("mavenJava", MavenPublication::class.java).apply {
groupId = project.group.toString()
this.artifactId = "kotlin-unsigned-jvm"
version = project.version.toString()
pom {
description.set("Utilities for working with unsigned values in Kotlin/JVM")
name.set("Kotlin-Unsigned-JVM")
url.set("https://github.com/mvysny/kotlin-unsigned-jvm")
licenses {
license {
name.set("The MIT License")
url.set("https://opensource.org/licenses/MIT")
distribution.set("repo")
}
}
developers {
developer {
id.set("mavi")
name.set("Martin Vysny")
email.set("martin@vysny.me")
}
}
scm {
url.set("https://github.com/mvysny/kotlin-unsigned-jvm")
}
}
from(components["java"])
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
// when the test fails, show the exception stacktrace in stdout
exceptionFormat = TestExceptionFormat.FULL
}
}