-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
96 lines (79 loc) · 2.77 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
buildscript {
repositories {
maven {
url = 'https://maven.minecraftforge.net/'
}
maven {
url = 'https://repo.spongepowered.org/maven'
}
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7.+'
classpath("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0")
}
}
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
version = "${mod_version}"
group = "${mod_id}"
archivesBaseName = '`' + "${mod_name}"
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
java.withSourcesJar()
java.withJavadocJar()
minecraft {
mappings channel: mappings_channel, version: mappings_version
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
shadow 'io.github.llamalad7:mixinextras-common:0.4.1'
shadow 'org.spongepowered:mixin:0.8.7'
annotationProcessor 'org.spongepowered:mixin:0.8.7:processor'
}
mixin {
add sourceSets.main, "mixins.${mod_id}.refmap.json"
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", minecraft_version
filesMatching('mcmod.info') {
expand 'mod_id': mod_id, 'mod_name': mod_name, 'version': project.version,
'mcversion': minecraft_version, 'mod_description': mod_description,
'mod_author': mod_author
}
}
shadowJar {
configurations = [project.configurations.shadow]
mergeServiceFiles()
exclude 'org/spongepowered/asm/launch/MixinLaunchPlugin*'
exclude 'org/spongepowered/asm/launch/MixinTransformationService*'
exclude 'org/spongepowered/asm/launch/platform/container/ContainerHandleModLauncherEx*'
archiveClassifier.set('')
}
reobf {
shadowJar {}
}
jar {
manifest {
attributes([
"Specification-Title" : mod_name,
"Specification-Version" : "1",
"Implementation-Title" : mod_name,
"Implementation-Version" : mod_version,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"FMLCorePlugin": "${mixin_loader_class}",
"FMLCorePluginContainsFMLMod": "true",
"ForceLoadAsMod": "true",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker"
])
}
archiveClassifier.set('THIN')
}
build.dependsOn(shadowJar)
jar.finalizedBy('reobfJar')