forked from DrZhark/mocreaturesdev
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
184 lines (160 loc) · 4.45 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
buildscript {
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven {
name 'Sponge API repo'
url 'https://repo.spongepowered.org/maven'
}
maven {
name = 'forge'
url = 'https://maven.minecraftforge.net/'
}
maven {
name = 'oss-sonatype-public'
url = 'https://oss.sonatype.org/content/repositories/public/'
}
maven {
url = 'https://plugins.gradle.org/m2/'
}
flatDir {
dirs "lib"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0'
classpath 'de.matthiasmann.twl:guiapi:1.3.0'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.github.hierynomus.license'
apply plugin: 'com.github.johnrengelman.shadow'
version = project.version
group = "com.almuradev.paydirtwashplant"
archivesBaseName = jarName
defaultTasks 'clean', 'licenseFormat', 'build'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
minecraft {
version = "${project.forgeVersion}"
runDir = "run"
mappings = project.mcpMappings
useDepAts = true
makeObfSourceJar = false
}
deobfMcMCP { failOnAtError = false }
deobfMcSRG { failOnAtError = false }
repositories {
mavenLocal()
mavenCentral()
maven {
// location of the maven that hosts JEI files
name = "Progwml6 maven"
url = "http://dvs1.progwml6.com/files/maven"
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "modmaven.k-4u.nl"
}
flatDir {
dirs "lib"
}
}
dependencies {
compile 'de.matthiasmann.twl:guiapi:1.3.0'
}
compileJava {
options.compilerArgs += [
'-Xlint:-processing',
]
options.deprecation = true
options.encoding = 'utf8'
}
license {
ext.name = project.name
ext.organization = project.organization
ext.url = project.url
header rootProject.file('License.txt')
ignoreFailures true
strictCheck true
include '**/*.java'
mapping {
java = 'SLASHSTAR_STYLE'
}
}
sourceSets.main {
compileClasspath += files("lib")
java.srcDirs "src/main/generated"
resources.srcDirs "src/resources"
}
// Used for ShadowJar Creation
jar {
classifier = 'original'
}
jar {
classifier 'original'
manifest {
attributes(
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.vm.version'] + ' (' + System.properties['java.vm.vendor'] + ')',
'Implementation-Title': project.name,
'Implementation-Version': version,
'Implementation-Vendor': url,
'FMLAT': "mocreatures_at.cfg"
)
}
}
if (JavaVersion.current().isJava8Compatible() || JavaVersion.current().isJava9Compatible()) {
tasks.withType(Javadoc) {
// disable the crazy super-strict doclint tool in Java 8
options.addStringOption('Xdoclint:none', '-quiet')
}
}
compileJava {
options.compilerArgs += [
'-Xlint:-processing',
]
options.deprecation = true
options.encoding = 'utf8'
}
idea {
module {
inheritOutputDirs = true
}
}
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, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
shadowJar {
mainSpec.sourcePaths.clear()
dependsOn reobfJar
classifier ''
archiveName = "Almura-MoCreatures-1.12.2-"+version+".jar"
exclude 'dummyThing'
relocate 'com.typesafe.config', 'configurate.typesafe.config'
dependencies {
include dependency('de.matthiasmann.twl:guiapi:1.3.0')
}
afterEvaluate {
from zipTree(reobfJar.jar)
}
}
artifacts {
archives shadowJar
}