-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
117 lines (95 loc) · 2.91 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
plugins {
kotlin("jvm") version "1.7.21"
id("org.jetbrains.dokka") version "1.7.20"
`maven-publish`
`java-library`
}
group = "org.veupathdb.lib"
version = "1.1.0"
repositories {
mavenCentral()
}
dependencies {
dokkaJekyllPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.7.20")
implementation(kotlin("stdlib"))
testImplementation("org.junit.jupiter:junit-jupiter:5.9.0")
testImplementation("io.mockk:mockk:1.13.2")
}
tasks.named<Test>("test") {
useJUnitPlatform()
testLogging {
events.addAll(listOf(org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED,
org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED,
org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_OUT,
org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_ERROR,
org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED))
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
showStandardStreams = true
enableAssertions = true
}
}
java {
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}
kotlin {
jvmToolchain {
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(16))
}
}
tasks.withType(PublishToMavenRepository::class.java).all {
dependsOn(":release")
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java).all {
this.requiredServices
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}
tasks.register("release", proguard.gradle.ProGuardTask::class.java) {
dependsOn(":build")
configuration("bld/proguard-rules.pro")
libraryjars(files(configurations.compileClasspath.get().files))
injars("build/libs/hash-id-${project.version}.jar")
outjars("build/libs/hash-id-$version-release.jar")
}
publishing {
repositories {
maven {
name = "GitHub"
url = uri("https://maven.pkg.github.com/veupathdb/lib-hash-id")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("HashID")
description.set("128 bit ID based on the hash of a value.")
url.set("https://github.com/VEuPathDB/lib-hash-id")
scm {
url.set("https://github.com/VEuPathDB/lib-hash-id.git")
}
developers {
developer {
name.set("Elizabeth Paige Harper")
email.set("[email protected]")
url.set("https://github.com/Foxcapades")
organization.set("VEuPathDB")
organizationUrl.set("https://veupathdb.org")
}
}
}
}
}
}