mirror of
https://github.com/GayPizzaSpecifications/concrete.git
synced 2025-08-10 16:41:32 +00:00
Support for base projects which do not contain the Bukkit API.
Also fixes a bug where root and plugin couldn't exist in the same project.
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
package lgbt.mystic.foundation.concrete
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.repositories
|
||||
import java.net.URI
|
||||
|
||||
open class ConcreteBaseBukkitPlugin : ConcreteBasePlugin() {
|
||||
override fun apply(project: Project) {
|
||||
super.apply(project)
|
||||
|
||||
project.repositories {
|
||||
maven {
|
||||
name = "papermc"
|
||||
url = URI.create("https://papermc.io/repo/repository/maven-public/")
|
||||
}
|
||||
}
|
||||
|
||||
project.afterEvaluate {
|
||||
val paperApiVersion = project.concreteRootExtension.paperApiVersion.get()
|
||||
project.dependencies.add("compileOnly", "io.papermc.paper:paper-api:${paperApiVersion}")
|
||||
}
|
||||
}
|
||||
}
|
@ -5,12 +5,10 @@ import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.JavaPluginExtension
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import org.gradle.kotlin.dsl.repositories
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import java.net.URI
|
||||
|
||||
open class ConcreteProjectPlugin : Plugin<Project> {
|
||||
open class ConcreteBasePlugin : Plugin<Project> {
|
||||
override fun apply(project: Project) {
|
||||
val versionWithBuild = if (System.getenv("CI_PIPELINE_IID") != null) {
|
||||
project.rootProject.version.toString() + ".${System.getenv("CI_PIPELINE_IID")}"
|
||||
@ -23,16 +21,6 @@ open class ConcreteProjectPlugin : Plugin<Project> {
|
||||
project.plugins.apply("org.jetbrains.kotlin.jvm")
|
||||
project.plugins.apply("org.jetbrains.kotlin.plugin.serialization")
|
||||
|
||||
project.repositories {
|
||||
maven {
|
||||
name = "papermc"
|
||||
url = URI.create("https://papermc.io/repo/repository/maven-public/")
|
||||
}
|
||||
}
|
||||
|
||||
val paperApiVersion = project.concreteRootExtension.paperApiVersion.get()
|
||||
project.dependencies.add("compileOnly", "io.papermc.paper:paper-api:${paperApiVersion}")
|
||||
|
||||
project.extensions.getByType<JavaPluginExtension>().apply {
|
||||
val javaVersion = JavaVersion.toVersion(17)
|
||||
sourceCompatibility = javaVersion
|
@ -1,3 +1,3 @@
|
||||
package lgbt.mystic.foundation.concrete
|
||||
|
||||
class ConcreteLibraryPlugin : ConcreteProjectPlugin()
|
||||
class ConcreteLibraryPlugin : ConcreteBaseBukkitPlugin()
|
||||
|
@ -5,7 +5,7 @@ import org.gradle.kotlin.dsl.get
|
||||
import org.gradle.language.jvm.tasks.ProcessResources
|
||||
|
||||
@Suppress("UnstableApiUsage")
|
||||
class ConcretePluginPlugin : ConcreteProjectPlugin() {
|
||||
class ConcretePluginPlugin : ConcreteBaseBukkitPlugin() {
|
||||
override fun apply(project: Project) {
|
||||
super.apply(project)
|
||||
|
||||
|
Reference in New Issue
Block a user