-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
165 lines (131 loc) · 4.61 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
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net/' }
jcenter()
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: 'wtf.gofancy.fancygradle'
fancyGradle {
patches {
resources
coremods
asm
}
}
// eclipse thinks test needs resources if this is not here
// but eclipse is still broken anyway so oh well
sourceSets {
test {
resources.setSrcDirs([])
}
}
import org.apache.tools.ant.filters.ReplaceTokens
repositories {
maven {
url = 'https://www.cursemaven.com/'
content {
includeGroup "curse.maven"
}
}
}
version = "${mcversion}-${version}"
group = "thecodex6824.auracontrol" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "AuraControl"
java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.
minecraft {
mappings channel: 'stable', version: '39-1.12'
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'
mods {
auracontrol {
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'
mods {
auracontrol {
source sourceSets.main
}
}
}
}
}
dependencies {
minecraft "net.minecraftforge:forge:${mcversion}-${forgeversion}"
implementation fg.deobf('curse.maven:thaumcraft-223628:2629023')
runtimeOnly 'curse.maven:jei-238222:2995897'
runtimeOnly 'curse.maven:thaumic-jei-285492:2705304'
runtimeOnly 'curse.maven:baubles-227083:2518667'
}
// https://stackoverflow.com/questions/30038540/replace-token-in-file-before-building-but-keep-token-in-sources/54094378#54094378
task filterTokens(type: Sync) {
// this will ensure that this task is redone when the versions change.
inputs.property 'version', version
inputs.property 'apiversion', apiversion
from sourceSets.main.java
filter(ReplaceTokens, tokens: [APIVERSION: apiversion.toString(), VERSION: version.toString()])
into "$buildDir/filteredSrc"
}
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'
}
}
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/auracontrol/api/**'
}
task sourcesJar(type: Jar) {
from sourceSets.main.java
classifier = 'sources'
}
artifacts {
archives apiJar
archives javadocJar
archives sourcesJar
}