forked from HeatherComputer/AdvancedBackups
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
104 lines (88 loc) · 4.09 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
buildscript {
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
mavenCentral()
}
dependencies {
}
}
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
plugins {
id 'eclipse'
id 'maven-publish'
}
apply plugin: 'java'
if(file('customTasks.gradle').exists()){
apply from: 'customTasks.gradle' //customTasks.gradle won't exist in git
}
version = ''
group = 'co.uk.mommyheather.advancedbackups' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "advancedbackups-corelib"
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
mavenCentral()
}
configurations {
// configuration that holds jars to include in the jar
extraLibs
}
dependencies {
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
//extraLibs 'com.sun.jna.platform:5.13.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation files('dependencies/jansi-2.4.0.jar')
extraLibs files('dependencies/jansi-2.4.0.jar')
// Real mod deobf dependency examples - these get remapped to your current mappings
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
// Examples using mod jars from ./libs
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
// Example for how to get properties into the manifest for reading at runtime.
jar {
manifest {
attributes([
"Main-Class" : "co.uk.mommyheather.advancedbackups.cli.AdvancedBackupsCLI",
"Specification-Title" : "advancedbackups",
"Specification-Vendor" : "raveninthedark",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "raveninthedark",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
from {
configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
}
}
// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
// 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')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}