-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle
More file actions
112 lines (93 loc) · 3.35 KB
/
Copy pathbuild.gradle
File metadata and controls
112 lines (93 loc) · 3.35 KB
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
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' }
repositories {
maven {
url = "https://maven.bawnorton.com/releases"
}
flatDir {
dirs 'libs\\'
}
mavenCentral()
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
//https://github.com/fonnymunkey/SpongeMixin
//Temporarily shadow patched version of 0.8.7 that fixes compat with old mods, return to mainline when 0.8.8 merges https://github.com/SpongePowered/Mixin/pull/678
shadow files('libs/mixin-0.8.7.jar')
annotationProcessor files('libs/mixin-0.8.7-processor.jar')
shadow 'io.github.llamalad7:mixinextras-common:0.5.0'
annotationProcessor 'io.github.llamalad7:mixinextras-common:0.5.0'
shadow 'com.github.bawnorton.mixinsquared:mixinsquared-common:0.3.3'
annotationProcessor 'com.github.bawnorton.mixinsquared:mixinsquared-common:0.3.3'
}
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')