mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-26 14:00:26 +00:00
Drop execution-time project access
- Delete stale jars through an injected FileSystemOperations in the root build - Delete stale loader jars through an injected FileSystemOperations in each adapter - Resolve stale-jar file trees and copy sources at configuration time - Expand the loader metadata templates from the configured version string
This commit is contained in:
1 parent
5c84c6b8d8
commit
89dc5d0447
4 files changed
+157
-104
No files matched your search
@@ -17,9 +17,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
|
import org.gradle.api.file.DeleteSpec
|
||||||
|
import org.gradle.api.file.FileSystemOperations
|
||||||
|
import org.gradle.api.file.FileTree
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
||||||
|
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -38,6 +43,13 @@ plugins {
|
|||||||
|
|
||||||
apply plugin: 'art.arcane.volmit-packaging'
|
apply plugin: 'art.arcane.volmit-packaging'
|
||||||
|
|
||||||
|
interface IrisFileOperations {
|
||||||
|
@Inject
|
||||||
|
FileSystemOperations getFileSystemOperations()
|
||||||
|
}
|
||||||
|
|
||||||
|
IrisFileOperations irisFileOperations = objects.newInstance(IrisFileOperations)
|
||||||
|
|
||||||
apply from: file('../../gradle/modded-generation-build-revision.gradle')
|
apply from: file('../../gradle/modded-generation-build-revision.gradle')
|
||||||
|
|
||||||
Properties rootProperties = new Properties()
|
Properties rootProperties = new Properties()
|
||||||
@@ -230,10 +242,10 @@ loom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
inputs.property('version', project.version)
|
inputs.property('version', irisVersion)
|
||||||
inputs.property('minecraftVersion', minecraftVersion)
|
inputs.property('minecraftVersion', minecraftVersion)
|
||||||
filesMatching('fabric.mod.json') {
|
filesMatching('fabric.mod.json') {
|
||||||
expand('version': project.version, 'minecraftVersion': minecraftVersion)
|
expand('version': irisVersion, 'minecraftVersion': minecraftVersion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,13 +266,17 @@ Map<String, String> nestedFabricApiJars = [
|
|||||||
'fabric-permission-api-v1' : 'fabric-permission-api-v1.jar'
|
'fabric-permission-api-v1' : 'fabric-permission-api-v1.jar'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
FileTree staleLoaderJars = fileTree(layout.buildDirectory.dir('libs')) {
|
||||||
|
include('Iris v* [Fabric] *.jar')
|
||||||
|
include('iris-fabric-*.jar')
|
||||||
|
}
|
||||||
|
File legacyLoaderJar = layout.buildDirectory.file("libs/Iris-${project.version}+mc${minecraftVersion}-fabric.jar").get().asFile
|
||||||
|
|
||||||
tasks.named('shadowJar', ShadowJar).configure {
|
tasks.named('shadowJar', ShadowJar).configure {
|
||||||
doFirst {
|
doFirst {
|
||||||
delete(fileTree(layout.buildDirectory.dir('libs')) {
|
irisFileOperations.fileSystemOperations.delete { DeleteSpec spec ->
|
||||||
include('Iris v* [Fabric] *.jar')
|
spec.delete(staleLoaderJars, legacyLoaderJar)
|
||||||
include('iris-fabric-*.jar')
|
}
|
||||||
})
|
|
||||||
delete(layout.buildDirectory.file("libs/Iris-${project.version}+mc${minecraftVersion}-fabric.jar"))
|
|
||||||
}
|
}
|
||||||
archiveFileName.set(irisArtifactName('Fabric', "${minecraftVersion}+${fabricLoaderVersion}"))
|
archiveFileName.set(irisArtifactName('Fabric', "${minecraftVersion}+${fabricLoaderVersion}"))
|
||||||
configurations = [project.configurations.named('bundle').get()]
|
configurations = [project.configurations.named('bundle').get()]
|
||||||
|
|||||||
@@ -17,9 +17,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
|
import org.gradle.api.file.DeleteSpec
|
||||||
|
import org.gradle.api.file.FileSystemOperations
|
||||||
|
import org.gradle.api.file.FileTree
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
||||||
|
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -38,6 +43,13 @@ plugins {
|
|||||||
|
|
||||||
apply plugin: 'art.arcane.volmit-packaging'
|
apply plugin: 'art.arcane.volmit-packaging'
|
||||||
|
|
||||||
|
interface IrisFileOperations {
|
||||||
|
@Inject
|
||||||
|
FileSystemOperations getFileSystemOperations()
|
||||||
|
}
|
||||||
|
|
||||||
|
IrisFileOperations irisFileOperations = objects.newInstance(IrisFileOperations)
|
||||||
|
|
||||||
apply from: file('../../gradle/modded-generation-build-revision.gradle')
|
apply from: file('../../gradle/modded-generation-build-revision.gradle')
|
||||||
|
|
||||||
Properties rootProperties = new Properties()
|
Properties rootProperties = new Properties()
|
||||||
@@ -232,20 +244,24 @@ tasks.named('test').configure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
inputs.property('version', project.version)
|
inputs.property('version', irisVersion)
|
||||||
inputs.property('minecraftVersion', minecraftVersion)
|
inputs.property('minecraftVersion', minecraftVersion)
|
||||||
filesMatching('META-INF/mods.toml') {
|
filesMatching('META-INF/mods.toml') {
|
||||||
expand('version': project.version, 'minecraftVersion': minecraftVersion)
|
expand('version': irisVersion, 'minecraftVersion': minecraftVersion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileTree staleLoaderJars = fileTree(layout.buildDirectory.dir('libs')) {
|
||||||
|
include('Iris v* [Forge] *.jar')
|
||||||
|
include('iris-forge-*.jar')
|
||||||
|
}
|
||||||
|
File legacyLoaderJar = layout.buildDirectory.file("libs/Iris-${project.version}+mc${minecraftVersion}-forge.jar").get().asFile
|
||||||
|
|
||||||
tasks.named('shadowJar', ShadowJar).configure {
|
tasks.named('shadowJar', ShadowJar).configure {
|
||||||
doFirst {
|
doFirst {
|
||||||
delete(fileTree(layout.buildDirectory.dir('libs')) {
|
irisFileOperations.fileSystemOperations.delete { DeleteSpec spec ->
|
||||||
include('Iris v* [Forge] *.jar')
|
spec.delete(staleLoaderJars, legacyLoaderJar)
|
||||||
include('iris-forge-*.jar')
|
}
|
||||||
})
|
|
||||||
delete(layout.buildDirectory.file("libs/Iris-${project.version}+mc${minecraftVersion}-forge.jar"))
|
|
||||||
}
|
}
|
||||||
manifest {
|
manifest {
|
||||||
// FML 26.2 has no TOML mixin handling at all (ModFileParser reads neither [[mixins]] nor
|
// FML 26.2 has no TOML mixin handling at all (ModFileParser reads neither [[mixins]] nor
|
||||||
|
|||||||
@@ -17,9 +17,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
|
import org.gradle.api.file.DeleteSpec
|
||||||
|
import org.gradle.api.file.FileSystemOperations
|
||||||
|
import org.gradle.api.file.FileTree
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
||||||
|
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -38,6 +43,13 @@ plugins {
|
|||||||
|
|
||||||
apply plugin: 'art.arcane.volmit-packaging'
|
apply plugin: 'art.arcane.volmit-packaging'
|
||||||
|
|
||||||
|
interface IrisFileOperations {
|
||||||
|
@Inject
|
||||||
|
FileSystemOperations getFileSystemOperations()
|
||||||
|
}
|
||||||
|
|
||||||
|
IrisFileOperations irisFileOperations = objects.newInstance(IrisFileOperations)
|
||||||
|
|
||||||
apply from: file('../../gradle/modded-generation-build-revision.gradle')
|
apply from: file('../../gradle/modded-generation-build-revision.gradle')
|
||||||
|
|
||||||
Properties rootProperties = new Properties()
|
Properties rootProperties = new Properties()
|
||||||
@@ -214,20 +226,24 @@ tasks.named('test').configure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
inputs.property('version', project.version)
|
inputs.property('version', irisVersion)
|
||||||
inputs.property('minecraftVersion', minecraftVersion)
|
inputs.property('minecraftVersion', minecraftVersion)
|
||||||
filesMatching('META-INF/neoforge.mods.toml') {
|
filesMatching('META-INF/neoforge.mods.toml') {
|
||||||
expand('version': project.version, 'minecraftVersion': minecraftVersion)
|
expand('version': irisVersion, 'minecraftVersion': minecraftVersion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileTree staleLoaderJars = fileTree(layout.buildDirectory.dir('libs')) {
|
||||||
|
include('Iris v* [NeoForge] *.jar')
|
||||||
|
include('iris-neoforge-*.jar')
|
||||||
|
}
|
||||||
|
File legacyLoaderJar = layout.buildDirectory.file("libs/Iris-${project.version}+mc${minecraftVersion}-neoforge.jar").get().asFile
|
||||||
|
|
||||||
tasks.named('shadowJar', ShadowJar).configure {
|
tasks.named('shadowJar', ShadowJar).configure {
|
||||||
doFirst {
|
doFirst {
|
||||||
delete(fileTree(layout.buildDirectory.dir('libs')) {
|
irisFileOperations.fileSystemOperations.delete { DeleteSpec spec ->
|
||||||
include('Iris v* [NeoForge] *.jar')
|
spec.delete(staleLoaderJars, legacyLoaderJar)
|
||||||
include('iris-neoforge-*.jar')
|
}
|
||||||
})
|
|
||||||
delete(layout.buildDirectory.file("libs/Iris-${project.version}+mc${minecraftVersion}-neoforge.jar"))
|
|
||||||
}
|
}
|
||||||
archiveFileName.set(irisArtifactName('NeoForge', "${minecraftVersion}+${neoForgeVersion}"))
|
archiveFileName.set(irisArtifactName('NeoForge', "${minecraftVersion}+${neoForgeVersion}"))
|
||||||
configurations = [project.configurations.named('bundle').get()]
|
configurations = [project.configurations.named('bundle').get()]
|
||||||
|
|||||||
+88
-83
@@ -1,9 +1,15 @@
|
|||||||
|
import org.gradle.api.file.CopySpec
|
||||||
|
import org.gradle.api.file.DeleteSpec
|
||||||
|
import org.gradle.api.file.FileSystemOperations
|
||||||
|
import org.gradle.api.file.FileTree
|
||||||
import org.gradle.api.plugins.JavaPlugin
|
import org.gradle.api.plugins.JavaPlugin
|
||||||
import org.gradle.api.tasks.Copy
|
import org.gradle.api.tasks.Copy
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
import org.gradle.jvm.tasks.Jar
|
import org.gradle.jvm.tasks.Jar
|
||||||
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
||||||
|
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||||
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
* Copyright (c) 2021 Arcane Arts (Volmit Software)
|
||||||
@@ -51,6 +57,13 @@ plugins {
|
|||||||
apply plugin: 'art.arcane.volmit-packaging'
|
apply plugin: 'art.arcane.volmit-packaging'
|
||||||
apply from: file('gradle/runtime-relocations.gradle')
|
apply from: file('gradle/runtime-relocations.gradle')
|
||||||
|
|
||||||
|
interface IrisFileOperations {
|
||||||
|
@Inject
|
||||||
|
FileSystemOperations getFileSystemOperations()
|
||||||
|
}
|
||||||
|
|
||||||
|
IrisFileOperations irisFileOperations = objects.newInstance(IrisFileOperations)
|
||||||
|
|
||||||
group = 'art.arcane'
|
group = 'art.arcane'
|
||||||
version = providers.gradleProperty('irisVersion').getOrElse('4.1.0-26.2')
|
version = providers.gradleProperty('irisVersion').getOrElse('4.1.0-26.2')
|
||||||
|
|
||||||
@@ -91,6 +104,24 @@ String neoForgeArtifactName = irisArtifactName('NeoForge', "${minecraftVersion}+
|
|||||||
Map<String, String> runtimeDownloadRelocations = (Map<String, String>) ext.runtimeDownloadRelocations
|
Map<String, String> runtimeDownloadRelocations = (Map<String, String>) ext.runtimeDownloadRelocations
|
||||||
List<String> runtimeDownloadedPrefixes = (List<String>) ext.runtimeDownloadedPrefixes
|
List<String> runtimeDownloadedPrefixes = (List<String>) ext.runtimeDownloadedPrefixes
|
||||||
File pluginOutDirectory = layout.projectDirectory.dir('../PluginOuts').asFile
|
File pluginOutDirectory = layout.projectDirectory.dir('../PluginOuts').asFile
|
||||||
|
File legacyBukkitJar = layout.buildDirectory.file("libs/Iris-${project.version}.jar").get().asFile
|
||||||
|
File bukkitArtifact = layout.buildDirectory.file("libs/${bukkitArtifactName}").get().asFile
|
||||||
|
File consumerBukkitArtifact = layout.buildDirectory.file("consumer/${bukkitArtifactName}").get().asFile
|
||||||
|
File fabricArtifact = layout.projectDirectory.file("adapters/fabric/build/libs/${fabricArtifactName}").asFile
|
||||||
|
File forgeArtifact = layout.projectDirectory.file("adapters/forge/build/libs/${forgeArtifactName}").asFile
|
||||||
|
File neoForgeArtifact = layout.projectDirectory.file("adapters/neoforge/build/libs/${neoForgeArtifactName}").asFile
|
||||||
|
File consumerDirectory = layout.buildDirectory.dir('consumer').get().asFile
|
||||||
|
FileTree staleConsumerBukkitJars = fileTree(consumerDirectory) {
|
||||||
|
include('Iris v* [CraftBukkit] *.jar')
|
||||||
|
}
|
||||||
|
Map<String, FileTree> staleOutJars = [
|
||||||
|
CraftBukkit: 'Iris v* [CraftBukkit] *.jar',
|
||||||
|
Fabric : 'Iris v* [Fabric] *.jar',
|
||||||
|
Forge : 'Iris v* [Forge] *.jar',
|
||||||
|
NeoForge : 'Iris v* [NeoForge] *.jar'
|
||||||
|
].collectEntries { String platform, String pattern ->
|
||||||
|
[(platform): fileTree(pluginOutDirectory) { include(pattern) }]
|
||||||
|
}
|
||||||
apply plugin: ApiGenerator
|
apply plugin: ApiGenerator
|
||||||
|
|
||||||
// Where `buildAll` drops the per-platform jars for a local test server. Use the approved sibling
|
// Where `buildAll` drops the per-platform jars for a local test server. Use the approved sibling
|
||||||
@@ -161,7 +192,7 @@ tasks.named('jar', Jar).configure {
|
|||||||
exclude('languages/**')
|
exclude('languages/**')
|
||||||
}
|
}
|
||||||
doFirst {
|
doFirst {
|
||||||
delete(layout.buildDirectory.file("libs/Iris-${project.version}.jar"))
|
irisFileOperations.fileSystemOperations.delete { DeleteSpec spec -> spec.delete(legacyBukkitJar) }
|
||||||
}
|
}
|
||||||
archiveFileName.set(bukkitArtifactName)
|
archiveFileName.set(bukkitArtifactName)
|
||||||
}
|
}
|
||||||
@@ -172,9 +203,7 @@ tasks.register('iris', Copy) {
|
|||||||
from(layout.buildDirectory.file("libs/${bukkitArtifactName}"))
|
from(layout.buildDirectory.file("libs/${bukkitArtifactName}"))
|
||||||
into(layout.buildDirectory.dir('consumer'))
|
into(layout.buildDirectory.dir('consumer'))
|
||||||
doFirst {
|
doFirst {
|
||||||
delete(fileTree(layout.buildDirectory.dir('consumer').get()) {
|
irisFileOperations.fileSystemOperations.delete { DeleteSpec spec -> spec.delete(staleConsumerBukkitJars) }
|
||||||
include('Iris v* [CraftBukkit] *.jar')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,27 +212,20 @@ tasks.register('buildSwiftSwamp') {
|
|||||||
description = 'Builds every platform jar and drops them in the local BUILDS output directory.'
|
description = 'Builds every platform jar and drops them in the local BUILDS output directory.'
|
||||||
outputs.upToDateWhen { false }
|
outputs.upToDateWhen { false }
|
||||||
dependsOn('iris', 'verifyModdedArtifacts')
|
dependsOn('iris', 'verifyModdedArtifacts')
|
||||||
|
File swiftSwampOut = file('C://VolmitSoftware/BUILDS')
|
||||||
|
Map<String, File> swiftSwampSources = [
|
||||||
|
'Iris.jar' : consumerBukkitArtifact,
|
||||||
|
'Iris-Fabric.jar' : fabricArtifact,
|
||||||
|
'Iris-Forge.jar' : forgeArtifact,
|
||||||
|
'Iris-Neoforge.jar': neoForgeArtifact
|
||||||
|
]
|
||||||
doLast {
|
doLast {
|
||||||
File swiftSwampOut = file('C://VolmitSoftware/BUILDS')
|
swiftSwampSources.each { String target, File source ->
|
||||||
copy {
|
irisFileOperations.fileSystemOperations.copy { CopySpec spec ->
|
||||||
from(layout.buildDirectory.file("consumer/${bukkitArtifactName}"))
|
spec.from(source)
|
||||||
into(swiftSwampOut)
|
spec.into(swiftSwampOut)
|
||||||
rename { String ignored -> 'Iris.jar' }
|
spec.rename { String ignored -> target }
|
||||||
}
|
}
|
||||||
copy {
|
|
||||||
from(layout.projectDirectory.file("adapters/fabric/build/libs/${fabricArtifactName}"))
|
|
||||||
into(swiftSwampOut)
|
|
||||||
rename { String ignored -> 'Iris-Fabric.jar' }
|
|
||||||
}
|
|
||||||
copy {
|
|
||||||
from(layout.projectDirectory.file("adapters/forge/build/libs/${forgeArtifactName}"))
|
|
||||||
into(swiftSwampOut)
|
|
||||||
rename { String ignored -> 'Iris-Forge.jar' }
|
|
||||||
}
|
|
||||||
copy {
|
|
||||||
from(layout.projectDirectory.file("adapters/neoforge/build/libs/${neoForgeArtifactName}"))
|
|
||||||
into(swiftSwampOut)
|
|
||||||
rename { String ignored -> 'Iris-Neoforge.jar' }
|
|
||||||
}
|
}
|
||||||
println('')
|
println('')
|
||||||
println('=== Iris buildSwiftSwamp -> ' + swiftSwampOut + ' ===')
|
println('=== Iris buildSwiftSwamp -> ' + swiftSwampOut + ' ===')
|
||||||
@@ -219,11 +241,11 @@ tasks.register('buildBukkit', Copy) {
|
|||||||
dependsOn('jar')
|
dependsOn('jar')
|
||||||
from(layout.buildDirectory.file("libs/${bukkitArtifactName}"))
|
from(layout.buildDirectory.file("libs/${bukkitArtifactName}"))
|
||||||
into(pluginOutDirectory)
|
into(pluginOutDirectory)
|
||||||
|
File legacyOutJar = new File(pluginOutDirectory, "Iris-${project.version}+mc${minecraftVersion}.jar")
|
||||||
doFirst {
|
doFirst {
|
||||||
delete(fileTree(pluginOutDirectory) {
|
irisFileOperations.fileSystemOperations.delete { DeleteSpec spec ->
|
||||||
include('Iris v* [CraftBukkit] *.jar')
|
spec.delete(staleOutJars['CraftBukkit'], legacyOutJar)
|
||||||
})
|
}
|
||||||
delete(new File(pluginOutDirectory, "Iris-${project.version}+mc${minecraftVersion}.jar"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,11 +348,11 @@ tasks.register('buildFabric', Copy) {
|
|||||||
dependsOn('fabricJar')
|
dependsOn('fabricJar')
|
||||||
from(layout.projectDirectory.file("adapters/fabric/build/libs/${fabricArtifactName}"))
|
from(layout.projectDirectory.file("adapters/fabric/build/libs/${fabricArtifactName}"))
|
||||||
into(pluginOutDirectory)
|
into(pluginOutDirectory)
|
||||||
|
File legacyOutJar = new File(pluginOutDirectory, "Iris-${project.version}+mc${minecraftVersion}-fabric.jar")
|
||||||
doFirst {
|
doFirst {
|
||||||
delete(fileTree(pluginOutDirectory) {
|
irisFileOperations.fileSystemOperations.delete { DeleteSpec spec ->
|
||||||
include('Iris v* [Fabric] *.jar')
|
spec.delete(staleOutJars['Fabric'], legacyOutJar)
|
||||||
})
|
}
|
||||||
delete(new File(pluginOutDirectory, "Iris-${project.version}+mc${minecraftVersion}-fabric.jar"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,11 +386,11 @@ tasks.register('buildForge', Copy) {
|
|||||||
dependsOn('forgeJar')
|
dependsOn('forgeJar')
|
||||||
from(layout.projectDirectory.file("adapters/forge/build/libs/${forgeArtifactName}"))
|
from(layout.projectDirectory.file("adapters/forge/build/libs/${forgeArtifactName}"))
|
||||||
into(pluginOutDirectory)
|
into(pluginOutDirectory)
|
||||||
|
File legacyOutJar = new File(pluginOutDirectory, "Iris-${project.version}+mc${minecraftVersion}-forge.jar")
|
||||||
doFirst {
|
doFirst {
|
||||||
delete(fileTree(pluginOutDirectory) {
|
irisFileOperations.fileSystemOperations.delete { DeleteSpec spec ->
|
||||||
include('Iris v* [Forge] *.jar')
|
spec.delete(staleOutJars['Forge'], legacyOutJar)
|
||||||
})
|
}
|
||||||
delete(new File(pluginOutDirectory, "Iris-${project.version}+mc${minecraftVersion}-forge.jar"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,11 +424,11 @@ tasks.register('buildNeoforge', Copy) {
|
|||||||
dependsOn('neoforgeJar')
|
dependsOn('neoforgeJar')
|
||||||
from(layout.projectDirectory.file("adapters/neoforge/build/libs/${neoForgeArtifactName}"))
|
from(layout.projectDirectory.file("adapters/neoforge/build/libs/${neoForgeArtifactName}"))
|
||||||
into(pluginOutDirectory)
|
into(pluginOutDirectory)
|
||||||
|
File legacyOutJar = new File(pluginOutDirectory, "Iris-${project.version}+mc${minecraftVersion}-neoforge.jar")
|
||||||
doFirst {
|
doFirst {
|
||||||
delete(fileTree(pluginOutDirectory) {
|
irisFileOperations.fileSystemOperations.delete { DeleteSpec spec ->
|
||||||
include('Iris v* [NeoForge] *.jar')
|
spec.delete(staleOutJars['NeoForge'], legacyOutJar)
|
||||||
})
|
}
|
||||||
delete(new File(pluginOutDirectory, "Iris-${project.version}+mc${minecraftVersion}-neoforge.jar"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,7 +474,7 @@ Set<String> bukkitCoupledCoreClasses = bukkitPurityAllowlist.readLines()
|
|||||||
tasks.register('verifyFabricArtifact') {
|
tasks.register('verifyFabricArtifact') {
|
||||||
group = 'verification'
|
group = 'verification'
|
||||||
dependsOn('fabricJar')
|
dependsOn('fabricJar')
|
||||||
File artifact = layout.projectDirectory.file("adapters/fabric/build/libs/${fabricArtifactName}").asFile
|
File artifact = fabricArtifact
|
||||||
inputs.file(artifact)
|
inputs.file(artifact)
|
||||||
inputs.file(bukkitPurityAllowlist)
|
inputs.file(bukkitPurityAllowlist)
|
||||||
doLast {
|
doLast {
|
||||||
@@ -470,7 +492,7 @@ tasks.register('verifyFabricArtifact') {
|
|||||||
tasks.register('verifyForgeArtifact') {
|
tasks.register('verifyForgeArtifact') {
|
||||||
group = 'verification'
|
group = 'verification'
|
||||||
dependsOn('forgeJar')
|
dependsOn('forgeJar')
|
||||||
File artifact = layout.projectDirectory.file("adapters/forge/build/libs/${forgeArtifactName}").asFile
|
File artifact = forgeArtifact
|
||||||
inputs.file(artifact)
|
inputs.file(artifact)
|
||||||
inputs.file(bukkitPurityAllowlist)
|
inputs.file(bukkitPurityAllowlist)
|
||||||
doLast {
|
doLast {
|
||||||
@@ -487,7 +509,7 @@ tasks.register('verifyForgeArtifact') {
|
|||||||
tasks.register('verifyNeoforgeArtifact') {
|
tasks.register('verifyNeoforgeArtifact') {
|
||||||
group = 'verification'
|
group = 'verification'
|
||||||
dependsOn('neoforgeJar')
|
dependsOn('neoforgeJar')
|
||||||
File artifact = layout.projectDirectory.file("adapters/neoforge/build/libs/${neoForgeArtifactName}").asFile
|
File artifact = neoForgeArtifact
|
||||||
inputs.file(artifact)
|
inputs.file(artifact)
|
||||||
inputs.file(bukkitPurityAllowlist)
|
inputs.file(bukkitPurityAllowlist)
|
||||||
doLast {
|
doLast {
|
||||||
@@ -539,7 +561,7 @@ List<String> requiredBukkitArtifactEntries = [
|
|||||||
tasks.register('verifyBukkitArtifact') {
|
tasks.register('verifyBukkitArtifact') {
|
||||||
group = 'verification'
|
group = 'verification'
|
||||||
dependsOn('jar')
|
dependsOn('jar')
|
||||||
File artifact = layout.buildDirectory.file("libs/${bukkitArtifactName}").get().asFile
|
File artifact = bukkitArtifact
|
||||||
inputs.file(artifact)
|
inputs.file(artifact)
|
||||||
doLast {
|
doLast {
|
||||||
BukkitArtifactVerifier.verify(
|
BukkitArtifactVerifier.verify(
|
||||||
@@ -590,46 +612,29 @@ tasks.register('buildAll') {
|
|||||||
group = 'iris'
|
group = 'iris'
|
||||||
outputs.upToDateWhen { false }
|
outputs.upToDateWhen { false }
|
||||||
dependsOn('iris', 'verifyModdedArtifacts', 'buildAllToOut')
|
dependsOn('iris', 'verifyModdedArtifacts', 'buildAllToOut')
|
||||||
|
Map<String, List<Object>> consumerDrops = [
|
||||||
|
(bukkitConsumerPath) : ['Iris.jar', consumerBukkitArtifact],
|
||||||
|
(fabricConsumerPath) : ['Iris-Fabric.jar', fabricArtifact],
|
||||||
|
(forgeConsumerPath) : ['Iris-Forge.jar', forgeArtifact],
|
||||||
|
(neoForgeConsumerPath): ['Iris-Neoforge.jar', neoForgeArtifact]
|
||||||
|
]
|
||||||
doLast {
|
doLast {
|
||||||
delete(
|
consumerDrops.each { String consumerPath, List<Object> drop ->
|
||||||
file("${bukkitConsumerPath}/Iris-Fabric.jar"),
|
String keep = (String) drop.get(0)
|
||||||
file("${bukkitConsumerPath}/Iris-Forge.jar"),
|
File source = (File) drop.get(1)
|
||||||
file("${bukkitConsumerPath}/Iris-Neoforge.jar")
|
irisFileOperations.fileSystemOperations.delete { DeleteSpec spec ->
|
||||||
)
|
consumerDrops.values().each { List<Object> other ->
|
||||||
copy {
|
String name = (String) other.get(0)
|
||||||
from(layout.buildDirectory.file("consumer/${bukkitArtifactName}"))
|
if (name != keep) {
|
||||||
into(bukkitConsumerPath)
|
spec.delete(new File(consumerPath, name))
|
||||||
rename { String ignored -> 'Iris.jar' }
|
}
|
||||||
}
|
}
|
||||||
delete(
|
}
|
||||||
file("${fabricConsumerPath}/Iris.jar"),
|
irisFileOperations.fileSystemOperations.copy { CopySpec spec ->
|
||||||
file("${fabricConsumerPath}/Iris-Forge.jar"),
|
spec.from(source)
|
||||||
file("${fabricConsumerPath}/Iris-Neoforge.jar")
|
spec.into(consumerPath)
|
||||||
)
|
spec.rename { String ignored -> keep }
|
||||||
copy {
|
}
|
||||||
from(layout.projectDirectory.file("adapters/fabric/build/libs/${fabricArtifactName}"))
|
|
||||||
into(fabricConsumerPath)
|
|
||||||
rename { String ignored -> 'Iris-Fabric.jar' }
|
|
||||||
}
|
|
||||||
delete(
|
|
||||||
file("${forgeConsumerPath}/Iris.jar"),
|
|
||||||
file("${forgeConsumerPath}/Iris-Fabric.jar"),
|
|
||||||
file("${forgeConsumerPath}/Iris-Neoforge.jar")
|
|
||||||
)
|
|
||||||
copy {
|
|
||||||
from(layout.projectDirectory.file("adapters/forge/build/libs/${forgeArtifactName}"))
|
|
||||||
into(forgeConsumerPath)
|
|
||||||
rename { String ignored -> 'Iris-Forge.jar' }
|
|
||||||
}
|
|
||||||
delete(
|
|
||||||
file("${neoForgeConsumerPath}/Iris.jar"),
|
|
||||||
file("${neoForgeConsumerPath}/Iris-Fabric.jar"),
|
|
||||||
file("${neoForgeConsumerPath}/Iris-Forge.jar")
|
|
||||||
)
|
|
||||||
copy {
|
|
||||||
from(layout.projectDirectory.file("adapters/neoforge/build/libs/${neoForgeArtifactName}"))
|
|
||||||
into(neoForgeConsumerPath)
|
|
||||||
rename { String ignored -> 'Iris-Neoforge.jar' }
|
|
||||||
}
|
}
|
||||||
println('')
|
println('')
|
||||||
println("=== Iris buildAll -> ${consumerLocation} ===")
|
println("=== Iris buildAll -> ${consumerLocation} ===")
|
||||||
|
|||||||
Reference in new issue
Block a user