-
Notifications
You must be signed in to change notification settings - Fork 76
/
build.gradle
89 lines (72 loc) · 2.48 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
plugins {
id "net.neoforged.gradle.userdev" version "7.+"
id "net.neoforged.gradle.mixin" version "7.+"
id "com.matthewprenger.cursegradle" version "1.4.0"
}
base.archivesName.set("${mod_name}-neoforge")
minecraft {
mappings {
channel = official()
version.put "minecraft", minecraft_version
}
accessTransformers.file('src/main/resources/META-INF/accesstransformer.cfg')
}
runs {
configureEach {
modSource project.sourceSets.main
}
client {
workingDirectory.set(project.file('run'))
systemProperty 'neoforge.enabledGameTestNamespaces', mod_id
}
server {
workingDirectory.set(project.file('run'))
systemProperty 'neoforge.enabledGameTestNamespaces', mod_id
programArgument '--nogui'
}
clientData {
programArguments.addAll '--mod', project.mod_id, '--all', '--output', project(':Common').file('src/generated/resources/').getAbsolutePath(), '--existing', project(':Common').file('src/main/resources/').getAbsolutePath()
}
}
dependencies {
implementation "net.neoforged:neoforge:${neoforge_version}"
compileOnly project(":Common")
implementation 'com.github.glitchfiend:GlitchCore-neoforge:' + minecraft_version + '-' + glitchcore_version
}
// NeoGradle compiles the game, but we don't want to add our common code to the game's code
TaskCollection.metaClass.excludingNeoTasks = { ->
delegate.matching { !it.name.startsWith("neo") }
}
tasks.withType(JavaCompile).excludingNeoTasks().configureEach {
source(project(":Common").sourceSets.main.allSource)
}
tasks.withType(Javadoc).excludingNeoTasks().configureEach {
source(project(":Common").sourceSets.main.allJava)
}
tasks.named("sourcesJar", Jar) {
from(project(":Common").sourceSets.main.allSource)
}
tasks.withType(ProcessResources).excludingNeoTasks().configureEach {
from project(":Common").sourceSets.main.resources
filesMatching("${mod_id}.mixins.json") {
expand "refmap_target": "${mod_id}."
}
}
curseforge {
apiKey = project.findProperty('curseApiKey') ?: 'unset'
project {
id = mod_curseforge_id
if (changelog_file.exists()) {
changelog = changelog_file
}
releaseType = release_channel
addGameVersion minecraft_version
addGameVersion name
mainArtifact(jar) {
displayName = "${mod_display_name} ${name} ${version}"
}
relations {
requiredDependency 'glitchcore'
}
}
}