forked from mattmess1221/TabbyChat-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
90 lines (78 loc) · 1.92 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
plugins{
id 'net.minecraftforge.gradle.tweaker-client' version '2.0.2'
}
ext {
utils = rootProject.project(':MnM-Utils')
api = rootProject.project(':api')
forge = rootProject.project(':forge')
macros = rootProject.project(':macros')
rev = '0.31'
}
def buildServer = System.env.BUILD_ID != null
group = 'mnm.mods'
archivesBaseName = 'TabbyChat'
version = "2.0-beta-SNAPSHOT.${System.env.BUILD_ID}"
if (buildServer) version += ".${System.env.GIT_COMMIT?.substring(0,6)}"
// version = '2.0.0-beta3.1'
apply from: utils.file('gradle/minecraft.gradle')
minecraft{
// Replace the version string
replace(
"@VERSION@": project.version,
"@REVISION@": project.rev,
"@MCVERSION@": project.minecraft.version
)
tweakClass = 'com.mumfrey.liteloader.launch.LiteLoaderTweaker'
}
allprojects {
repositories {
flatDir {
dirs rootProject.file('flat')
}
}
}
dependencies {
// Add util library
deobfProvided 'com.mumfrey:liteloader:1.8-SNAPSHOT:srgnames'
provided utils
compile api
compile 'net.sf.jazzy:jazzy:0.5.2-rtext-1.4.1-2'
testCompile 'junit:junit:4.12'
}
jar {
extension 'litemod'
from(configurations.compile.collect {it.isDirectory() ? it : zipTree(it)}) {
exclude 'META-INF/***'
}
from {forge.sourceSets.main.output}
}
sourceJar {
from {[api,forge]*.sourceSets.main.allSource}
}
task jarSrg(type:Jar) {
dependsOn jar
classifier "srg"
from zipTree(jar.archivePath)
}
artifacts.archives jarSrg
reobf {
jar.task.dependsOn jarSrg
jarSrg {
useSrgSrg()
}
}
afterEvaluate {
evaluationDependsOnChildren()
if (buildServer) {
// disable extra artifacts on build server
allprojects {
tasks.withType(Jar).findAll {
it.classifier in ['srg', 'sources']
}*.enabled = false
}
// also disable reobf tasks
[utils.reobf.jarSrg,reobf.jarSrg]*.task*.enabled = false
// find jars and move their destination dir to /build/libs of root project
[utils,macros].each {it.jar.destinationDir file('build/libs')}
}
}