forked from DabbingEevee/Moar-TCon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
208 lines (176 loc) · 6.84 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
buildscript {
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
maven { url = "https://repo.spongepowered.org/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = getVersionFromJava() //"0.0.0_0" //default version, gets overrode later
group = "com.existingeevee.moretcon" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "moretcon"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft {
version = "1.12.2-14.23.5.2816"
runDir = "run"
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "snapshot_20171003"
makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
String resolved_core_plugin = mod_core_plugin.replace('${mod_group}', mod_group).replace('${mod_id}', mod_id)
clientJvmArgs += "-Dfml.coreMods.load=${resolved_core_plugin}"
serverJvmArgs += "-Dfml.coreMods.load=${resolved_core_plugin}"
String resolved_core_config = mod_mixin_configs.replace('${mod_id}', mod_id)
clientRunArgs += "--mixin ${resolved_core_config}"
serverRunArgs += "--mixin ${resolved_core_config}"
}
def getDate() {
return "_" + Long.toHexString(Long.parseLong(new Date().format('yyyyMMddHHmmss')))
}
//Returns the current version by reading directly from the ModInfo.java file
def getVersionFromJava() {
String mega = '0';
String major = '0';
String revision = '0';
String patch = '0';
boolean beta = false;
boolean patchFound = false;
String versionPrefix = 'public static final String VERSION = "';
String betaPrefix = 'public static final boolean BETA = ';
File file = file('src/main/java/com/existingeevee/moretcon/ModInfo.java')
file.eachLine { String s ->
s = s.trim();
if (s.startsWith(versionPrefix)) {
s = s.substring(versionPrefix.length(), s.length() - 2);
String[] pts = s.split('\\.');
mega = pts[0];
major = pts[1];
revision = pts[2].split('\\_')[0];
if (pts[2].split('\\_').length > 1) {
patch = pts[2].split('\\_')[1];
patchFound = true;
}
}
if (s.startsWith(betaPrefix)) {
s = s.substring(betaPrefix.length(), s.length() - 1);
beta = s.equals("true");
}
}
System.out.println("")
System.out.println("Mega Version: " + "$mega")
System.out.println("Major Version: " + "$major")
System.out.println("Revision Version: " + "$revision")
System.out.println("Patch Version: " + "$patch")
System.out.println("Beta: " + (beta ? ("b" + getDate()) : "N"))
System.out.println("")
if (patchFound) {
return "$mega.$major.$revision" + "_" + "$patch" + (beta ? ("-b" + getDate()) : "");
}
return "$mega.$major.$revision" + (beta ? ("-b" + getDate()) : "");
}
repositories {
mavenCentral()
maven { url = "https://repo.spongepowered.org/maven" }
maven {
name 'DVS1 Maven FS'
url 'http://dvs1.progwml6.com/files/maven/'
}
maven {
name "CurseMaven"
url "https://www.cursemaven.com"
}
maven {
name "Baubles"
url "http://maven.thiakil.com/"
}
maven {
name "Covers1624"
url "https://maven.covers1624.net/"
}
maven {
name "ChickenBones"
url "http://chickenbones.net/maven/"
}
}
configurations {
embed
compile.extendsFrom(embed)
}
dependencies {
embed('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
exclude module: 'guava'
exclude module: 'commons-io'
exclude module: 'gson'
}
deobfCompile 'slimeknights.mantle:Mantle:1.12-1.3.3.55'
deobfCompile 'slimeknights:TConstruct:1.12.2-2.13.0.190'
deobfProvided 'com.azanor.baubles:Baubles:1.12-1.5.2'
deobfCompile 'curse.maven:plusticminusbad-376903:3648592'
provided 'curse.maven:aether-255308:3280119'
provided 'curse.maven:angry-pixel-the-betweenlands-mod-243363:4479688'
provided 'curse.maven:the-twilight-forest-227639:3051450'
provided 'curse.maven:libnine-322344:3509087'
provided 'curse.maven:tinkers-evolution-384589:3362723'
provided 'curse.maven:constructs-armory-287683:3174535'
provided "mezz.jei:jei_1.12.2:4.15.0.268"
/*
note that to properly build this, the following jars will need to be placed in the ./libs/ folder
// aether-1.12.2-v1.5.3.2.jar
// Baubles-1.12-1.5.2.jar
// conarm-1.12.2-1.2.5.10.jar
// jei_1.12.2-4.16.1.302.jar
// libnine-1.12.2-1.2.1.jar
// Mantle-1.12-1.3.3.55.jar
// plustic-8.0.1.0.jar
// tconevo-1.12.2-1.0.44.jar
// TConstruct-1.12.2-2.13.0.183.jar
// TheBetweenlands-3.8.1-universal.jar
// twilightforest-1.12.2-3.11.1021-universal.jar
*/
}
processResources {
//project.version = project.getVersionFromJava()
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
mixin {
add sourceSets.main, mod_mixin_refmap.replace('${mod_id}', mod_id)
}
jar {
from(configurations.embed.collect {
it.isDirectory() ? it : zipTree(it)
}) {
exclude "LICENSE.txt", "META-INF/MANIFSET.MF", "META-INF/maven/**", "META-INF/*.RSA", "META-INF/*.SF"
}
manifest {
attributes "FMLCorePlugin": mod_core_plugin.replace('${mod_group}', mod_group).replace('${mod_id}', mod_id)
attributes "FMLCorePluginContainsFMLMod": "false"
attributes "ForceLoadAsMod": "true"
attributes "TweakClass": "org.spongepowered.asm.launch.MixinTweaker"
attributes "TweakOrder": "0"
attributes "MixinConfigs": mod_mixin_configs.replace('${mod_id}', mod_id)
}
}