forked from Qmunity/BluePower
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·173 lines (146 loc) · 4.89 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
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'
}
}
repositories {
maven { // The repo from which to get waila
name "Mobius Repo"
url "http://mobiusstrip.eu/maven"
}
maven { // the repo from which to get NEI and stuff
name 'CB Repo'
url "http://chickenbones.net/maven/"
}
maven {
name 'OpenComputers'
url = "http://maven.cil.li/"
}
maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
}
apply plugin: 'forge'
project.ext {
major = "0"
minor = "1"
mcVersion = "1.7.10"
}
version = "${project.ext.major}.${project.minor}"
group = "com.bluepowermod"
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.10-1.1.1.93/CodeChickenLib-1.7.10-1.1.1.93-dev.jar')
//grabDep('fmp', 'http://files.minecraftforge.net/maven/codechicken/ForgeMultipart/1.7.2-1.1.0.294/ForgeMultipart-1.7.2-1.1.0.294-dev.jar')
//grabDep('ccc', 'http://www.chickenbones.craftsaddle.org/Files/New_Versions/1.7.10/CodeChickenCore-1.7.10-1.0.1.8-dev.jar')
//grabDep('nei', 'http://www.chickenbones.craftsaddle.org/Files/New_Versions/1.7.10/NotEnoughItems-1.7.10-1.0.2.15-dev.jar')
//grabDep('oc', 'http://ci.cil.li/job/OpenComputers-1.3-MC1.7.10/20/artifact/build/libs/OpenComputers-MC1.7.10-1.3.0.20-deobf.jar')
//grabDep('waila', 'http://mobiusstrip.eu/maven/mcp/mobius/waila/Waila/1.5.3_1.7.10/Waila-1.5.3_1.7.10-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")
compile "codechicken:CodeChickenLib:1.7.10-1.1.1.95:dev"
compile "codechicken:CodeChickenCore:1.7.10-1.0.2.11:dev"
compile "codechicken:NotEnoughItems:1.7.10-1.0.2.26:dev"
compile "codechicken:ForgeMultipart:1.7.10-1.1.0.297:dev"
compile "mcp.mobius.waila:Waila:1.5.3_1.7.10"
compile "li.cil.oc:OpenComputers:MC1.7.10-1.3.0.20:api"
compile 'net.industrial-craft:industrialcraft-2:2.2.558-experimental:api'
println(" Finished adding dependencies!")
}
minecraft {
version = "${project.ext.mcVersion}-10.13.0.1180"
runDir = "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'
}
}
jar {
appendix = "${project.ext.mcVersion}"
classifier = "universal"
}
task deobfJar(type: Jar) {
from(sourceSets.main.output) {
appendix = "${project.ext.mcVersion}"
classifier = "deobf"
}
}
// add a source jar
task sourceJar(type: Jar) {
from sourceSets.main.resources.srcDirs {
appendix = "${project.ext.mcVersion}"
classifier = "src"
}
}
// add a javadoc jar
task javadocZip(type: Zip, dependsOn: javadoc) {
appendix = "${project.ext.mcVersion}"
classifier = "javadoc"
from 'build/docs/javadoc'
}
// Create API library zip
task apiZip(type: Zip) {
from(sourceSets.main.java) {
include 'com/bluepowermod/api/**'
appendix = "${project.ext.mcVersion}"
classifier = "api"
}
}
apiZip.mustRunAfter deobfJar
artifacts {
archives sourceJar
archives deobfJar
archives javadocZip
archives apiZip
}