diff --git a/build.gradle.kts b/build.gradle.kts index 6421d1c..e2af7e8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { } group = "com.xpdustry" -version = "4.0.1" + if (indraGit.headTag() == null) "-SNAPSHOT" else "" +version = "4.0.2" + if (indraGit.headTag() == null) "-SNAPSHOT" else "" description = "Gradle plugin for building and testing mindustry mods/plugins." repositories { diff --git a/src/main/kotlin/com/xpdustry/toxopid/extension/ProjectExtensions.kt b/src/main/kotlin/com/xpdustry/toxopid/extension/ProjectExtensions.kt index ab18374..074396d 100644 --- a/src/main/kotlin/com/xpdustry/toxopid/extension/ProjectExtensions.kt +++ b/src/main/kotlin/com/xpdustry/toxopid/extension/ProjectExtensions.kt @@ -36,17 +36,14 @@ import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.hasPlugin import org.gradle.kotlin.dsl.named -private const val SHADOW_PLUGIN_ID = "com.github.johnrengelman.shadow" -private const val SHADOW_JAR_TASK_NAME = "shadowJar" - internal inline val Project.toxopid: ToxopidExtension get() = extensions.findByName(Toxopid.EXTENSION_NAME) as ToxopidExtension? ?: extensions.create(ToxopidExtension::class, Toxopid.EXTENSION_NAME, ToxopidExtensionImpl::class) internal fun Project.getJarTask(): TaskProvider = - if (plugins.hasPlugin(SHADOW_PLUGIN_ID)) { - tasks.named(SHADOW_JAR_TASK_NAME) + if (plugins.hasPlugin("com.github.johnrengelman.shadow") || plugins.hasPlugin("io.github.goooler.shadow")) { + tasks.named("shadowJar") } else if (plugins.hasPlugin(JavaPlugin::class)) { tasks.named(JavaPlugin.JAR_TASK_NAME) } else {