mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-11 19:14:11 +00:00
[VERY VERY VERY BAD IDEA]
This commit is contained in:
@@ -13,6 +13,17 @@ Configuration kernelDependencies = configurations.create('generationKernelDepend
|
||||
extendsFrom(configurations.implementation, configurations.slim, configurations.annotationProcessor)
|
||||
}
|
||||
dependencies.add(kernelDependencies.name, libs.guava)
|
||||
String nativeLibraryVersion = providers.gradleProperty('volmLibCoordinate').get().tokenize(':').last()
|
||||
List<String> nativeRevisionModules = ['native-common', 'native-minecraft26_2-sources']
|
||||
for (String adapter : rootProject.extensions.extraProperties.get('nativeDevelopmentAdapters')) {
|
||||
nativeRevisionModules.add('native-' + adapter)
|
||||
}
|
||||
for (String module : nativeRevisionModules) {
|
||||
dependencies.add(kernelDependencies.name, "com.github.VolmitSoftware.VolmLib:${module}:${nativeLibraryVersion}") {
|
||||
transitive = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GenerationBuildRevision.CaptureOptions revisionScope = GenerationRevisionScope.current(rootProject.projectDir.toPath())
|
||||
File catalogFile = file('generation-kernels/catalog.tsv')
|
||||
@@ -30,9 +41,11 @@ Closure<Map<String, Path>> resolvedKernelDependencies = {
|
||||
continue
|
||||
}
|
||||
boolean volmLib = (group == 'com.github.VolmitSoftware' && name == 'VolmLib')
|
||||
|| group == 'com.github.VolmitSoftware.VolmLib'
|
||||
|| (group == 'com.github.VolmitSoftware.VolmLib' && name in ['shared', 'volmlib-shared'])
|
||||
|| (group == 'art.arcane' && name == 'shared')
|
||||
String key = volmLib ? 'volmlib' : "${group}:${name}".toString()
|
||||
String artifactName = group == 'com.github.VolmitSoftware.VolmLib' && name ==~ /v[0-9_]+R[0-9]+/
|
||||
? 'native-' + name : name
|
||||
String key = volmLib ? 'volmlib' : "${group}:${artifactName}".toString()
|
||||
if (artifact.classifier != null) {
|
||||
key += ':' + artifact.classifier
|
||||
}
|
||||
@@ -50,7 +63,7 @@ Closure<Map<String, Path>> resolvedKernelDependencies = {
|
||||
TaskProvider<Task> revisionResources = tasks.register('generateGenerationBuildRevision') {
|
||||
group = 'build'
|
||||
description = 'Captures generation sources and resolved dependencies as build revision provenance.'
|
||||
dependsOn(kernelDependencies, kernelAgentJar, ":adapters:bukkit:nms:v26_2_R1:convert", ":adapters:bukkit:nms:v26_3_R1:convert")
|
||||
dependsOn(kernelDependencies, kernelAgentJar)
|
||||
inputs.files(revisionScope.roots().collect { String source -> rootProject.file(source) })
|
||||
inputs.property('revisionScope', revisionScope.toString())
|
||||
inputs.files(catalogFile, kernelDependencies, kernelAgentJar.flatMap { Jar jar -> jar.archiveFile })
|
||||
|
||||
@@ -32,7 +32,7 @@ TaskProvider<JavaExec> resolvedRevisionVerification = tasks.register('verifyReso
|
||||
continue
|
||||
}
|
||||
boolean volmLib = (group == 'com.github.VolmitSoftware' && name == 'VolmLib')
|
||||
|| group == 'com.github.VolmitSoftware.VolmLib'
|
||||
|| (group == 'com.github.VolmitSoftware.VolmLib' && name in ['shared', 'volmlib-shared'])
|
||||
|| (group == 'art.arcane' && name == 'shared')
|
||||
String key = volmLib ? 'volmlib' : "${group}:${name}".toString()
|
||||
if (artifact.classifier != null) {
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
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'
|
||||
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}/**")
|
||||
}
|
||||
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.matching { Task task -> task.name == 'createMinecraftArtifacts' }.configureEach {
|
||||
dependsOn(unpackNativeMinecraftSources)
|
||||
}
|
||||
@@ -94,6 +94,12 @@ if (irisUseLocalVolmLib && irisLocalVolmLibDirectory != null) {
|
||||
substitute(module('com.github.VolmitSoftware.VolmLib:shared')).using(project(':shared'))
|
||||
substitute(module('com.github.VolmitSoftware.VolmLib:packaging')).using(project(':packaging'))
|
||||
substitute(module('com.github.VolmitSoftware.VolmLib:volmlib-shared')).using(project(':shared'))
|
||||
substitute(module('com.github.VolmitSoftware.VolmLib:native-api')).using(project(':native-api'))
|
||||
substitute(module('com.github.VolmitSoftware.VolmLib:native-common')).using(project(':native-common'))
|
||||
substitute(module('com.github.VolmitSoftware.VolmLib:native-terrain-api')).using(project(':native-terrain-api'))
|
||||
substitute(module('com.github.VolmitSoftware.VolmLib:native-v26_2_R1')).using(project(':native:v26_2_R1'))
|
||||
substitute(module('com.github.VolmitSoftware.VolmLib:native-v26_3_R1')).using(project(':native:v26_3_R1'))
|
||||
substitute(module('com.github.VolmitSoftware.VolmLib:native-minecraft26_2-sources')).using(project(':native-minecraft26_2-sources'))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user