-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
100 lines (83 loc) · 3.05 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
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
apply plugin: 'forge'
project.ext {
major = "0"
minor = "0"
}
version = "1.7.2-${project.ext.major}.${project.minor}"
group= "net.quetzi.bluepower"
archivesBaseName = "BluePower"
if (System.getenv().BUILD_NUMBER != null){
version += ".${System.getenv().BUILD_NUMBER}"
}else{
version += " - err"
}
def grabDep(name, url){
ant.get(src: url, dest: 'dep')
file("dep/" + url.substring(url.lastIndexOf("/"))).renameTo(file("dep/" + name + ".jar"))
}
dependencies {
def f = new File('dep/')
if(f.exists()){
f.delete()
}
f.mkdirs()
if(!f.exists()){
f.mkdir()
}
println(" Downloading dependencies!")
grabDep('ccl', 'http://files.minecraftforge.net/maven/codechicken/CodeChickenLib/1.7.2-1.1.1.81/CodeChickenLib-1.7.2-1.1.1.81-dev.jar')
grabDep('fmp', 'http://files.minecraftforge.net/maven/codechicken/ForgeMultipart/1.7.2-1.1.0.282/ForgeMultipart-1.7.2-1.1.0.282-dev.jar')
grabDep('ccc', 'http://www.chickenbones.craftsaddle.org/Files/New_Versions/1.7.2/CodeChickenCore-1.7.2-1.0.0-dev.jar')
grabDep('nei', 'http://www.chickenbones.craftsaddle.org/Files/New_Versions/1.7.2/NotEnoughItems-1.7.2-1.0.1-dev.jar')
grabDep('ccc', 'http://www.chickenbones.craftsaddle.org/Files/New_Versions/1.7.2/CodeChickenCore-1.7.2-1.0.0-dev.jar')
grabDep('oc', 'http://ci.cil.li/job/OpenComputers-MC1.7/190/artifact/build/libs/OpenComputers-MC1.7.2-1.3.0.190-beta.1-deobf.jar')
grabDep('waila', 'http://mobiusstrip.eu/maven/mcp/mobius/waila/Waila/1.5.2a/Waila-1.5.2a-dev.jar')
println(" Adding dependencies!")
compile files("dep/ccl.jar", "dep/fmp.jar", "dep/nei.jar", "dep/ccc.jar", "dep/oc.jar", "dep/waila.jar")
println(" Finished adding dependencies!")
}
minecraft {
version = "1.7.2-10.12.2.1121"
assetDir = "eclipse/assets"
// replacing stuff in the source
replace '@MAJOR@', project.major
replace '@MINOR@', project.minor
replace '@MC_VERSION@', version
if(System.getenv("BUILD_NUMBER") != null){
replace '@BUILD_NUMBER@', System.getenv("BUILD_NUMBER")
}else{
replace '@BUILD_NUMBER@', 0
}
}
processResources
{
// 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'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}