mirror of
https://github.com/GayPizzaSpecifications/concrete.git
synced 2025-08-18 12:21:32 +00:00
38 lines
1.3 KiB
Kotlin
38 lines
1.3 KiB
Kotlin
package gay.pizza.foundation.concrete
|
|
|
|
import org.gradle.api.Project
|
|
import org.gradle.kotlin.dsl.get
|
|
import org.gradle.language.jvm.tasks.ProcessResources
|
|
|
|
@Suppress("UnstableApiUsage")
|
|
class ConcretePluginPlugin : ConcreteBaseBukkitPlugin() {
|
|
override fun apply(project: Project) {
|
|
super.apply(project)
|
|
|
|
project.plugins.apply("com.github.johnrengelman.shadow")
|
|
|
|
// During IDEA project import, if this code is active, it will print warnings.
|
|
// This will make the VERSION field unexpanded if you run using the IntelliJ build system.
|
|
if (!project.properties.containsKey("idea.gradle.do.not.build.tasks")) {
|
|
project.tasks.find<ProcessResources>("processResources")!!.apply {
|
|
val props = mapOf("version" to project.version.toString())
|
|
inputs.properties(props)
|
|
filteringCharset = "UTF-8"
|
|
filesMatching("plugin.yml") {
|
|
expand(props)
|
|
}
|
|
}
|
|
}
|
|
|
|
project.shadowJarTask!!.apply {
|
|
archiveClassifier.set("plugin")
|
|
}
|
|
|
|
project.tasks.addTaskDependency("assemble", "shadowJar")
|
|
|
|
project.concreteRootProject.tasks["setupPaperServer"].dependsOn(project.tasks["shadowJar"])
|
|
project.concreteRootProject.tasks.find<SetupLocalMinecraftServer>("setupLocalMinecraftServer")
|
|
?.dependsOn(project.tasks["shadowJar"])
|
|
}
|
|
}
|