-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
177 lines (153 loc) · 5.3 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url = "https://minecraft.curseforge.com/api/maven" }
maven {
url = 'https://repo.spongepowered.org/maven'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath "com.github.jengelman.gradle.plugins:shadow:1.2.3"
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
classpath group: 'org.locationtech.jts', name: 'jts-core', version: '1.18.1'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'org.spongepowered.mixin'
apply plugin: "com.github.johnrengelman.shadow"
version = "1.7"
group = "me.vaxry"
archivesBaseName = "HARAKIRI"
def buildmode = "RELEASE"
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
idea {
module {
inheritOutputDirs = false
outputDir = compileJava.destinationDir
testOutputDir = compileTestJava.destinationDir
}
}
minecraft {
version = "1.12.2-14.23.5.2768"
runDir = "run"
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "stable_39"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}
repositories {
maven { url = "https://repo.spongepowered.org/maven" }
maven {
name = "jitpack.io"
url = "https://jitpack.io"
}
mavenCentral()
}
dependencies {
compile("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
exclude module: 'launchwrapper'
exclude module: 'guava'
exclude module: 'gson'
exclude module: 'commons-io'
}
compile group: "com.googlecode.json-simple", name: "json-simple", version: "1.1.1"
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.luaj:luaj-jse:3.0.1'
compile 'club.minnced:java-discord-rpc:2.0.2'
compile group: 'org.locationtech.jts', name: 'jts-core', version: '1.18.1'
compile("com.github.vialdevelopment:attendance:rewrite-SNAPSHOT")
}
jar {
manifest {
attributes 'MixinConfigs': 'mixins.harakiri.json'
attributes 'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker'
attributes 'TweakOrder': 0
attributes 'FMLCorePlugin': 'me.vaxry.harakiri.impl.fml.core.HarakiriLoadingPlugin'
attributes 'FMLCorePluginContainsFMLMod': 'true'
attributes 'FMLAT': 'harakiri_at.cfg'
attributes 'ForceLoadAsMod': 'true'
}
}
reobf {
jar {
mappingType = 'SEARGE'
}
shadowJar {
//mappingType = 'NOTCH'
mappingType = 'SEARGE'
classpath = sourceSets.main.compileClasspath
}
}
shadowJar {
dependencies {
include(dependency('org.spongepowered:mixin:0.7.11-SNAPSHOT'))
include(dependency('com.googlecode.json-simple:json-simple:1.1.1'))
include(dependency('org.luaj:luaj-jse:3.0.1'))
include(dependency('net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'))
include(dependency('club.minnced:java-discord-rpc'))
include(dependency(group: 'org.locationtech.jts', name: 'jts-core', version: '1.18.1'))
include(dependency("com.github.vialdevelopment:attendance"))
}
manifest {
attributes 'FMLCorePlugin': 'me.vaxry.harakiri.impl.fml.core.HarakiriLoadingPlugin'
attributes 'FMLCorePluginContainsFMLMod': 'true'
attributes 'FMLAT': 'harakiri_at.cfg'
attributes 'ForceLoadAsMod': 'true'
}
exclude 'dummyyy'
classifier = 'full'
}
task signJar(type: SignJar, dependsOn: reobfJar) {
onlyIf {
project.hasProperty('keyStore')
}
keyStore = project.findProperty('keyStore')
alias = project.findProperty('keyStoreAlias')
storePass = project.findProperty('keyStorePass')
keyPass = project.findProperty('keyStoreKeyPass')
inputFile = jar.archivePath
outputFile = jar.archivePath
}
build.dependsOn {
[
'shadowJar',
'reobfShadowJar',
'signJar'
]
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version': project.version, 'mcversion': project.minecraft.version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
mixin {
defaultObfuscationEnv searge
add sourceSets.main, 'mixins.harakiri.refmap.json'
}
if (buildmode.equals("IDE")) {
sourceSets {
main(({
output.resourcesDir = output.classesDir
}))
}
}