-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
100 lines (85 loc) · 2.78 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
plugins {
id("org.quiltmc.gradle.licenser") version "2.+"
id("maven-publish")
id("java-library")
id("signing")
}
group = "org.quiltmc"
version = "0.3.1"
repositories {
mavenCentral()
}
val env = System.getenv()
subprojects {
apply(plugin="org.quiltmc.gradle.licenser")
apply(plugin="java-library")
apply(plugin="maven-publish")
apply(plugin="signing")
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
license {
rule(rootProject.file("codeformat/GSON_MODIFIED_HEADER"))
rule(rootProject.file("codeformat/HEADER"))
}
tasks.withType(Javadoc::class) {
isFailOnError = false
options.encoding = "UTF-8"
}
publishing {
publications {
create("mavenJava", MavenPublication::class) {
pom {
name.set("parsers ${project.displayName.uppercase()}") // TODO: read a property with a real name
packaging = "jar"
description.set(project.description)
url.set("https://github.com/QuiltMC/parsers")
scm {
connection.set("scm:git:https://github.com/QuiltMC/parsers.git")
developerConnection.set("scm:git:ssh:[email protected]:QuiltMC/parsers.git")
url.set("https://github.com/QuiltMC/parsers")
}
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("quiltmc")
name.set("Quilt Loader Team")
email.set("[email protected]")
}
}
from(components["java"])
}
}
}
repositories {
env["MAVEN_URL"]?.let {
repositories.maven {
url = uri(it)
credentials {
username = env["MAVEN_USERNAME"]!!
password = env["MAVEN_PASSWORD"]!!
}
}
} ?: run {
mavenLocal()
}
}
}
signing {
val key = env["SIGNING_KEY"]
val pass = env["SIGNING_KEY_PASSPHRASE"]
if (key != null && pass != null && key != "" && pass != "") {
useInMemoryPgpKeys(key, pass)
sign(publishing.publications["mavenJava"])
}
}
}