forked from TheCodex6824/ThaumicAugmentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
239 lines (188 loc) · 7.18 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
maven {
name 'FancyGradle'
url 'https://gitlab.com/api/v4/projects/26758973/packages/maven'
}
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: 'wtf.gofancy.fancygradle', name: 'wtf.gofancy.fancygradle.gradle.plugin', version: '1.1.+'
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'wtf.gofancy.fancygradle'
fancyGradle {
patches {
resources
coremods
asm
codeChickenLib
}
}
// eclipse thinks test needs resources if this is not here
sourceSets {
test {
resources.setSrcDirs([])
}
}
import net.minecraftforge.gradle.common.tasks.SignJar
import org.apache.tools.ant.filters.ReplaceTokens
repositories {
maven {
url = 'https://www.cursemaven.com/'
content {
includeGroup "curse.maven"
}
}
}
version = "${mcversion}-${version}"
group = 'thecodex6824.thaumicaugmentation' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'ThaumicAugmentation'
//sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.
ext {
if (!project.hasProperty('certFingerprint')) {
certFingerprint = ''
}
}
minecraft {
mappings channel: 'stable', version: '39-1.12'
//makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
accessTransformer = file('src/main/resources/META-INF/thaumicaugmentation_at.cfg')
runs {
client {
workingDirectory file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
property 'fml.coreMods.load', 'thecodex6824.thaumicaugmentation.core.ThaumicAugmentationCore'
environment 'MC_VERSION', '1.12.2'
mods {
thaumicaugmentation {
source sourceSets.main
}
}
}
server {
workingDirectory file('run')
// Recommended logging data for a userdev environment
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
property 'fml.coreMods.load', 'thecodex6824.thaumicaugmentation.core.ThaumicAugmentationCore'
environment 'MC_VERSION', '1.12.2'
mods {
thaumicaugmentation {
source sourceSets.main
}
}
}
}
}
dependencies {
minecraft "net.minecraftforge:forge:${mcversion}-${forgeversion}"
implementation fg.deobf('curse.maven:thaumcraft-223628:2629023')
implementation fg.deobf('curse.maven:baubles-227083:2518667')
compileOnly 'curse.maven:jeid-296289:2919737'
compileOnly 'curse.maven:botania-225643:2846950'
compileOnly 'curse.maven:auracontrol-397104:3013979'
compileOnly 'curse.maven:electroblobs-wizardry-265642:2929294'
testImplementation 'junit:junit:4.13'
runtimeOnly 'curse.maven:jei-238222:2995897'
runtimeOnly 'curse.maven:thaumic-jei-285492:2705304'
runtimeOnly 'curse.maven:the-one-probe-245211:2667280'
runtimeOnly 'curse.maven:ctm-267602:2915363'
// if the curse maven is down or otherwise not working:
// comment the above "implementation", "compileOnly", and "runtimeOnly" entries
// uncomment the following and put jars into subfolders in the "lib" folder
//implementation fileTree(dir: 'lib/implementation', include: '*.jar')
//compileOnly fileTree(dir: 'lib/compileOnly', include: '*.jar')
//runtimeOnly fileTree(dir: 'lib/runtimeOnly', include: '*.jar')
// note that the first line has no deobf - if you need it use BON2 or something
// to avoid needing test jars, comment the "testImplementation" lines and put "-x test" on the command line
}
idea {
module {
inheritOutputDirs = true
}
}
task filterTokens(type: Sync) {
// this will ensure that this task is redone when the versions change.
inputs.property 'version', version
inputs.property 'apiversion', apiversion
inputs.property 'certFingerprint', certFingerprint
from sourceSets.main.java
filter(ReplaceTokens, tokens: [APIVERSION: apiversion.toString(), VERSION: version.toString(), FINGERPRINT: certFingerprint.toString()])
into "$buildDir/src/$sourceSets.main.name/$sourceSets.main.java.name"
}
compileJava.source = filterTokens.outputs
processResources {
// required to allow file expansion later
duplicatesStrategy = 'include'
// this will ensure that this task is redone when the versions change.
inputs.property 'version', version
inputs.property 'apiversion', apiversion
inputs.property 'mcversion', mcversion
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version': version, 'mcversion': mcversion, 'forgeversion': forgeversion, 'forgeminversion': forgeminversion
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
javadoc {
include 'thecodex6824/thaumicaugmentation/api/**'
}
task signJar(type: SignJar) {
onlyIf { project.hasProperty('keyStore') }
if (project.hasProperty('keyStore')) { // needed to skip gradle trying to find vars
keyStore = project.keyStore
alias = project.alias
storePass = project.storePass
keyPass = project.keyPass
inputFile = jar.archivePath
outputFile = jar.archivePath
}
}
jar {
manifest {
attributes 'FMLAT': 'thaumicaugmentation_at.cfg'
attributes 'FMLCorePlugin': 'thecodex6824.thaumicaugmentation.core.ThaumicAugmentationCore'
attributes 'FMLCorePluginContainsFMLMod': 'true'
}
afterEvaluate { project.getTasks().getByName('reobfJar').finalizedBy(signJar) }
}
jar.finalizedBy('reobfJar')
task javadocJar(type: Jar, dependsOn: javadoc) {
from 'build/docs/javadoc'
classifier = 'javadoc'
}
task apiJar(type: Jar) {
from sourceSets.main.output
from sourceSets.main.java
classifier = 'api'
include 'thecodex6824/thaumicaugmentation/api/**'
}
task sourcesJar(type: Jar) {
from sourceSets.main.java
classifier = 'sources'
}
artifacts {
archives apiJar
archives javadocJar
archives sourcesJar
}
test {
useJUnit()
maxHeapSize = '1G'
}