-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
109 lines (96 loc) · 3.47 KB
/
build.gradle
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
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2" apply false
id "net.kyori.blossom" version "1.3.0" apply false
}
subprojects {
apply plugin: "java"
apply plugin: "maven-publish"
apply plugin: "signing"
group = "net.creationreborn"
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.8.1")
}
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
failOnError = false
}
publishing {
publications {
mavenPublication(MavenPublication) {
groupId group
artifactId archivesBaseName
version version
pom {
name = "CRAPI"
description = "Creation Reborn API"
url = "https://github.com/creation-reborn/CRAPI"
developers {
developer {
id = "lxgaming"
name = "LXGaming"
}
}
issueManagement {
system = "GitHub Issues"
url = "https://github.com/creation-reborn/CRAPI/issues"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
connection = "scm:git:https://github.com/creation-reborn/CRAPI.git"
developerConnection = "scm:git:https://github.com/creation-reborn/CRAPI.git"
url = "https://github.com/creation-reborn/CRAPI"
}
}
}
}
}
signing {
sign publishing.publications
}
test {
testLogging {
exceptionFormat = "full"
}
useJUnitPlatform()
}
task signJar {
doFirst {
if (!project.hasProperty("signing.keyStorePath") || !project.hasProperty("signing.secretKeyRingFile")) {
project.logger.warn("========== [WARNING] ==========")
project.logger.warn("")
project.logger.warn(" This build is not signed! ")
project.logger.warn("")
project.logger.warn("========== [WARNING] ==========")
throw new StopExecutionException()
}
}
doLast {
configurations.archives.allArtifacts.files.each {
ant.signjar(
jar: it,
alias: project.property("signing.alias"),
storepass: project.property("signing.keyStorePassword"),
keystore: project.property("signing.keyStorePath"),
keypass: project.property("signing.keyStorePassword"),
preservelastmodified: project.property("signing.preserveLastModified"),
tsaurl: project.property("signing.timestampAuthority"),
digestalg: project.property("signing.digestAlgorithm")
)
project.logger.lifecycle("JAR Signed: " + it.name)
signing.sign(it)
project.logger.lifecycle("PGP Signed: " + it.name)
}
}
}
}