forked from AbrarSyed/SecretRoomsMod-forge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
121 lines (100 loc) · 3.42 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
// this part adds in ForgeGradle
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"
// stuff specific to my mod
group = 'com.github.abrarsyed'
version = "4.7.1"
archivesBaseName = 'secretroomsmod'
minecraft {
version = "1.8-11.14.0.1290-1.8" // grab latest forge
runDir = "run"
mappings = 'snapshot_20150124'
// replacing
replace "@CHANGE_VERSION@", "[4.7,)"
replace "@MC_VERSION@", project.minecraft.version
replace "@VERSION@", project.version
replaceIn "SecretRooms.java"
}
// add some stuff to the version
// spit out the version for debugging sake
logger.lifecycle ""+version
version = "${minecraft.version}-$version.${System.getenv().BUILD_NUMBER}"
logger.lifecycle ""+version
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in text files, not binary ones.
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
// replace version and MCVersion
// forge version is also accessible via project.minecraftforgeVersion
// it contains the full minecraft version, including buildNumber
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not text
from(sourceSets.main.resources.srcDirs) { exclude '**/*.info' }
}
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/"
}
}
dependencies {
//compile "mcp.mobius.waila:Waila:1.5.5_1.7.10"
//compile "codechicken:NotEnoughItems:1.7.10-1.0.3.57:dev"
//compile 'org.projectlombok:lombok:1.12.6'
//compile 'net.malisis:malisisdoors:1.7.10-1.1.5:dev'
}
// because the normal output has been made to be obfuscated
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'dev'
}
// add a source jar
task sourceJar(type: Jar, dependsOn: "sourceMainJava") {
from "build/sources/java"
classifier = 'sources'
}
// add a javadoc jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
// some crazy stuff to make sure the chicken stuff is in the mods folder...
// because it wont work otherwise... because FML doesnt laod coremods from the classpath
task copyChicken(type: Copy, dependsOn: "extractUserDev") {
from { configurations.compile }
include "**/*Chicken*.jar", "**/*NotEnoughItems*.jar", "**/*malisiscore*.jar"
exclude "**/CodeChickenLib*" // because CCC downloads it anyways.. -_-
into file(minecraft.runDir + "/mods")
mustRunAfter "deobfBinJar"
mustRunAfter "repackMinecraft"
}
tasks.setupDevWorkspace.dependsOn copyChicken
tasks.setupDecompWorkspace.dependsOn copyChicken
// deployement stuff
configurations { deployerJars }
dependencies { deployerJars "org.apache.maven.wagon:wagon-ssh:2.2" }
artifacts {
archives sourceJar
archives deobfJar
archives javadocJar
}