Skip to content

Commit

Permalink
Update buildscript
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenraven committed Jan 29, 2023
1 parent 44f0ce4 commit 63e7eb2
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1674943145
//version: 1674988119
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -66,7 +66,7 @@ plugins {
id 'com.diffplug.spotless' version '6.7.2' apply false
id 'com.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.0.16'
id 'com.gtnewhorizons.retrofuturagradle' version '1.0.18'
}
boolean settingsupdated = verifySettingsGradle()
settingsupdated = verifyGitAttributes() || settingsupdated
Expand Down Expand Up @@ -212,6 +212,25 @@ if (accessTransformersFile) {
}
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile)
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile)
} else {
boolean atsFound = false
for (File at : sourceSets.getByName("main").resources.files) {
if (at.name.toLowerCase().endsWith("_at.cfg")) {
atsFound = true
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at)
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at)
}
}
for (File at : sourceSets.getByName("api").resources.files) {
if (at.name.toLowerCase().endsWith("_at.cfg")) {
atsFound = true
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at)
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at)
}
}
if (atsFound) {
logger.warn("Found and added access transformers in the resources folder, please configure gradle.properties to explicitly mention them by name")
}
}

if (usesMixins.toBoolean()) {
Expand Down Expand Up @@ -356,6 +375,16 @@ configurations.configureEach {
}
}

// Ensure tests have access to minecraft classes
sourceSets {
test {
java {
compileClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output
runtimeClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output
}
}
}

if (file('addon.gradle').exists()) {
apply from: 'addon.gradle'
}
Expand Down

0 comments on commit 63e7eb2

Please sign in to comment.