forked from MyEssentials/MyTown2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
125 lines (106 loc) · 3.72 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
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 {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
ivy {
name = 'ThaumCraft 4 API'
artifactPattern 'https://dl.dropboxusercontent.com/u/47135879/Thaumcraft-1.7.10-4.2.1.4-api.zip'
}
maven {
name = "pex-repo"
url = "http://pex-repo.zachsthings.com"
}
maven {
name = "bukkit-repo"
url = "http://repo.bukkit.org/content/groups/public/"
}
maven {
name = "Vault"
url = "http://nexus.theyeticave.net/content/repositories/pub_releases"
}
maven {
name = "gravity-repo"
url = "http://repo.gravitydevelopment.net"
}
}
// Load Configs
apply plugin: "curseforge"
apply plugin: "forge"
ext.configFile = file "build.properties"
ext.configFile.withReader {
def prop = new Properties()
prop.load(it)
ext.config = new ConfigSlurper().parse prop
}
if (System.env.TRAVIS_TAG != null && !System.env.TRAVIS_TAG.isEmpty()) {
ext.config.build_number = System.env.TRAVIS_TAG.substring(0, System.env.TRAVIS_TAG.length()-1)
ext.config.build_type = System.env.TRAVIS_TAG.substring(System.env.TRAVIS_TAG.length()-1)
} else {
ext.config.build_number = "0000"
ext.config.build_type = "r"
}
// Configure Everything
version = "${config.minecraft_version}-${config.build_number}${config.build_type}"
group = config.group
archivesBaseName = config.archivesBaseName
minecraft {
version = "${config.minecraft_version}-${config.forge_version}"
replace "@VERSION@", "${project.version}"
}
// Setup Deps
dependencies {
testCompile "junit:junit:4.11"
compile "com.esotericsoftware.reflectasm:reflectasm:${config.reflectasm_version}"
compile "org.beanshell:bsh:2.0b5"
// Include DB Drivers as deps
compile "org.xerial:sqlite-jdbc:${config.sqlite_version}"
compile "mysql:mysql-connector-java:${config.mysql_version}"
// Mod Deps
compile project(":MyEssentials-Core")
compile 'com.mod-buildcraft:buildcraft:6.1.8:dev'
compile 'net.industrial-craft:industrialcraft-2:2.2.645-experimental:api'
}
// Process Resources, injecting version numbers in
processResources {
inputs.property "mod_version", project.version
inputs.property "minecraft_version", project.minecraft.version
inputs.property "reflectasm_version", config.reflectasm_version
inputs.property "mysql_version", config.mysql_version
inputs.property "sqlite_version", config.sqlite_version
from(sourceSets.main.resources.srcDirs) {
include '*.info', 'plugin.yml'
expand 'mod_version': project.version, 'minecraft_version': project.minecraft.version, 'reflectasm_version': config.reflectasm_version, 'mysql_version': config.mysql_version, 'sqlite_version': config.sqlite_version
}
from(sourceSets.main.resources.srcDirs) {
exclude '*.info', 'plugin.yml'
}
}
// Setup Curse Upload task
curse {
apiKey = System.env.CURSEFORGEKEY
projectId = config.project_id
changelog = "" // TODO Add changelog support
releaseType = config.build_type.equals('a') ? "alpha" : (config.build_type.equals('b') ? "beta" : "release")
}
// Only allow if built by Travis-CI
if (System.env.CURSEFORGEKEY != null && System.env.TRAVIS == "true" && System.env.TRAVIS_PULL_REQUEST == "false" && (System.env.TRAVIS_TAG != null && !System.env.TRAVIS_TAG.isEmpty())) {
tasks.build.dependsOn("curse")
tasks.assemble.dependsOn("curse")
}