forked from Technici4n/AE2Things-Forge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
166 lines (135 loc) · 4.42 KB
/
build.gradle
File metadata and controls
166 lines (135 loc) · 4.42 KB
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
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.97'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'com.diffplug.spotless' version '6.4.1'
}
group = "dev.technici4n"
version = System.getenv("AE2THINGS_VERSION") ?: "0.0.0"
repositories {
maven {
name = "Modmaven"
url = uri("https://modmaven.dev/")
content {
includeGroup("appeng")
}
}
maven {
name = 'BlameJared Maven'
url = uri('https://maven.blamejared.com')
content {
includeGroup("mezz.jei")
}
}
maven {
name = "Local"
url = file("libs").toURI()
}
}
dependencies {
implementation "net.neoforged:neoforge:${neoforge_version}"
implementation "appeng:appliedenergistics2-neoforge:${ae2_version}"
compileOnly "mezz.jei:jei-${minecraft_version}-common-api:${jei_version}"
compileOnly "mezz.jei:jei-${minecraft_version}-neoforge-api:${jei_version}"
runtimeOnly "mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}"
}
sourceSets {
main {
resources {
srcDir("src/generated/resources")
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
runs {
// applies to all the run configs below
configureEach {
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
systemProperty 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
systemProperty 'forge.logging.console.level', 'debug'
modSource project.sourceSets.main
}
client {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'forge.enabledGameTestNamespaces', "ae2things"
}
server {
systemProperty 'forge.enabledGameTestNamespaces', "ae2things"
programArgument '--nogui'
}
data {
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
// workingDirectory project.file('run-data')
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
programArguments.addAll '--mod', "ae2things", '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
processResources {
inputs.property("version", project.version)
exclude(".cache")
filesMatching("META-INF/mods.toml") {
expand("version": project.version)
}
}
/////////////
// Spotless
spotless {
java {
target("src/main/java/**/*.java")
endWithNewline()
indentWithSpaces()
removeUnusedImports()
toggleOffOn()
eclipse().configFile("codeformat/codeformat.xml")
importOrderFile("codeformat/ae2.importorder")
}
format("json") {
target("src/*/resources/**/*.json")
targetExclude("src/generated/resources/**")
prettier().config(parser: "json")
}
}
////////////////
// CurseForge
System.getenv("CURSEFORGE")?.with { String key ->
curseforge {
apiKey = key
project {
id = "609977"
changelogType = "markdown"
changelog = "View changelog at [the release page](https://github.com/Technici4n/AE2Things-Forge/releases/tag/${version})"
if (version.contains("alpha")) {
releaseType = "alpha"
} else if (version.contains("beta")) {
releaseType = "beta"
} else {
releaseType = "release"
}
addGameVersion("${minecraft_version}")
addGameVersion("NeoForge")
mainArtifact(jar) {
displayName = "AE2 Things v${version}"
relations {
requiredDependency("applied-energistics-2")
}
}
}
}
}