mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-11 19:14:11 +00:00
- Language asset test locates the directory through the English file - Structure template test reads the mixin class bytes instead of loading it - Water spawn test initializes block state caches before running - Logging policy check runs after the native sources are unpacked - Native class boundary check runs after classes compile
51 lines
2.4 KiB
Groovy
51 lines
2.4 KiB
Groovy
Configuration nativeMinecraftSources = configurations.create('nativeMinecraftSources') {
|
|
canBeConsumed = false
|
|
canBeResolved = true
|
|
}
|
|
|
|
Properties nativeLibraryProperties = new Properties()
|
|
file('../../gradle.properties').withInputStream { InputStream stream -> nativeLibraryProperties.load(stream) }
|
|
String nativeLibraryCoordinate = providers.gradleProperty('volmLibCoordinate')
|
|
.getOrElse(nativeLibraryProperties.getProperty('volmLibCoordinate'))
|
|
String nativeSourceLoader = extensions.extraProperties.get('nativeSourceLoader')
|
|
String nativeSourceImplementation = 'minecraft26_2'
|
|
String nativeSourceMinecraftVersion = providers.gradleProperty('minecraftVersion').getOrElse('26.2')
|
|
extensions.extraProperties.set('nativeSourceImplementation', nativeSourceImplementation)
|
|
dependencies.add(nativeMinecraftSources.name,
|
|
"com.github.VolmitSoftware.VolmLib:native-${nativeSourceImplementation}-sources:${nativeLibraryCoordinate.tokenize(':').last()}")
|
|
|
|
TaskProvider<Sync> unpackNativeMinecraftSources = tasks.register('unpackNativeMinecraftSources', Sync) {
|
|
dependsOn(nativeMinecraftSources)
|
|
from(provider { nativeMinecraftSources.collect { File artifact -> zipTree(artifact) } }) {
|
|
include('art/**', 'modded/**', "${nativeSourceLoader}/**",
|
|
'resources/modded/**', "resources/${nativeSourceLoader}/**", "versions/${nativeSourceMinecraftVersion}/**")
|
|
eachFile { FileCopyDetails source ->
|
|
String versionPrefix = "versions/${nativeSourceMinecraftVersion}/"
|
|
if (source.path.startsWith(versionPrefix)) {
|
|
source.path = source.path.substring(versionPrefix.length())
|
|
}
|
|
}
|
|
}
|
|
into(layout.buildDirectory.dir('generated/sources/native-minecraft'))
|
|
}
|
|
|
|
sourceSets.main.java.srcDir(unpackNativeMinecraftSources)
|
|
|
|
sourceSets.main.resources.srcDir(layout.buildDirectory.dir('generated/sources/native-minecraft/resources/modded'))
|
|
sourceSets.main.resources.srcDir(layout.buildDirectory.dir("generated/sources/native-minecraft/resources/${nativeSourceLoader}"))
|
|
tasks.named('processResources').configure {
|
|
dependsOn(unpackNativeMinecraftSources)
|
|
}
|
|
|
|
tasks.named('verifyLoggingPolicy').configure {
|
|
dependsOn(unpackNativeMinecraftSources)
|
|
}
|
|
|
|
tasks.named('verifyNativeClassBoundary').configure {
|
|
dependsOn(tasks.named('classes'))
|
|
}
|
|
|
|
tasks.matching { Task task -> task.name == 'createMinecraftArtifacts' }.configureEach {
|
|
dependsOn(unpackNativeMinecraftSources)
|
|
}
|