-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
123 lines (107 loc) · 2.95 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.ktlint)
alias(libs.plugins.dokka)
id("maven-publish")
id("signing")
}
repositories {
mavenCentral()
}
java {
withSourcesJar()
withJavadocJar()
}
dependencies {
implementation(libs.kotlin.stdlib)
implementation(libs.commonsCodecs)
implementation(libs.kotlinx.coroutinesCore)
testImplementation(libs.mockk)
testImplementation(libs.kotest.frameworkDatatest)
testImplementation(libs.kotest.runnerJUnit5)
testImplementation(libs.kotest.property)
}
group = "com.atlassian"
version = "2.1.0"
description = "onetime"
val javaVersion = JavaVersion.VERSION_1_8
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = javaVersion.toString()
targetCompatibility = javaVersion.toString()
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs +=
listOf(
"-progressive",
"-java-parameters",
"-opt-in=kotlin.time.ExperimentalTime",
"-opt-in=kotlin.RequiresOptIn",
)
// https://youtrack.jetbrains.com/issue/KTIJ-1224
// This is really an IDE bug.
// Without explicit languageVersion the Gradle build does compile 1.5 structures (sealed interfaces). So, for Gradle the value is 1.5.
// The wrong value is only in IDE settings.
languageVersion = "1.8"
apiVersion = "1.8"
}
}
tasks {
// This task is added by Gradle when we use java.withJavadocJar()
named<Jar>("javadocJar") {
from(dokkaJavadoc)
}
test {
useJUnitPlatform()
}
publishing {
publications {
create<MavenPublication>("release") {
from(project.components["java"])
pom {
packaging = "jar"
name.set(project.name)
description.set("TOTP and HOTP generator and validator for multi-factor authentication")
url.set("https://github.com/atlassian/1time")
scm {
connection.set("[email protected]:atlassian/1time.git")
url.set("https://github.com/atlassian/1time.git")
}
developers {
developer {
id.set("docampoherrera")
name.set("Diego Ocampo")
email.set("[email protected]")
}
}
licenses {
license {
name.set("Apache License 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0")
distribution.set("repo")
}
}
}
}
}
repositories {
maven {
url = uri("https://packages.atlassian.com/maven-central")
credentials {
username = System.getenv("ARTIFACTORY_USERNAME")
password = System.getenv("ARTIFACTORY_API_KEY")
}
}
}
}
signing {
useInMemoryPgpKeys(
System.getenv("SIGNING_KEY"),
System.getenv("SIGNING_PASSWORD"),
)
sign(publishing.publications["release"])
}
}