-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
155 lines (140 loc) · 5.32 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
plugins {
id "idea"
id "maven-publish"
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
}
def generatedResources = file("src/generated")
sourceSets {
main {
resources.srcDir generatedResources
}
}
repositories {
mavenLocal()
mavenCentral()
maven {
name = 'GTCEu Maven'
url = 'https://maven.gtceu.com'
content {
includeGroup 'com.gregtechceu.gtceu'
}
}
maven {
name 'FirstDarkDev'
url "https://maven.firstdarkdev.xyz/snapshots/"
}
maven {
// saps.dev Maven (KubeJS and Rhino)
url = "https://maven.saps.dev/minecraft"
content {
includeGroup "dev.latvian.mods"
}
}
maven { // Registrate
url = "https://maven.tterrag.com/"
content {
// need to be specific here due to version overlaps
includeGroup("com.tterrag.registrate")
}
}
maven {
// Patchouli, JEI
name = "BlameJared"
url = "https://maven.blamejared.com/"
}
maven {
url = "https://maven.theillusivec4.top/"
}
maven {
// Curse Forge File
url "https://cursemaven.com/"
content {
includeGroup "curse.maven"
}
}
maven {
// EMI
name = "TerraformersMC"
url = "https://maven.terraformersmc.com/"
}
maven {
url = "https://maven.architectury.dev"
}
maven {
url = "https://thedarkcolour.github.io/KotlinForForge/"
}
}
version = mod_version
group = maven_group
base { archivesName = archives_base_name }
java { sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 }
sourceSets.main.resources { srcDir 'src/generated/resources' }
minecraft {
mappings channel: mapping_channel, version: mapping_version
copyIdeResources = true
runs {
configureEach {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods { "${mod_id}" { source sourceSets.main } }
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
}
client { property 'forge.enabledGameTestNamespaces', mod_id }
server { property 'forge.enabledGameTestNamespaces', mod_id; args '--nogui' }
data {
// example of overriding the workingDirectory set in configureEach above
workingDirectory project.file('run-data')
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
}
}
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
// JEI, EMI, Jade
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
runtimeOnly fg.deobf("dev.emi:emi-forge:${emi_version}+${minecraft_version}")
runtimeOnly fg.deobf("curse.maven:jade-324717:5390389")
// GregTech and dependencies
implementation fg.deobf("com.gregtechceu.gtceu:gtceu-${minecraft_version}:${gtceu_version}:slim") { transitive = false }
implementation fg.deobf("com.lowdragmc.ldlib:ldlib-forge-${minecraft_version}:${ldlib_version}") { transitive = false }
implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")
implementation fg.deobf("dev.latvian.mods:kubejs-forge:${kubejs_version}")
implementation fg.deobf("dev.latvian.mods:rhino-forge:${rhino_version}")
runtimeOnly fg.deobf("dev.toma.configuration:configuration-forge-${minecraft_version}:${configuration_version}")
runtimeOnly fg.deobf("dev.architectury:architectury-forge:${architectury_version}")
// lombok
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
}
tasks.named('processResources', ProcessResources).configure {
var properties = [
"mod_license": mod_license,
"mod_id": mod_id,
"version": version,
"mod_name": mod_name,
"mod_url": mod_url,
"mod_author": mod_author,
"forge_version": forge_version.split("\\.")[0], // only specify major version of forge
"minecraft_version": minecraft_version,
"gtceu_version": gtceu_version,
]
inputs.properties(properties)
filesMatching("META-INF/mods.toml") {
expand properties + [project: project]
}
}
tasks.named('jar', Jar).configure { finalizedBy 'reobfJar' }
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
options.encoding = "UTF-8"
options.release.set(17)
}