Skip to content
Permalink
Browse files

Account for IntelliJ bug

  • Loading branch information...
kenzierocks committed Jul 15, 2019
1 parent ad5dcbe commit 5fa311be48e18f24a67f1bc8a12fd36d3133b8c2
Showing with 11 additions and 5 deletions.
  1. +11 −5 worldedit-fabric/build.gradle.kts
@@ -1,5 +1,6 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.fabricmc.loom.task.RemapJarTask
import kotlin.reflect.KClass

buildscript {
repositories {
@@ -95,11 +96,16 @@ artifacts {
add("archives", tasks.named("deobfJar"))
}

tasks.register<RemapJarTask>("remapShadowJar") {
val shadowJar = tasks.getByName<ShadowJar>("shadowJar")
dependsOn(shadowJar)
setInput(shadowJar.archiveFile)
setOutput(shadowJar.archiveFile.get().asFile.absolutePath.replace(Regex("-dev\\.jar$"), ".jar"))
// intellij has trouble detecting RemapJarTask as a subclass of Task
@Suppress("UNCHECKED_CAST")
val remapJarIntellijHack = RemapJarTask::class as KClass<Task>
tasks.register("remapShadowJar", remapJarIntellijHack) {
(this as RemapJarTask).run {
val shadowJar = tasks.getByName<ShadowJar>("shadowJar")
dependsOn(shadowJar)
setInput(shadowJar.archiveFile)
setOutput(shadowJar.archiveFile.get().asFile.absolutePath.replace(Regex("-dev\\.jar$"), ".jar"))
}
}

tasks.named("assemble").configure {

0 comments on commit 5fa311b

Please sign in to comment.
You can’t perform that action at this time.