BaseBandRewrite/Client/build.gradle

166 lines
4.2 KiB
Groovy

buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
mavenCentral()
}
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'
}
}
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')
jvmArgs = ["-Dfml.coreMods.load=com.baseband.client.DevStub"]
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
}
}
}
repositories {
maven {
name = 'spongepowered-repo'
url = 'https://repo.spongepowered.org/maven'
}
maven {
name = "jitpack.io"
url = "https://jitpack.io"
}
mavenCentral()
}
configurations {
jarLibs
}
dependencies {
minecraft('net.minecraftforge:forge:1.12.2-14.23.5.2860')
jarLibs('com.github.fzakaria:ascii85:1.2')
jarLibs('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
exclude module: 'launchwrapper'
exclude module: 'guava'
exclude module: 'gson'
exclude module: 'commons-io'
exclude module: 'log4j-core'
}
jarLibs(files('libs/TuddyLIB.jar'))
// should NOT go into the jar.
//implementation(files('libs/mcregistry-1.0.jar'))
annotationProcessor('org.spongepowered:mixin:0.8.5:processor') {
exclude module: 'gson'
}
implementation configurations.jarLibs
}
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
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"
}
manifest.attributes (
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': '0',
'FMLCorePluginContainsFMLMod': 'true',
'FMLCorePlugin': 'com.baseband.client.DevStub',
'ForceLoadAsMod': 'true'
)
baseName = ''
version = ''
classifier = 'BaseBand-Oslo'
}
def proguardBuildDir = "${buildDir}/proguard"
def proguardDir = "proguard"
task proguard(type: proguard.gradle.ProGuardTask, dependsOn: jar) {
configuration "${proguardDir}/proguard.cfg"
injars jar.archiveFile
outjars "${proguardBuildDir}/classes.jar"
libraryjars "${proguardDir}/rt.jar"
libraryjars configurations.jarLibs
dump "${proguardBuildDir}/dump.txt"
printmapping "${proguardBuildDir}/mapping.txt"
printconfiguration "${proguardBuildDir}/configuration.txt"
}
task releaseJar(type: Jar, dependsOn: jar) {
from(zipTree(jar.archivePath)) {
exclude 'com/baseband/client/DevStub.class'
exclude 'com/baseband/client/DevStub.java'
exclude 'org/'
}
manifest.attributes (
'ReleaseJar': 'true'
)
baseName = ''
version = ''
classifier = 'BaseBand-Broadway'
}
build.dependsOn(releaseJar)