forked from neoforged/NeoForge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
80 lines (70 loc) · 1.98 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
plugins {
id 'net.neoforged.gradleutils' version '3.0.0-alpha.1' apply false
id 'com.diffplug.spotless' version '6.22.0' apply false
id 'net.neoforged.licenser' version '0.7.2' apply false
}
apply plugin: 'net.neoforged.gradleutils'
gradleutils.version {
minecraftVersion project.minecraft_version
versionPrefix = null // Reset version prefix, which is set by prev. line
tags {
label = "beta"
cleanMarkerLabel = "stable"
}
branches {
suffixBranch = true
}
}
changelog {
from "20.2"
disableAutomaticPublicationRegistration()
}
allprojects {
version gradleutils.version.toString()
group 'net.neoforged'
repositories {
mavenLocal()
}
}
apply plugin: 'com.diffplug.spotless'
apply plugin: 'net.neoforged.licenser'
repositories {
mavenCentral()
}
// Put licenser here otherwise it tries to license all source sets including decompiled MC sources
license {
header = file('codeformat/HEADER.txt')
skipExistingHeaders = true
tasks {
neoforge {
// Add all NeoForge sources
files.from rootProject.fileTree("src", {
include "**/*.java"
})
}
}
}
// Put spotless here because it wants the files to live inside the project root
spotless {
java {
target rootProject.fileTree("src", {
include "**/*.java"
})
endWithNewline()
indentWithSpaces()
removeUnusedImports()
toggleOffOn()
eclipse().configFile file('codeformat/formatter-config.xml')
importOrder()
}
format 'patches', {
target rootProject.fileTree("patches")
custom 'noImportChanges', { String fileContents ->
if (fileContents.contains('+import') || fileContents.contains('-import')) {
throw new GradleException("Import changes are not allowed in patches!")
}
return fileContents
}
bumpThisNumberIfACustomStepChanges(1)
}
}