-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
96 lines (82 loc) · 2.63 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
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 = "bukkit-repo"
url = "http://repo.bukkit.org/content/groups/public/"
}
maven {
name = "SpongePowered"
url = "https://repo.spongepowered.org/maven"
}
maven {
name = "sk89q"
url = "http://maven.sk89q.com/artifactory/repo/"
}
}
// 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"
testCompile project(":MyEssentials-TestSuite")
// Subproject deps
compile project(":MyEssentials-Core")
compile project(":MyPermissions")
}
// 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
from(sourceSets.main.resources.srcDirs) {
include '*.info', 'plugin.yml'
expand 'mod_version': project.version, 'minecraft_version': project.minecraft.version, 'reflectasm_version': config.reflectasm_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")
}