forked from Magneticraft-Team/Magneticraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
157 lines (134 loc) · 4.16 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
buildscript {
ext.project_kotlin_version = '1.2.50'
ext.mod_version = '2.7.0'
repositories {
jcenter()
maven { name = 'forge'; url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$project_kotlin_version"
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'kotlin'
apply plugin: 'maven'
archivesBaseName = name
version mod_version + '-' + getBuildNumber()
group 'com.cout970.magneticraft'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
minecraft {
version = "1.12.2-14.23.5.2768"
mappings = "snapshot_20171003"
makeObfSourceJar = false
runDir = "run"
// replaceIn 'Magneticraft.kt'
// replace '@VERSION@', mod_version
}
repositories {
jcenter()
maven {
name = 'Mobius Repo'
url = 'http://mobiusstrip.eu/maven'
}
maven {
name = 'CB Repo'
url = 'http://chickenbones.net/maven/'
}
maven {
name = 'tehnut'
url = 'http://tehnut.info/maven/'
}
maven {
name = 'amadornes'
url = 'http://maven.amadornes.com/'
}
maven {
name = 'Progwml6 maven'
url 'http://dvs1.progwml6.com/files/maven'
}
maven {
name = 'TCL'
url 'http://maven.mcmoddev.com'
}
maven {
name = "Team Acronym Coders"
url "http://maven.blamejared.com"
}
maven {
name "BuildCraft"
url = "https://mod-buildcraft.com/maven"
}
maven {
name "Industrial foregoing"
url = "http://dyonovan.com/maven2"
}
maven {
url 'http://maven.covers1624.net/'
}
maven { name = 'forgelin'; url = 'http://maven.shadowfacts.net' }
mavenCentral()
}
dependencies {
// Kotlin
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$project_kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$project_kotlin_version"
compile "net.shadowfacts:Forgelin:1.8.3"
// JEI
// compile "mezz.jei:jei_1.12.2:4.11.0.+" // commented causes gradle to include jei twice
// Craft Tweaker
compile "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.9.+"
compile "CraftTweaker2:CraftTweaker2-API:4.1.9.+"
compile "CraftTweaker2:ZenScript:4.1.9.+"
compile "com.blamejared:MTLib:3.0.4.+"
// Tinkers
compile "slimeknights.mantle:Mantle:1.12-1.3.2.+"
compile "slimeknights:TConstruct:1.12.2-2.10.1.+"
// Buildcraft
compile "com.mod-buildcraft:buildcraft:7.99.12"
// compileOnly "com.buuz135.industrial.IndustrialForegoing:industrialforegoing:1.12.2-1.11.2-258"
// Forgelin and ModelLoader
compile files("lib/modelloader-1.1.7.jar")
testCompile group: 'junit', name: 'junit', version: '4.12'
}
processResources {
inputs.property "version", mod_version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': mod_version, 'mcversion': project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://" + (System.getenv("local_maven") != null ? System.getenv("local_maven") : System.getenv("bamboo_local_maven")))
}
}
}
task updateModVersion {
doLast {
exec {
workingDir 'src/main/kotlin/com/cout970/magneticraft'
commandLine 'sed', '-i', '-e', """s/version = "[1-9]*\\.[1-9]*\\.[1-9]*"/version = "${mod_version}"/g""", 'Magneticraft.kt'
}
}
}
compileKotlin.dependsOn updateModVersion
static String getBuildNumber() {
String buildNumber = System.getenv("BUILD_NUMBER") != null ? System.getenv("BUILD_NUMBER") : ""
if(buildNumber == "") {
buildNumber = System.getenv("bamboo_buildNumber") != null ? "." + System.getenv("bamboo_buildNumber") : ""
}
if(buildNumber == null || buildNumber == ""){
buildNumber = "dev"
}
return buildNumber
}