-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
115 lines (97 loc) · 2.96 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
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "https://maven.minecraftforge.net"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
import org.apache.tools.ant.filters.ReplaceTokens
allprojects {
apply plugin: 'java'
}
task clean_dist_folder(type: Delete){
delete "${rootDir}/dist"
}
subprojects {
apply plugin: 'idea'
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'base'
apply plugin: 'maven'
minecraft {
version = "1.12.2-14.23.4.2705"
mappings = "stable_39"
makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}
group = 'io.github.crucible'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
repositories {
maven {
name = 'spongepowered-repo'
url = 'https://repo.spongepowered.org/maven/'
}
mavenCentral()
}
dependencies {
compile "org.spongepowered:mixin:0.8.1-SNAPSHOT"
compileOnly 'org.jetbrains:annotations:16.0.2'
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
}
ext {
mixinSrg = new File(project.buildDir, 'mixins/mixin.grimoire.srg')
mixinRefMapName = name.toLowerCase() + ".refmap.json"; //Sub-Project Name
mixinRefMap = new File(project.buildDir, "mixins/" + mixinRefMapName)
}
jar {
from project.mixinRefMap
}
compileJava {
options.compilerArgs += [
'-Xlint:-processing',
"-AoutSrgFile=${project.mixinSrg.canonicalPath}",
"-AoutRefMapFile=${project.mixinRefMap.canonicalPath}",
"-AreobfSrgFile=${project.file('build/srgs/mcp-srg.srg').canonicalPath}"
]
}
processResources{
eachFile{
filter ReplaceTokens, tokens:[MIXIN_REFMAP_NAME: mixinRefMapName]
}
}
task build_them_all {
dependsOn clean_dist_folder
dependsOn build
doLast {
def baseName = project.archivesBaseName
def version = project.version
def group = project.group
def DIST_DIR = "${rootDir}/dist"
def SRC_DIR = "${buildDir}/libs"
ant.mkdir(dir: DIST_DIR)
ant.copy(todir: DIST_DIR) {
fileset(dir: SRC_DIR,
includes: "${baseName}*.jar,${baseName}*.jar")
}
}
}
//Intelij IDEAL has a "BUG" that hides
// theses functions bellow from the
// subprojects gradle. Altering them
// make them reapear
tasks.build.doFirst {
println "Grimoire BuildProject"
}
tasks.clean.doFirst {
println "Grimoire CleanProject!"
}
}