-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle.kts
136 lines (119 loc) · 4.01 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
plugins {
java
checkstyle
signing
id("io.github.jeadyx.sonatype-uploader") version "2.8"
id("org.kordamp.gradle.jandex") version "2.1.0"
}
allprojects {
group = "net.ximatai.muyun"
version = "1.0.0-SNAPSHOT"
// version = "0.1.9"
repositories {
mavenLocal()
maven { url = uri("https://mirrors.cloud.tencent.com/repository/maven") }
// maven { url = uri("https://maven.aliyun.com/repository/public") }
mavenCentral()
}
}
subprojects {
apply {
plugin("java")
plugin("checkstyle")
plugin("maven-publish")
plugin("signing")
plugin("io.github.jeadyx.sonatype-uploader")
plugin("org.kordamp.gradle.jandex")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
description =
"A cloud-native, asynchronous, developer-first, frontend-backend decoupled, and plug-and-play light-code platform."
url = "https://github.com/ximatai/MuYun"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "aruis"
name = "Rui Liu"
email = "[email protected]"
organization = "戏码台"
}
}
scm {
connection = "scm:git:git://github.com/ximatai/MuYun.git"
developerConnection = "scm:git:ssh://github.com/ximatai/MuYun.git"
url = "https://github.com/ximatai/MuYun"
}
}
}
}
repositories {
// maven {
// url = uri(layout.buildDirectory.dir("repo"))
// }
maven {
url = uri("http://192.168.6.205:8081/repository/maven-snapshots/")
isAllowInsecureProtocol = true
credentials {
username = findProperty("office.maven.username").toString()
password = findProperty("office.maven.password").toString()
}
}
}
}
sonatypeUploader {
repositoryPath = layout.buildDirectory.dir("repo").get().asFile.path
tokenName = findProperty("sonatype.token").toString()
tokenPasswd = findProperty("sonatype.password").toString()
}
signing {
sign(publishing.publications["mavenJava"])
useInMemoryPgpKeys(
findProperty("signing.keyId").toString(),
findProperty("signing.secretKey").toString(),
findProperty("signing.password").toString()
)
}
tasks.withType<Javadoc> {
enabled = false
}
tasks.named<Checkstyle>("checkstyleMain") {
dependsOn(tasks.named("jandex"))
}
tasks.named<Javadoc>("javadoc") {
mustRunAfter(tasks.named("jandex"))
}
tasks.withType<GenerateModuleMetadata> {
suppressedValidationErrors.add("enforced-platform")
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
}
tasks.withType<Test> {
maxHeapSize = "2g"
}
}
tasks.register("prepareRepo") {
group = "release"
dependsOn(subprojects.flatMap { it.tasks.matching { task -> task.name == "publishMavenJavaPublicationToMavenRepository" } })
}
tasks.register("releaseAllJars") {
group = "release"
dependsOn(subprojects.flatMap { it.tasks.matching { task -> task.name == "publishToSonatype" } })
}