-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
117 lines (99 loc) · 2.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
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
plugins {
id 'eclipse'
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version "8.1.1"
}
repositories {
mavenCentral()
}
sourceCompatibility = 21
targetCompatibility = 21
group = 'com.thegamecommunity'
version = "${project.version}"
dependencies {
shadow group: 'org.apache.commons', name: 'commons-text', version: '1.13.0'
shadow group: 'commons-io', name: 'commons-io', version: '2.18.0'
shadow group: 'commons-codec', name: 'commons-codec', version: '1.18.0'
shadow group: 'javax.activation', name: 'javax.activation-api', version: '1.2.0'
shadow group: 'com.sun.mail', name: 'javax.mail', version: '1.6.2'
testImplementation group: 'org.junit.jupiter', name:'junit-jupiter-api', version: '5.11.4'
testRuntimeOnly group: 'org.junit.jupiter', name :'junit-jupiter-engine', version: '5.10.2'
}
configurations.testImplementation {
extendsFrom(configurations.shadow)
}
shadowJar {
mergeServiceFiles()
configurations = [project.configurations.shadow]
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSsE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'LICENSE.txt'
}
test {
useJUnitPlatform()
}
task sourcesJar(type: Jar) {
archiveClassifier.set("sources")
from sourceSets.main.allSource
}
import org.apache.tools.ant.filters.ReplaceTokens
task processSource(type: Sync) {
from sourceSets.main.java
into "$buildDir/src"
inputs.property 'EQuickLZVersion', EQuickLZVersion;
filter(ReplaceTokens, tokens: [EQuickLZVersion: EQuickLZVersion])
}
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
'Class-Path': configurations.runtimeClasspath.collect { it.getName() }.join(' '),
'MixinConfigs': 'mixins.json',
'Specification-Version': 8.0,
'Multi-Release': 'true'
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
}
}
compileJava {
source = processSource.outputs
}
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
resources {
srcDirs = ['src/main/resources']
}
}
test {
java {
srcDirs = ['src/test/java']
}
resources {
srcDirs = ['src/test/resources']
}
}
}
artifacts {
archives jar
archives sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}