Add action overloads to platform methods, add TransformPlatformOnly

Signed-off-by: shedaniel <daniel@shedaniel.me>
This commit is contained in:
shedaniel
2021-04-20 20:55:11 +08:00
parent b08f27ed60
commit c61940f657
2 changed files with 10 additions and 2 deletions

View File

@@ -54,6 +54,7 @@ class ArchitectPlugin : Plugin<Project> {
it += TransformExpectPlatform()
it += RemapInjectables()
it += AddRefmapName()
it += TransformPlatformOnly()
}
project.tasks.register("transformProductionForge", TransformingTask::class.java) {
@@ -62,6 +63,7 @@ class ArchitectPlugin : Plugin<Project> {
it += TransformExpectPlatform()
it += RemapInjectables()
it += AddRefmapName()
it += TransformPlatformOnly()
it += TransformForgeAnnotations()
it += TransformForgeEnvironment()

View File

@@ -153,15 +153,19 @@ open class ArchitectPluginExtension(val project: Project) {
return this
}
fun fabric() {
@JvmOverloads
fun fabric(action: Action<Transform> = Action {}) {
transform("fabric", Action {
it.setupFabricTransforms()
action.execute(it)
})
}
fun forge() {
@JvmOverloads
fun forge(action: Action<Transform> = Action {}) {
transform("forge", Action {
it.setupForgeTransforms()
action.execute(it)
})
}
@@ -275,12 +279,14 @@ data class Transform(val configName: String, val transformers: MutableList<Class
this += GenerateFakeFabricMod::class.java
this += TransformExpectPlatform::class.java
this += RemapInjectables::class.java
this += TransformPlatformOnly::class.java
}
fun setupForgeTransforms() {
this += RuntimeMixinRefmapDetector::class.java
this += TransformExpectPlatform::class.java
this += RemapInjectables::class.java
this += TransformPlatformOnly::class.java
this += TransformForgeAnnotations::class.java
this += TransformForgeEnvironment::class.java