BaseBandRewrite/Client/build.gradle

211 lines
6.4 KiB
Groovy
Raw Permalink Normal View History

2024-06-08 22:45:07 +02:00
2024-10-04 21:01:23 +02:00
String devName = "main"
String releaseName = "release"
2024-06-08 22:45:07 +02:00
import proguard.gradle.ProGuardTask
2023-08-26 16:19:12 +02:00
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
mavenCentral()
}
2023-08-26 16:19:12 +02:00
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.1', changing: true
classpath "org.spongepowered:mixingradle:0.7.+"
classpath 'com.guardsquare:proguard-gradle:7.1.0'
2023-08-26 16:19:12 +02:00
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'java'
group = project.modGroup
version = project.modVersion
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
tasks.withType(JavaCompile) {
configure(options) {
options.compilerArgs.add("-XDignore.symbol.file=true")
options.encoding = 'utf-8'
}
}
minecraft {
mappings channel: 'stable', version: '39-1.12'
accessTransformer = file('src/main/resources/client_at.cfg')
runs {
client {
workingDirectory project.file('run')
2024-06-12 11:05:23 +02:00
jvmArgs = ["-Dfml.coreMods.load=de.com.baseband.client.DevStub", "-Xmx700M"]
2024-05-24 16:34:07 +02:00
args = ["--userType", "mojang", "--username", "qukn", "--accessToken", "eyJraWQiOiJhYzg0YSIsImFsZyI6IkhTMjU2In0.eyJ4dWlkIjoiMjUzNTQyNTU0MzA3NTkyNSIsImFnZyI6IkFkdWx0Iiwic3ViIjoiNGU0YmNlN2UtZDBkZi00MjM3LWFhNTUtMjZmZTVhNjY3ZmQ4IiwiYXV0aCI6IlhCT1giLCJucyI6ImRlZmF1bHQiLCJyb2xlcyI6W10sImlzcyI6ImF1dGhlbnRpY2F0aW9uIiwiZmxhZ3MiOlsidHdvZmFjdG9yYXV0aCIsIm1zYW1pZ3JhdGlvbl9zdGFnZTQiLCJvcmRlcnNfMjAyMiIsIm11bHRpcGxheWVyIl0sInByb2ZpbGVzIjp7Im1jIjoiODZhMzJmY2UtYTk0Ni00MzY2LWI0YTAtMDk3YTI5MDcyZTU0In0sInBsYXRmb3JtIjoiUENfTEFVTkNIRVIiLCJuYmYiOjE3MTY1NTc3MzQsImV4cCI6MTcxNjY0NDEzNCwiaWF0IjoxNzE2NTU3NzM0fQ.Bt1AahWJrQqv8iJe8JH4T2IczdKzDjPnN-z7YLpcpFw", "--uuid", "86a32fcea9464366b4a0097a29072e54"]
2023-08-26 16:19:12 +02:00
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
}
}
}
2023-09-12 04:29:54 +02:00
2023-08-26 16:19:12 +02:00
repositories {
maven {
name = 'spongepowered-repo'
url = 'https://repo.spongepowered.org/maven'
}
maven {
name = "jitpack.io"
url = "https://jitpack.io"
}
mavenCentral()
2024-06-25 04:27:30 +02:00
maven { url = 'https://git.tudbut.de/api/packages/TudbuT/maven' }
maven { url = 'https://git.tudbut.de/api/packages/BaseBand/maven' }
2023-08-26 16:19:12 +02:00
}
2023-09-12 04:29:54 +02:00
configurations {
jarLibs
reloadQuickly {
2024-06-25 08:24:30 +02:00
resolutionStrategy.cacheDynamicVersionsFor(30, 'seconds')
resolutionStrategy.cacheChangingModulesFor(30, 'seconds')
2024-06-25 05:35:36 +02:00
}
2023-09-12 04:29:54 +02:00
}
2023-08-26 16:19:12 +02:00
dependencies {
minecraft('net.minecraftforge:forge:1.12.2-14.23.5.2860')
2023-08-26 16:19:12 +02:00
jarLibs('com.github.LabyStudio:java-spotify-api:+:all')
2024-05-23 00:15:04 +02:00
2024-03-27 02:48:15 +01:00
jarLibs('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
2023-08-26 16:19:12 +02:00
exclude module: 'launchwrapper'
exclude module: 'guava'
exclude module: 'gson'
exclude module: 'commons-io'
exclude module: 'log4j-core'
}
reloadQuickly jarLibs('de.tudbut:tuddylib:+')
// should NOT go into the jar.
2024-05-26 19:13:06 +02:00
implementation('com.github.cabaletta:baritone:1.2.14')
2023-09-12 04:29:54 +02:00
2023-08-26 16:19:12 +02:00
annotationProcessor('org.spongepowered:mixin:0.8.5:processor') {
exclude module: 'gson'
}
2023-09-12 04:29:54 +02:00
implementation configurations.jarLibs
2023-08-26 16:19:12 +02:00
}
processResources {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
inputs.property 'version', project.version
inputs.property 'mcversion', '1.12.2'
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': '1.12.2'
}
from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' }
rename '(.+_at.cfg)', 'META-INF/$1'
}
mixin {
defaultObfuscationEnv 'searge'
add sourceSets.main, 'mixins.baseband.refmap.json'
}
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
2023-09-12 04:29:54 +02:00
from {
configurations.jarLibs.collect {
it.isDirectory() ? it : zipTree(it)
}
} {
exclude "LICENSE.txt", "META-INF/MANIFSET.MF", "META-INF/maven/**", "META-INF/*.RSA", "META-INF/*.SF"
2023-09-12 04:29:54 +02:00
}
2024-03-22 01:53:11 +01:00
2024-03-27 02:48:15 +01:00
manifest.attributes (
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': '0',
'FMLCorePluginContainsFMLMod': 'true',
2024-06-12 11:05:23 +02:00
'FMLCorePlugin': 'de.com.baseband.client.DevStub',
2024-03-27 02:48:15 +01:00
'ForceLoadAsMod': 'true'
)
2024-06-10 12:31:12 +02:00
archiveFileName = "BaseBand-${devName}.jar"
2024-03-22 01:53:11 +01:00
}
2024-06-08 22:45:07 +02:00
tasks.register('releaseJar', Jar) {
2024-06-10 12:24:34 +02:00
dependsOn "jar"
dependsOn "reobfJar"
2024-03-22 01:53:11 +01:00
2024-06-10 12:24:34 +02:00
from(zipTree(jar.archiveFile)) {
2024-06-12 11:05:23 +02:00
exclude 'de/com/baseband/client/DevStub.class'
exclude 'de/com/baseband/client/DevStub.java'
2024-06-10 00:25:33 +02:00
exclude 'org/spongepowered/**'
exclude 'META-INF/**'
exclude 'mcmod.info'
2024-03-22 01:53:11 +01:00
}
2024-03-27 02:48:15 +01:00
2024-06-08 22:45:07 +02:00
manifest.attributes(
2024-03-27 02:48:15 +01:00
'ReleaseJar': 'true'
)
2024-06-10 12:31:12 +02:00
archiveFileName = "BaseBand-${releaseName}.jar"
2024-03-22 01:53:11 +01:00
}
build.dependsOn(releaseJar)
2024-06-08 22:45:07 +02:00
def proguardBuildDir = "${buildDir}/proguard"
def proguardDir = "proguard"
tasks.register('proguard', ProGuardTask) {
dependsOn jar
2024-06-12 16:32:46 +02:00
dependsOn "reobfJar"
2024-06-08 22:45:07 +02:00
configuration "${proguardDir}/proguard.cfg"
injars jar.archiveFile
outjars "${proguardBuildDir}/BaseBand-${devName}.jar"
libraryjars "${proguardDir}/rt.jar"
libraryjars configurations.compileClasspath.resolve().collect() {
if(it.getName().contains("mapped_stable")) {
return new File("build/fg_cache/net/minecraftforge/forge/1.12.2-14.23.5.2860/forge-1.12.2-14.23.5.2860-mci.jar")
} else return it;
}
2024-06-08 22:45:07 +02:00
dump "${proguardBuildDir}/dump-${devName}.txt"
printmapping "${proguardBuildDir}/mapping-${devName}.txt"
printconfiguration "${proguardBuildDir}/configuration.txt"
}
tasks.register('proguardRelease', ProGuardTask) {
dependsOn tasks.releaseJar
configuration "${proguardDir}/proguard.cfg"
injars tasks.releaseJar.archiveFile
outjars "${proguardBuildDir}/BaseBand-${releaseName}.jar"
libraryjars "${proguardDir}/rt.jar"
libraryjars configurations.compileClasspath.resolve().collect() {
if(it.getName().contains("mapped_stable")) {
return new File("build/fg_cache/net/minecraftforge/forge/1.12.2-14.23.5.2860/forge-1.12.2-14.23.5.2860-mci.jar")
} else return it;
}
2024-06-08 22:45:07 +02:00
dump "${proguardBuildDir}/dump-${releaseName}.txt"
printmapping "${proguardBuildDir}/mapping-${releaseName}.txt"
printconfiguration "${proguardBuildDir}/configuration.txt"
}