mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-12 03:24:14 +00:00
- The build resolves VolmLib master-SNAPSHOT when no sibling checkout is substituted - The native runtime manifest, roots and keep rules come from the embedded natives - The packed jar natives are verified against the embedded provider shas - Every jar carries META-INF/volmit/volmlib.properties - The build logs the resolved VolmLib once - publishedNativeRuntime, the loader coordinate flags, mavenLocal and publish-volmlib are gone
47 lines
2.1 KiB
Groovy
47 lines
2.1 KiB
Groovy
Configuration nativeMinecraftSources = configurations.create('nativeMinecraftSources') {
|
|
canBeConsumed = false
|
|
canBeResolved = true
|
|
}
|
|
|
|
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:master-SNAPSHOT")
|
|
|
|
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)
|
|
}
|