-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
100 lines (82 loc) · 2.89 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
buildscript {
repositories {
maven {
url = 'https://repo.spongepowered.org/repository/maven-public/'
content { includeGroup "org.spongepowered" }
}
}
dependencies {
classpath group: 'org.spongepowered', name: 'mixingradle', version: "${mixingradle_version}"
}
}
plugins {
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
}
apply plugin: 'org.spongepowered.mixin'
apply from: '../minecraft_gradle_tools/src/mc1201/ECDependencies.gradle'
jarJar.enable()
version = "${minecraft_version}-${mod_version}"
group = "com.userofbricks.${modid}"
base {
archivesName = "${modid}"
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
runs(modid)
mixin {
add sourceSets.main, "${modid}.refmap.json"
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories{
repos()
}
dependencies {
mc_forge()
registrate()
cloth_config()
curiosAll()
jei_all()
if (better_combat_test == 'true') {
better_combat()
}
}
// This block of code expands all declared replace properties in the specified resource targets.
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
tasks.named('processResources', ProcessResources).configure {
var replaceProperties = [
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
forge_version: forge_version, forge_version_range: forge_version_range,
loader_version_range: loader_version_range,
modid: modid, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors: mod_authors, mod_description: mod_description,
curios_version: curios_version, cloth_config_api_version: cloth_config_api_version,
better_combat_version: better_combat_version,
]
inputs.properties replaceProperties
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
}
}
jars(name: modid, authors: mod_authors)
reobf {
jarJar { }
}
tasks.jarJar.finalizedBy('reobfJarJar')
// Example configuration to allow publishing using the maven-publish plugin
publishing {
publications {
register('mavenJava', MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
}
}