-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
125 lines (108 loc) · 3.74 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 = "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
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 = "1.5"
ext.config.build_type = "r"
}
// Apply Plugins
apply plugin: "curseforge"
apply plugin: "forge"
// 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}-${config.minecraft_version}"
replace "@VERSION@", "${project.version}"
}
// Setup Deps
dependencies {
testCompile "junit:junit:4.11"
testCompile project(":MyEssentials-TestSuite")
// Database engines
compile "org.xerial:sqlite-jdbc:3.8.5-pre1"
compile "mysql:mysql-connector-java:5.1.32"
// Minecraft related deps
compile "com.forgeessentials:forgeessentials:1.4.5-SNAPSHOT:dev"
compile files("libs/bukkit-1.7.9-R0.2.jar")
compile "org.spongepowered:mixin:0.4.4-SNAPSHOT"
compile "com.sk89q.worldedit:worldedit-forge-mc1.7.10:6.0.2-SNAPSHOT:dev"
//compile "info.servertools.permission:ServerTools-PERMISSION:1.7.10-2.2.1.14:deobf"
// Other deps
compile "org.beanshell:bsh:2.0b5"
compile "com.esotericsoftware.reflectasm:reflectasm:${config.reflectasm_version}"
}
// 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'
expand 'mod_version': project.version, 'minecraft_version': project.minecraft.version, 'reflectasm_version': config.reflectasm_version
}
//from(sourceSets.main.resources.srcDirs) {
// exclude '*.info'
//}
}
// Tests
task testSuite(type: Test) {
include '**/MECTestSuite.class'
reports.junitXml.destination = "$buildDir/test-results/suite"
reports.html.destination = "$buildDir/test-results/suit"
}
// Modify jar. Generate custom manifest
jar {
classifier = 'universal'
manifest {
attributes (
'FMLCorePlugin': 'myessentials.DepLoader',
'FMLCorePluginContainsFMLMod': 'true'
)
}
}
// 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")
}