forked from ForestryMC/ForestryMC
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
232 lines (195 loc) · 6.81 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
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.47"
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.0.9"
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: "se.bjurr.gitchangelog.git-changelog-gradle-plugin"
String semver = "${version_major}.${version_minor}.${version_patch}"
version = "${semver}.${getBuildNumber()}"
if (project.hasProperty('buildQualifier')) {
version = project.version + '-' + project.buildQualifier
}
group = "net.sengir.forestry" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "forestry_" + mcversion
ext.dirDest = './build/dist'
// java version
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.sourceCompatibility = JavaVersion.VERSION_1_8
compileJava.targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
compileJava {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
}
minecraft {
mappings channel: 'snapshot', version: mcp_mappings
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.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 {
forestry {
source sourceSets.main
}
}
}
server {
workingDirectory project.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 {
foresty {
source sourceSets.main
}
}
}
data {
workingDirectory project.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'
args '--mod', 'forestry', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods {
forestry {
source sourceSets.main
}
}
}
}
}
repositories {
/*maven {
url = 'http://maven.mcmoddev.com'
}*/
maven {
url "http://dvs1.progwml6.com/files/maven"
}
maven {
// FTB GUI Library
name = "LatvianModder maven"
url 'https://maven.latmod.com/'
}
/*maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
maven {
name = "Modmuss50"
url = "http://maven.modmuss50.me"
}
maven {
url = 'https://mod-buildcraft.com/maven'
}*/
}
dependencies {
minecraft "net.minecraftforge:forge:${forgeversion}"
/*deobfProvided "net.darkhax.tesla:Tesla-${tesla_mcversion}:${tesla_version}"*/
compileOnly fg.deobf("mezz.jei:jei-${jei_mcversion}:${jei_version}:api")
// require FTB GUI Library
compile fg.deobf("com.feed_the_beast.mods:ftb-gui-library:${ftb_gui_lib_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_mcversion}:${jei_version}")
/*deobfProvided "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
deobfProvided "TechReborn:TechReborn-${TR_mcversion}:${TR_version}:api"
deobfProvided "com.mod-buildcraft:buildcraft-api:${buildcraft_version}"*/
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
}
configurations {
api
compile.extendsFrom api
}
// prevent java 8's strict doclint for javadocs from failing builds
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
jar {
from sourceSets.main.output.classesDirs
from sourceSets.main.output.resourcesDir
manifest {
attributes([
"Specification-Title" : "Forestry",
"Specification-Vendor" : "SirSengir",
"Specification-Version" : "${semver}",
"Implementation-Title" : project.name,
"Implementation-Version" : "${version}",
"Implementation-Vendor" : "SirSengir",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"FMLAT" : 'forestry_at.cfg'
])
}
}
jar.finalizedBy('reobfJar')
task apiJar(type: Jar) {
// TODO: when FG bug is fixed, remove allSource from the api jar.
// https://github.com/MinecraftForge/ForgeGradle/issues/369
// Gradle should be able to pull them from the -sources jar.
from sourceSets.main.allSource
from sourceSets.main.output
include 'forestry/api/**'
classifier = 'api'
}
artifacts {
archives apiJar
}
uploadArchives {
repositories {
if (project.hasProperty('mavenDir')) {
mavenDeployer {
repository(url: "file://" + mavenDir)
}
} else {
println 'Archives upload disabled, mavenDir in gradle.properties is missing.'
}
}
}
def getBuildNumber() {
return "$System.env.BUILD_NUMBER" != "null" ? "$System.env.BUILD_NUMBER" : "0"
}
idea {
module {
for (String excludeDirName in ["run", "out", "logs", "gradle"]) {
File excludeDir = new File(projectDir, excludeDirName)
excludeDirs.add(excludeDir)
}
}
}
task makeChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
filePath = "changelog.html"
untaggedName = "Current release ${project.version}"
fromCommit = "5a3850c2642e535656d090d1473054d5fa8d3331"
toRef = "HEAD"
templateContent = file('changelog.mustache').getText('UTF-8')
}
curseforge {
apiKey = project.hasProperty('curseforge_apikey') ? project.curseforge_apikey : '0'
project {
id = curse_project_id
changelog = file('changelog.html')
changelogType = 'html'
releaseType = 'beta'
}
}
afterEvaluate {
tasks.curseforge59751.dependsOn.add(makeChangelog)
}