-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathcorejar.gradle
38 lines (34 loc) · 1.3 KB
/
corejar.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
reobf {
coreJar { mappingType = 'SEARGE' }
}
tasks.register('coreJar', Jar) {
// Copy all compiled files and resources from the source set to the JAR
// If you have additional source sets, add the same logic here
from(sourceSets.main.output) {
// Don't include the coremod in the main mod
// If you have more coremod-related packages that aren't nested in the main one, add exclusions for them
include modASMPath
}
manifest {
attributes "FMLCorePlugin": modASMClass
attributes 'Maven-Artifact': modGroup + ':' + modName + '-core:' + modVersion
}
// Add a classifier to the JAR ('-core' at the end of the file name)
// Distinguishes the mod JAR from the shipped one
classifier 'core'
group = 'build'
}
def libPrefix = 'META-INF/libraries'
jar {
manifest {
attributes 'ContainedDeps': libPrefix + '/' + coreJar.archivePath.name
attributes "FMLAT": modATPath
attributes 'Maven-Artifact': modGroup + ':' + modName + ':' + modVersion
}
exclude modASMPath
// Add the output of the mod JAR task to the main JAR for later extraction
from(coreJar.archivePath.absolutePath) {
include '*' // Due to the way Gradle's copy tasks work, we need this line for the JAR to get added
into libPrefix
}
}