forked from SpongePowered/Sponge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
102 lines (88 loc) · 3.68 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
// Gradle plugins
buildscript {
repositories {
maven {
name = 'gradle-plugins'
url = 'https://plugins.gradle.org/m2'
}
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
maven {
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
}
dependencies {
// VanillaGradle contains a custom ForgeGradle extension for SpongeCommon (see below)
classpath 'gradle.plugin.net.minecrell:vanillagradle:2.2-5'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'gradle.plugin.net.minecrell:licenser:0.3'
classpath 'gradle.plugin.org.spongepowered:spongegradle:0.8.1'
classpath 'org.spongepowered:mixingradle:0.5-SNAPSHOT'
}
}
// Create task to resolve SpongeAPI revision
apply from: 'api-revision.gradle'
// Apply shared ForgeGradle configuration
ext.common = project
apply from: 'gradle/minecraft.gradle'
// Inherit SpongeCommon version from SpongeAPI
ext {
isSnapshot = api.version.contains('-SNAPSHOT')
isImplRC = common.recommendedVersion.contains('-SNAPSHOT')
trimmedApiVersion = api.version.toString().replace("-SNAPSHOT", "")
apiSplitVersion = trimmedApiVersion.split("\\.")
// This is to determine if the split api version has at the least a minimum version.
apiMinor = apiSplitVersion.length > 1 ? apiSplitVersion[1] : (apiSplitVersion.length > 0 ? apiSplitVersion.last : '0')
correctedMinorVersion = Math.max(Integer.parseInt(apiMinor) - 1, 0)
// And then here, we determine if the api version still has a patch version, to just ignore it.
apiReleaseVersion = apiSplitVersion.length > 2 ? apiSplitVersion[0] + '.' + apiSplitVersion[1] : trimmedApiVersion
apiSuffix = isSnapshot ? ext.apiSplitVersion[0] + '.' + correctedMinorVersion : apiReleaseVersion
fixedApiVersionWithDecreasedMinor = apiSplitVersion.length > 2 ? apiSplitVersion[0] + '.' + correctedMinorVersion + '.' + apiSplitVersion[2] : apiSplitVersion[0] + '.' + correctedMinorVersion
}
version = minecraftVersion + '-' + ext.apiSuffix + '.' + common.recommendedVersion
ext.apiVersion = isSnapshot ? ext.fixedApiVersionWithDecreasedMinor : ext.apiReleaseVersion
dependencies {
compile(api) {
exclude module: 'asm'
}
compile(testPlugins) {
exclude module: 'spongeapi'
}
compile 'org.ow2.asm:asm-debug-all:5.2'
compile('org.spongepowered:mixin:0.8') {
exclude module: 'launchwrapper'
exclude group: 'org.apache.logging.log4j', module: 'log4j-core'
}
// log4j2 slf4j implementation
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.8.1'
// Database connectors
compile 'com.zaxxer:HikariCP:2.6.3'
runtime 'org.mariadb.jdbc:mariadb-java-client:2.6.0'
compile 'com.h2database:h2:1.4.196'
runtime 'org.xerial:sqlite-jdbc:3.20.0'
forgeGradleMcDeps('net.minecraft:launchwrapper:1.11') {
transitive = false
}
// Taken from https://stackoverflow.com/a/7969292
testCompile api.sourceSets.test.output
}
uploadArchives {
repositories {
mavenDeployer {
pom.whenConfigured {
pom -> pom.dependencies.removeAll { it.groupId == 'org.spongepowered' && it.artifactId == 'testplugins' }
}
}
}
}
// Include API dependencies in our POM
ext.shadedDevProject = api
test {
systemProperty 'lwts.tweaker', 'org.spongepowered.common.launch.TestTweaker'
// If we try to generate HTML reports, we end up trying to generate a report
// for all of the catalog method subs-tests, which takes an incredibly long amount of time
reports.html.enabled = false
}