-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
129 lines (108 loc) · 3.42 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
plugins {
id 'eclipse'
id 'idea'
id 'java-library'
id 'maven-publish'
id 'net.neoforged.moddev' version '2.0.36-beta'
}
group = 'com.lovetropics.extras'
base {
archivesName = 'LTExtras'
}
ext.buildnumber = 0
project.buildnumber = System.getenv('BUILD_NUMBER') ?: 'custom'
if (System.getenv('GHA_RELEASE_WORKFLOW')) {
version = "${mod_version}"
} else if (System.getenv('GITHUB_RUN_NUMBER')) {
project.buildnumber = System.getenv('GITHUB_RUN_NUMBER')
version = "${mod_version}-${release_type}+${buildnumber}-gha"
} else {
project.buildnumber = System.getenv('BUILD_NUMBER') ?: 'custom'
version = "${mod_version}-${release_type}+${buildnumber}"
}
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
neoForge {
version = project.neo_version
parchment {
minecraftVersion = minecraft_version
mappingsVersion = parchment_version
}
runs {
client {
client()
programArguments.addAll '--username', 'Dev' + new Random().nextInt(999)
}
server {
server()
programArgument '--nogui'
}
data {
data()
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath(), '--existing-mod', 'tropicraft'
}
configureEach {
logLevel = org.slf4j.event.Level.INFO
ideName = project.name + " - " + ideName.get()
}
}
mods {
"${project.mod_id}" {
sourceSet sourceSets.main
sourceSet sourceSets.test
}
}
}
sourceSets.main.resources {
srcDir 'src/generated/resources'
}
repositories {
maven { url = "https://maven.ithundxr.dev/snapshots/" }
maven { url = "https://maven.tterrag.com/" }
maven { url = "https://api.modrinth.com/maven" }
mavenLocal()
}
dependencies {
// TODO: HACK - We get Registrate at runtime through JarJar from Tropicraft. We should rather prefer to depend on the slim jar.
jarJar(compileOnly("com.tterrag.registrate:Registrate:MC1.21-${registrate_version}")) {
version {
strictly "[MC1.21-${registrate_version},MC1.22)"
prefer "MC1.21-${registrate_version}"
}
}
jarJar(implementation("com.lovetropics.lib:LTLib:$ltlib_version"))
jarJar(implementation("eu.pb4:placeholder-api-lt:$placeholder_api_version"))
runtimeOnly 'maven.modrinth:tropicraft:9.7.3-1.21'
// runtimeOnly fg.deobf('com.jozufozu.flywheel:Flywheel-Forge:1.18-0.7.0.70')
// runtimeOnly fg.deobf('com.simibubi.create:Create:mc1.18.2_v0.4.1+113')
}
var generateModMetadata = tasks.register('generateModMetadata', ProcessResources) {
var replaceProperties = [
mod_version: mod_version,
]
inputs.properties replaceProperties
expand replaceProperties
from 'src/main/templates'
into 'build/generated/sources/modMetadata'
}
sourceSets.main.resources.srcDir generateModMetadata
neoForge.ideSyncTask generateModMetadata
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
publishing {
publications {
register('mavenJava', MavenPublication) {
from components.java
}
}
repositories {
if (project.hasProperty('mavendir')) {
maven { url mavendir }
} else {
mavenLocal()
}
}
}