forked from Team-RTG/Appalachia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
87 lines (77 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
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
sourceCompatibility = targetCompatibility = 1.8
static def parseprops(File cfg) {
cfg.withReader {
def prop = new Properties()
prop.load(it)
return (new ConfigSlurper().parse(prop))
}
}
ext.ref = parseprops(file('build.properties'))
group = ref.package_base + '.' + ref.mod_id
archivesBaseName = (ref.mod_name as String) + '-' + (ref.mc_version as String)
version = ref.mod_version
dependencies {
provided fileTree(dir: 'libs', include: '*.jar')
}
minecraft {
version = (ref.mcf_suffix!='') ? ref.mcf_version + '-' + ref.mcf_suffix : ref.mcf_version
mappings = ref.mcp_mappings
runDir = ref.run_dir
makeObfSourceJar = false
replace '= "appalachia";', '= "' + (ref.mod_id as String) + '";'
replace '= "Appalachia";', '= "' + (ref.mod_name as String) + '";'
replace '@MOD_VERSION@', project.version
replace '0.0-MCF+MINVER', ref.mcf_minver
replace '9001.0-MCF+MAXVER', ref.mcf_maxver
replace '0.0-RTG+MINVER', ref.rtg_minver
replace '9001.0-RTG+MINVER', ref.rtg_maxver
replaceIn 'ModInfo.java'
}
processResources {
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand ([
'modid':ref.mod_id,
'name':ref.mod_name,
'description':ref.mod_desc,
'version':ref.mod_version,
'mcversion':ref.mc_version,
'url':ref.mod_url,
'authorList':ref.mod_author,
'credits':ref.mod_creds,
'logoFile':ref.mod_logo,
])
}
from(sourceSets.main.resources.srcDirs) {exclude 'mcmod.info'}
}
sourceJar {classifier = 'src'}
// For a debugging session used 'gradle -DEBUG [runClient|runServer]'
allprojects {
tasks.withType(JavaExec) {
// disabled to possibly alleviate testing issues on cumputers with low memory
// jvmArgs '-Xms2G', '-Xmx4G'
if (System.getProperty("EBUG")!=null)
jvmArgs '-agentlib:jdwp=transport=dt_socket,address=localhost:5005,server=y,suspend=y'
}
}
// use -Dwarn|-Dwarnall CLI arguement for verbose compiler warnings
// -Dwarn covers the 3 most common warnings only
tasks.withType(JavaCompile) {
if (System.getProperty("warn") != null)
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:rawtypes" << "-Xlint:deprecation"
if (System.getProperty("warnall") != null)
options.compilerArgs << "-Xlint:all"
}