-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.gradle.kts
143 lines (127 loc) · 3.89 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import java.net.URI
plugins {
`java-library`
kotlin("jvm") version "1.7.10"
id("org.jetbrains.dokka") version "1.7.10"
signing
`maven-publish`
}
allprojects {
group = "dev.turingcomplete"
version = "2.4.1"
repositories {
mavenLocal()
mavenCentral()
}
}
tasks {
val sourcesJar by creating(Jar::class) {
group = "build"
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
val testsJar by creating(Jar::class) {
dependsOn(JavaPlugin.TEST_CLASSES_TASK_NAME)
group = "build"
archiveClassifier.set("tests")
from(sourceSets["test"].output)
}
val dokkaJar by creating(Jar::class) {
dependsOn("dokkaHtml")
group = "build"
archiveClassifier.set("javadoc")
from(getByPath("dokkaHtml").outputs)
}
artifacts {
add("archives", sourcesJar)
add("archives", testsJar)
add("archives", dokkaJar)
}
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
implementation(kotlin("stdlib"))
implementation("commons-codec:commons-codec:1.15")
val jUnitVersion = "5.9.0"
testImplementation("org.junit.jupiter:junit-jupiter-params:$jUnitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$jUnitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jUnitVersion")
testImplementation("com.github.bastiaanjansen:otp-java:1.3.2") {
because("For `OtherLibrariesComparisonTest`")
}
testImplementation("com.eatthepath:java-otp:0.4.0") {
because("For `OtherLibrariesComparisonTest`")
}
testImplementation("com.j256.two-factor-auth:two-factor-auth:1.3") {
because("For `OtherLibrariesComparisonTest`")
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
publishing {
publications {
create<MavenPublication>(project.name) {
from(components["java"])
setArtifacts(configurations.archives.get().allArtifacts)
}
}
}
/**
* See https://docs.gradle.org/current/userguide/signing_plugin.html#sec:signatory_credentials
*
* The following Gradle properties must be set:
* - signing.keyId (last 8 symbols of the key ID from 'gpg -K')
* - signing.password
* - signing.secretKeyRingFile ('gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg')
*/
signing {
sign(publishing.publications[project.name])
}
configure<PublishingExtension> {
publications {
afterEvaluate {
named<MavenPublication>(project.name) {
pom {
name.set("Kotlin One-Time Password Library")
description.set("A Kotlin one-time password library to generate \"Google Authenticator\", \"Time-based One-time Password\" (TOTP) and \"HMAC-based One-time Password\" (HOTP) codes based on RFC 4226 and 6238.")
url.set("https://github.com/marcelkliemannel/kotlin-onetimepassword")
developers {
developer {
name.set("Marcel Kliemannel")
id.set("marcelkliemannel")
email.set("dev@marcelkliemannel.com")
}
}
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0")
}
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/marcelkliemannel/kotlin-onetimepassword/issues")
}
scm {
connection.set("scm:git:git://github.com:marcelkliemannel/kotlin-onetimepassword.git")
developerConnection.set("scm:git:ssh://github.com:marcelkliemannel/kotlin-onetimepassword.git")
url.set("https://github.com/marcelkliemannel/kotlin-onetimepassword")
}
}
}
}
}
repositories {
maven {
url = URI("https://oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = ""
password = ""
}
}
}
}