-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
206 lines (176 loc) · 5.4 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
plugins {
id 'java'
id "xyz.wagyourtail.unimined" version "1.2.0-SNAPSHOT" apply false
id "com.diffplug.spotless" version "6.13.0"
id "com.github.spotbugs" version "6.0.4"
}
// Edit in gradle.properties
group = project_group
version = "${version_major}.${version_minor}.${version_patch}"
subprojects {
apply plugin: "xyz.wagyourtail.unimined"
apply plugin: "com.diffplug.spotless"
apply plugin: "com.github.spotbugs"
apply plugin: "java"
apply plugin: 'maven-publish'
group = rootProject.group
version = rootProject.version
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
// Add your maven repositories here
repositories {
mavenCentral()
// First Dark Dev Maven. Can be removed
maven {
url "https://maven.firstdark.dev/releases"
}
// First Dark Dev Mirror maven. Do not remove.
// It's required by this project to pull in dependencies for the modloaders
maven {
url "https://mcentral.firstdark.dev/releases"
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
maven {
name = "wagyourtail releases"
url = "https://maven.wagyourtail.xyz/releases"
}
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven/'
}
maven {
name = 'overminddl1'
url = 'https://gregtech.overminddl1.com/'
content {
excludeGroupByRegex "de.oceanlabs.mcp"
}
}
maven {
name = "GTNH Maven"
url = "https://nexus.gtnewhorizons.com/repository/releases/"
}
maven {
url = "https://jitpack.io"
}
}
dependencies {
annotationProcessor "com.github.bsideup.jabel:jabel-javac-plugin:${jabel_version}"
compileOnly "com.github.bsideup.jabel:jabel-javac-plugin:${jabel_version}"
compileOnly "org.projectlombok:lombok:${lombok_version}"
annotationProcessor "org.projectlombok:lombok:${lombok_version}"
testCompileOnly "org.projectlombok:lombok:${lombok_version}"
testAnnotationProcessor "org.projectlombok:lombok:${lombok_version}"
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'
spotbugs 'com.github.spotbugs:spotbugs:4.8.3'
}
jar {
manifest {
attributes([
'Specification-Title' : project.archivesBaseName,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.version,
'Implementation-Title' : project.name,
'Implementation-Version' : project.version,
'Implementation-Vendor' : mod_author,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Timestamp' : System.currentTimeMillis(),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Built-On-Minecraft' : minecraft_version,
"MixinConfigs" : mixin_config,
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker"
])
}
}
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '.gitattributes', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
// fix formatting of type annotations
formatAnnotations()
trimTrailingWhitespace()
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
// make sure every file has the following copyright header.
// optionally, Spotless can set copyright years by digging
// through git history (see "license" section below)
//licenseHeader '/* (C)$YEAR */'
}
}
/**
* ===============================================================================
* = DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING =
* ===============================================================================
*/
unimined.minecraft(sourceSets.main, true) {
version minecraft_version
if (project.name !== "Common") {
combineWith(":Common:main")
}
mappings {
searge()
mcp("stable", "12-1.7.10")
//mcp("stable", "39-1.12")
//legacyIntermediary()
//mapping("net.legacyfabric:yarn:${project.minecraft_version}+build.mcp:v2")
//legacyYarn("533")
}
}
tasks.withType(JavaCompile).configureEach {
if (it.name in ["compileMcLauncherJava", "compilePatchedMcJava"]) {
return
}
it.options.encoding = "UTF-8"
it.sourceCompatibility = 17 // for the IDE support
it.options.release = 8
it.javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
}
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
clean {
delete "$rootDir/artifacts"
}
if (project.name !== 'Common') {
tasks.register('delDevJar') {
doLast {
def tree = fileTree('build/libs')
tree.include '**/*-dev-shadow.jar'
tree.include '**/*-dev.jar'
tree.include '**/*-all.jar'
tree.include '**/*-slim.jar'
tree.each { it.delete() }
}
}
build.finalizedBy delDevJar
tasks.register('copyAllArtifacts', Copy) {
from "$buildDir/libs"
into "$rootDir/artifacts"
include("*.jar")
}
build.finalizedBy(copyAllArtifacts)
}
configurations {
// Help Eclipse discover the compile classpath
compileClasspath.extendsFrom(minecraft)
compileClasspath.extendsFrom(minecraftLibraries)
compileClasspath.extendsFrom(modImplementation)
}
}