mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-12 03:24:14 +00:00
- Fabric, Forge, and NeoForge build against Minecraft 26.3 with Fabric Loader 0.19.5, Forge 26.3-66.0.8, and NeoForge 26.3.0.33-beta - Fabric API modules follow fabric-api 0.161.0+26.3, ForgeGradle is 7.0.40, and ModDevGradle is 2.0.147 - Loader metadata requires Fabric Loader 0.19.5, Forge 66, NeoForge 26.3, and Minecraft 26.3 - The mod resource pack declares formats 97.1 through 121.0 - The v26_3_R1 headless sources no longer unpack a version overlay - The README lists the 26.3 loader targets
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.3')
|
|
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)
|
|
}
|