diff options
author | dev@ftbsc <dev@fantabos.co> | 2023-02-01 21:53:08 +0100 |
---|---|---|
committer | dev@ftbsc <dev@fantabos.co> | 2023-02-01 21:53:08 +0100 |
commit | 7ef6f46d8ace2881c01f6ada0839d6dc525b1d4e (patch) | |
tree | e5e6776ba8b19bad61f4b3bc300c4e5f8ec5b276 /build.gradle | |
parent | 7ebbb991d2c873dfd8a06d871b6d2fed4fb19ca9 (diff) |
chore: slimmer build.gradle
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/build.gradle b/build.gradle index 3618f26..5eed085 100644 --- a/build.gradle +++ b/build.gradle @@ -8,17 +8,18 @@ buildscript { classpath "com.palantir.gradle.gitversion:gradle-git-version:0.13.0" } } + apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' apply plugin: "com.palantir.git-version" -version gitVersion() -group = 'co.fantabos.bscv' +version = gitVersion() +group = 'co.fantabos.bscv' archivesBaseName = 'boscovicino' +minecraftVersion = '1.16.5' project.ext { - minecraftVersion = getProjectProperty("bscv.mc.version", "1.16.5") forgeVersion = getProjectProperty("bscv.forge.version", "1.16.5-36.2.39") copyJarDo = getProjectProperty("copyjar.do", "false") copyJarUseVersionSubDir = getProjectProperty("copyjar.useVersionSubDir", "false") @@ -44,7 +45,7 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { - mappings channel: 'official', version: "${project.ext.minecraftVersion}" + mappings channel: 'official', version: minecraftVersion runs { client { workingDirectory project.file('run') @@ -113,38 +114,15 @@ tasks.register('copyJar', Copy) { if(!project.ext.copyJarDo.toBoolean()) return def modDir = "${project.ext.copyJarTargetGameDir}/mods/" - //check if the per-version subdirectory is disabled - if(project.ext.copyJarUseVersionSubDir.toBoolean()) - modDir = modDir + project.ext.minecraftVersion - // find previous jar (if it exists) final previousJars = project.fileTree(dir: modDir).matching { include project.archivesBaseName + '*' }.files - //change filename - if (previousJars) { - if(copyJarKeepBackups.toBoolean()) { - //create .backups folder - final backupDir = modDir + '/.backups/' - project.file(backupDir).mkdirs() - - for (File previousJar : previousJars) { - final n = modDir + '/.backups/' + previousJar.getName() + '.bk' - def f = project.file(n) - def i = 1 - while (f.exists()) { - f = project.file(n + '_' + i) - i++ - } - previousJar.renameTo(f) - } - } else - previousJars - .stream() - .filter(f -> f.toString().toLowerCase().endsWith("jar")) //dont kill old backups but smite existing jars - .forEach(f -> f.delete()) - } + previousJars + .stream() + .filter(f -> f.toString().toLowerCase().endsWith("jar")) //dont kill old backups but smite existing jars + .forEach(f -> f.delete()) //copy jar from build/libs to the forge mod folder //from shadowJar //we want the über version, not the small one @@ -168,4 +146,4 @@ publishing { build { //dependsOn shadowJar, reobfShadowJar finalizedBy copyJar -}
\ No newline at end of file +} |