This repository has been archived by the owner on Apr 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
126 lines (104 loc) · 3.14 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 = "juanmuscaria"
url = "https://github.com/juanmuscaria/maven/raw/master"
}
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-1.5.6-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: 'forge'
minecraft {
version = "1.7.10-10.13.4.1614-1.7.10"
}
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/'
}
maven { url 'https://jitpack.io' }
mavenCentral()
}
dependencies {
implementation("com.github.CrucibleMC:Grimoire-legacy:legacy-1.7.10-SNAPSHOT")
compile "org.spongepowered:mixin:0.7.11-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
}
reobf {
addExtraSrgFile project.mixinSrg
}
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 copySrgs(type: Copy, dependsOn: 'genSrgs') {
from plugins.getPlugin("forge").delayedFile('{SRG_DIR}')
include '**/*.srg'
into 'build/srgs'
}
compileJava.dependsOn copySrgs
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")
}
}
}
//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!"
}
}