forked from TeamTwilight/twilightforest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
172 lines (148 loc) · 5.15 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
// define the properties file
ext.configFile = file "gradle.properties"
configFile.withReader {
// read config. it shall from now on be referenced as simply config or as project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
// For those who want the bleeding edge
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'maven'
///////////////////////////////////////////////////
// IDE Settings
///////////////////////////////////////////////////
idea {
project {
languageLevel = '1.8'
}
}
///////////////////////////////////////////////////
// ForgeGradle
///////////////////////////////////////////////////
version = (hasProperty("CIRevision") ? CIRevision : config.mod_version)
group = config.group_name
archivesBaseName = "${config.mod_id}-${config.minecraft_version}"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
minecraft {
version = config.minecraft_version + "-" + config.forge_version // grab latest forge
runDir = "run"
mappings = config.mcp_mappings
makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
replace '@mod_version@', version
replace '@mod_id@', config.mod_id
replace '@ci_build@', hasProperty("CIRevision") ? 'true' : 'false'
replaceIn 'TwilightForestMod.java'
replace '@VERSION@', project.version
}
processResources {
//replaceIn 'assets/twilightforest/patchouli_books/guide/book.json'
//replace '@EDITION@', project.version
// 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 '**/*.info'
//include '**/*.properties'
include 'assets/twilightforest/patchouli_books/guide/book.json'
// replace version and mcversion
expand ([
'version':project.version,
'mcversion':project.minecraft.version,
'forge_version': config.forge_version,
'mod_version': config.mod_version,
'minecraft_version': config.minecraft_version,
'edition': (project.version - (config.mod_version + '.')),
's': '$'
])
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
exclude 'assets/twilightforest/patchouli_books/guide/book.json'
}
}
compileJava {
options.encoding = 'UTF-8'
}
jar {
classifier = 'universal'
manifest {
attributes 'FMLAT': 'tf_at.cfg'
}
}
repositories {
maven {
name 'progwm\'s Maven' // JEI + Mantle + TCon
url 'https://dvs1.progwml6.com/files/maven'
}
maven {
name 'tterrag\'s Maven' // CTM
url 'https://maven.tterrag.com/'
}
maven {
name 'Jared\'s Maven' // Immersive Engineering + Patchouli
url 'https://blamejared.com/maven'
}
maven {
name 'player\'s Maven' // Forestry
url 'http://maven.ic2.player.to/'
}
maven {
name 'Curseforge Maven' // Baubles + Thaumcraft
url 'https://minecraft.curseforge.com/api/maven/'
}
}
dependencies {
// progwml6
deobfCompile "mezz.jei:jei_${minecraft_version}:${jei_version}"
deobfCompile "slimeknights.mantle:Mantle:${minecraft_sub_version}-${mantle_version}"
deobfCompile "slimeknights:TConstruct:${minecraft_version}-${tcon_version}"
// tterrag
deobfCompile "team.chisel.ctm:CTM:MC${minecraft_version}-${ctm_version}"
deobfCompile "team.chisel:Chisel:MC${minecraft_version}-${chisel_version}"
// blamejared
deobfCompile "blusunrize:ImmersiveEngineering:${immersive_engineering_version}"
deobfCompile "vazkii.patchouli:Patchouli:${patchouli_version}"
// player
deobfCompile "net.sengir.forestry:forestry_${minecraft_version}:${forestry_version}"
// curseforge
deobfCompile "baubles:Baubles:${minecraft_sub_version}:${baubles_version}"
deobfCompile "thaumcraft:Thaumcraft:${minecraft_version}:${thaumcraft_version}"
}
task createPom {
doLast {
pom {
project {
groupId project.group
artifactId project.archivesBaseName
version project.version
inceptionYear '2012'
licenses {
license {
name 'LGPL 2.1'
url 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html'
distribution 'repo'
}
}
}
}.writeTo(libsDir.path + "/" + project.archivesBaseName + "-" + project.version + ".pom")
}
}
build.dependsOn createPom