-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
65 lines (55 loc) · 1.56 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
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.palantir.git-version' version '3.0.0'
id 'java'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.ow2.asm:asm:9.6'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
}
test {
useJUnitPlatform()
}
compileJava {
options.release = 17
}
def buildNumber = System.getenv('AI_BUILD_NUMBER')
def gitInfo = versionDetails()
version = System.getenv('AI_VERSION_NUMBER') ?: 'snapshot'
if (!gitInfo.isCleanTag) version += '.dirty'
jar {
manifest {
attributes (
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'YuxuanZuo',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Automatic-Module-Name': 'xyz.zuoyx.multiyggdrasil',
'Premain-Class': 'xyz.zuoyx.multiyggdrasil.Premain',
'Agent-Class': 'xyz.zuoyx.multiyggdrasil.Premain',
'Can-Retransform-Classes': true,
'Can-Redefine-Classes': true,
'Git-Commit': gitInfo.gitHashFull,
'Git-IsClean': gitInfo.isCleanTag,
'Build-Number': buildNumber?:'-1'
)
}
}
processResources {
from('LICENSE') {
rename('LICENSE', 'multiyggdrasil.txt')
into 'META-INF/licenses'
}
}
shadowJar {
exclude 'META-INF/maven/**'
exclude 'module-info.class'
exclude '**/module-info.class'
relocate 'com.google.gson', 'xyz.zuoyx.multiyggdrasil.internal.com.google.gson'
relocate 'org.objectweb.asm', 'xyz.zuoyx.multiyggdrasil.internal.org.objectweb.asm'
}
defaultTasks 'clean', 'shadowJar'