-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
53 lines (47 loc) · 1.46 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
//version: 1707058017
plugins {
id 'com.gtnewhorizons.gtnhconvention'
}
dependencies {
implementation(project(':natives').components)
}
jar {
from {
def all = project(':natives').components.named('main').get().binaries.get().findAll {
it instanceof CppSharedLibrary && it.optimized
}
all*.runtimeFile
}
}
task createSignedJarDir() {
onlyIf { // Skip the task if our secret data isn't available
project.hasProperty('keyStore')
}
doLast {
mkdir new File(jar.destinationDirectory.get().asFile, "signed").toString()
}
}
// sign jars
task signJar() {
dependsOn reobfJar
dependsOn createSignedJarDir
onlyIf { // Skip the task if our secret data isn't available
project.hasProperty('keyStore')
}
inputs.files jar.outputs.files
jar.outputs.files.forEach {
outputs.file jar.destinationDirectory.map { d -> new File(new File(d.asFile, "signed"), it.name) }
}
doLast {
reobfJar.outputs.files.forEach {
ant.signjar destDir: new File(jar.destinationDirectory.get().asFile, "signed"),
sigfile: project.hasProperty("signerName") ? project.signerName : project.keyStoreAlias,
keystore: project.keyStore,
alias: project.keyStoreAlias,
storepass: project.keyStorePass,
keypass: project.keyStoreKeyPass,
jar: it
}
}
}
assemble.dependsOn(signJar)