-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
103 lines (86 loc) · 2.7 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
plugins {
id("java-library")
id("maven-publish")
id("signing")
}
group = "io.github.xtyuns"
version = "1.0.1"
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.0")
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}
java {
withSourcesJar()
withJavadocJar()
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.withType<Javadoc> {
options.encoding = System.getProperty("file.encoding") ?: "UTF-8"
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
publishing {
repositories {
mavenLocal()
maven {
name = "OSSRH"
val repoUrl = if (version.toString().endsWith("SNAPSHOT")) {
"https://s01.oss.sonatype.org/content/repositories/snapshots/"
} else {
"https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
url = uri(repoUrl)
credentials {
username = properties["mavenUser"].toString()
password = properties["mavenPwd"].toString()
}
}
}
publications {
create<MavenPublication>("-${project.name}-") {
from(components["java"])
pom {
name.set(project.name)
description.set("Tencent Tiny Encryption algorithm library")
url.set("https://github.com/xtyuns/TTEA4j")
licenses {
license {
name.set("Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0")
}
}
developers {
developer {
id.set("xtyuns")
name.set("xtyuns")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/xtyuns/TTEA4j.git")
developerConnection.set("scm:git:ssh://github.com/xtyuns/TTEA4j.git")
url.set("https://github.com/xtyuns/TTEA4j")
}
}
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
}
}
}
signing {
sign(publishing.publications["-${project.name}-"])
}