Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
99 lines (82 loc) · 3.22 KB
/
Copy pathbuild.gradle
File metadata and controls
99 lines (82 loc) · 3.22 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
buildscript {
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'java'
//apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle'
// Mojang ships Java 17 to end users in 1.18+ instead of Java 8 in 1.16 or lower, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
//sourceCompatibility = JavaVersion.VERSION_16
//targetCompatibility = JavaVersion.VERSION_16
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
mappings channel: "${project.mappings_channel}", version: "${project.mappings_version}"
//makeObfSourceJar = false
ext.mod_version = project.mod_version
if (mod_version.endsWith('-dev')) {
mod_version = mod_version + "." + new Date().format('yyyyMMdd.HHmmss')
}
}
dependencies {
minecraft 'net.minecraftforge:forge:' + project.minecraft_version + '-' + project.forge_version
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
options.encoding = 'UTF-8'
}
/*
sourceSets {
main {
ext.refMap = 'mixins.' + project.mod_id + '.refmap.json'
}
}
*/
group = project.group + "." + project.mod_id // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = project.mod_file_name + '-' + project.minecraft_version_out
version = project.minecraft.mod_version
/**
* This section allows you to customise your generated jar (litemod) file. By
* default it includes the generated litemod.json file, however if you prefer to
* include your own file from resources, simply remove the line below.
*/
jar {
manifest {
attributes([
"Specification-Title": "${project.mod_id}",
"Specification-Vendor": "${project.author}",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": "${project.mod_name}",
"Implementation-Version": project.jar.archiveVersion, //"${project.mod_version}",
"Implementation-Vendor": "${project.author}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
/*
mixin {
defaultObfuscationEnv notch
add sourceSets.main, 'mixins.' + project.mod_id + '.refmap.json'
}
*/
// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
// publish.dependsOn('reobfJar')
processResources
{
// Exclude the GIMP image files
exclude '**/*.xcf'
exclude '**/xcf'
// this will ensure that this task is redone when the versions change.
inputs.property "mod_version", project.minecraft.mod_version
inputs.property "minecraft_version", project.minecraft_version
}