mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Update SpongeGradle to 1.1.1-SNAPSHOT and Indra to 2.0.5
Also move common configuration to convention plugins
This commit is contained in:
1 parent
6518cecce2
commit
eb7ec4353f
14 files changed
+117
-108
No files matched your search
@@ -4,11 +4,16 @@ plugins {
|
||||
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
maven("https://repo.jpenilla.xyz/snapshots/") // todo: for shadow to be compatible with Records
|
||||
maven("https://repo.jpenilla.xyz/snapshots/") // todo: for shadow snapshot
|
||||
}
|
||||
|
||||
// sadly can't use the version catalog here (?), need to keep in sync manually
|
||||
dependencies {
|
||||
// sadly can't use the version catalog here (?), need to keep in sync manually
|
||||
//implementation("gradle.plugin.com.github.jengelman.gradle.plugins", "shadow", "7.0.0") // temporary until shadow bumps jdependency for Record support
|
||||
implementation("com.github.johnrengelman", "shadow", "7.1.0-hexaoxide-SNAPSHOT") // temporary until shadow bumps jdependency for Record support
|
||||
// temporary until shadow bumps jdependency for Record support
|
||||
//implementation("gradle.plugin.com.github.jengelman.gradle.plugins", "shadow", "7.0.0")
|
||||
implementation("com.github.johnrengelman", "shadow", "7.1.0-hexaoxide-SNAPSHOT")
|
||||
|
||||
val indraVersion = "2.0.5"
|
||||
implementation("net.kyori", "indra-common", indraVersion)
|
||||
implementation("net.kyori", "indra-git", indraVersion)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.bundling.AbstractArchiveTask
|
||||
import org.gradle.kotlin.dsl.property
|
||||
|
||||
open class CarbonPlatformExtension(private val project: Project) {
|
||||
val jarTask: Property<AbstractArchiveTask> = project.objects.property()
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,23 +0,0 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
id("com.github.johnrengelman.shadow")
|
||||
}
|
||||
|
||||
tasks {
|
||||
named<Jar>("jar") {
|
||||
archiveClassifier.set("unshaded")
|
||||
}
|
||||
val shadowJar = named<ShadowJar>("shadowJar") {
|
||||
archiveClassifier.set(null as String?)
|
||||
configureShadowJar()
|
||||
}
|
||||
val copyJar = register<FileCopyTask>("copyJar") {
|
||||
fileToCopy.set(shadowJar.flatMap { it.archiveFile })
|
||||
destinationDirectory.set(rootProject.buildDir.resolve("libs"))
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
named<DefaultTask>("build") {
|
||||
dependsOn(copyJar)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
plugins {
|
||||
id("net.kyori.indra")
|
||||
id("net.kyori.indra.git")
|
||||
id("net.kyori.indra.checkstyle")
|
||||
id("net.kyori.indra.publishing")
|
||||
}
|
||||
|
||||
indra {
|
||||
gpl3OnlyLicense()
|
||||
javaVersions {
|
||||
target(16)
|
||||
}
|
||||
github(GITHUB_ORGANIZATION, GITHUB_REPO)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
plugins {
|
||||
id("base")
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
plugins {
|
||||
id("carbon.base-conventions")
|
||||
}
|
||||
|
||||
val platformExtension = extensions.create<CarbonPlatformExtension>("carbonPlatformExtension", project)
|
||||
|
||||
tasks {
|
||||
val copyJar = register<FileCopyTask>("copyJar") {
|
||||
fileToCopy.set(platformExtension.jarTask.flatMap { it.archiveFile })
|
||||
destinationDirectory.set(rootProject.layout.buildDirectory.dir("libs"))
|
||||
dependsOn(platformExtension.jarTask)
|
||||
}
|
||||
build {
|
||||
dependsOn(copyJar)
|
||||
}
|
||||
}
|
||||
|
||||
val projectVersion = version as String
|
||||
if (projectVersion.endsWith("-SNAPSHOT")) {
|
||||
// Add git commit hash to version for platforms
|
||||
version = "$projectVersion+${indraGit.commit()?.name?.substring(0, 7) ?: error("Failed to retrieve git commit hash")}"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
id("carbon.platform-conventions")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
}
|
||||
|
||||
tasks {
|
||||
jar {
|
||||
archiveClassifier.set("unshaded")
|
||||
}
|
||||
shadowJar {
|
||||
archiveClassifier.set(null as String?)
|
||||
configureShadowJar()
|
||||
}
|
||||
}
|
||||
|
||||
extensions.configure<CarbonPlatformExtension> {
|
||||
jarTask.set(tasks.shadowJar)
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
const val GITHUB_REPO_URL = "https://github.com/Hexaoxide/Carbon"
|
||||
const val GITHUB_ORGANIZATION = "Hexaoxide"
|
||||
const val GITHUB_REPO = "Carbon"
|
||||
const val GITHUB_REPO_URL = "https://github.com/$GITHUB_ORGANIZATION/$GITHUB_REPO"
|
||||
+2
-62
@@ -1,9 +1,5 @@
|
||||
import net.kyori.indra.repository.sonatypeSnapshots
|
||||
|
||||
plugins {
|
||||
id("carbon-build-logic")
|
||||
id("net.kyori.indra")
|
||||
id("net.kyori.indra.git")
|
||||
id("carbon.build-logic")
|
||||
}
|
||||
|
||||
group = "net.draycia"
|
||||
@@ -12,65 +8,9 @@ val projectVersion: String by project // get from gradle.properties
|
||||
version = projectVersion
|
||||
|
||||
subprojects {
|
||||
plugins.apply("net.kyori.indra")
|
||||
plugins.apply("net.kyori.indra.checkstyle")
|
||||
plugins.apply("net.kyori.indra.publishing")
|
||||
|
||||
if (projectVersion.endsWith("-SNAPSHOT")) {
|
||||
// Add git commit hash to version for platforms, but not for API
|
||||
if (this != rootProject.projects.carbonchatApi.dependencyProject) {
|
||||
version = "$projectVersion+${indraGit.commit()?.name?.substring(0, 7) ?: error("Failed to retrieve git commit hash")}"
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
sonatypeSnapshots()
|
||||
// Paper API
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
// Moonshine
|
||||
maven("https://nexus.proximyst.com/repository/maven-public/") {
|
||||
content { includeGroup("com.proximyst.moonshine") }
|
||||
}
|
||||
// cloud snapshots repo
|
||||
//maven("https://repo.incendo.org/content/repositories/snapshots") {
|
||||
// content { includeGroup("cloud.commandframework") }
|
||||
//}
|
||||
// temporary cloud snapshots repo for sponge-8
|
||||
maven("https://repo.jpenilla.xyz/snapshots/") {
|
||||
content { includeGroup("cloud.commandframework") }
|
||||
}
|
||||
// PlaceholderAPI
|
||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") {
|
||||
content { includeGroup("me.clip") }
|
||||
}
|
||||
maven("https://jitpack.io") {
|
||||
content { includeGroupByRegex("com\\.github\\..*") }
|
||||
}
|
||||
}
|
||||
plugins.apply("carbon.base-conventions")
|
||||
|
||||
dependencies {
|
||||
"checkstyle"(rootProject.libs.stylecheck)
|
||||
}
|
||||
|
||||
configure<JavaPluginConvention> {
|
||||
disableAutoTargetJvm()
|
||||
}
|
||||
|
||||
indra {
|
||||
gpl3OnlyLicense()
|
||||
|
||||
javaVersions {
|
||||
target(16)
|
||||
}
|
||||
|
||||
github("Hexaoxide", "Carbon")
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
// Root project has no useful artifacts
|
||||
withType<Jar> {
|
||||
onlyIf { false }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription.Permission.Default.TRUE
|
||||
|
||||
plugins {
|
||||
id("carbon-shadow-subproject")
|
||||
id("carbon.shadow-platform")
|
||||
id("net.minecrell.plugin-yml.bukkit")
|
||||
id("xyz.jpenilla.run-paper")
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@ metadata:
|
||||
- plugins
|
||||
|
||||
plugins:
|
||||
net.kyori.indra: &indra 2.0.4
|
||||
net.kyori.indra: &indra 2.0.5
|
||||
net.kyori.indra.checkstyle: *indra
|
||||
net.kyori.indra.publishing: *indra
|
||||
net.kyori.indra.git: *indra
|
||||
com.github.johnrengelman.shadow: 7.1.0-hexaoxide-SNAPSHOT # todo: temporary until shadow bumps jdependency for Record support
|
||||
net.minecrell.plugin-yml.bukkit: 0.4.0
|
||||
org.spongepowered.gradle.plugin: 1.1.0
|
||||
org.spongepowered.gradle.plugin: 1.1.1-SNAPSHOT
|
||||
xyz.jpenilla.run-paper: 1.0.0-SNAPSHOT
|
||||
|
||||
versions:
|
||||
|
||||
+33
-1
@@ -1,10 +1,42 @@
|
||||
enableFeaturePreview("VERSION_CATALOGS")
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
// Paper API
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
// Sponge API
|
||||
maven("https://repo.spongepowered.org/repository/maven-public/")
|
||||
// Moonshine
|
||||
maven("https://nexus.proximyst.com/repository/maven-public/") {
|
||||
content { includeGroup("com.proximyst.moonshine") }
|
||||
}
|
||||
// cloud snapshots repo
|
||||
//maven("https://repo.incendo.org/content/repositories/snapshots") {
|
||||
// content { includeGroup("cloud.commandframework") }
|
||||
//}
|
||||
// temporary cloud snapshots repo for sponge-8
|
||||
maven("https://repo.jpenilla.xyz/snapshots/") {
|
||||
content { includeGroup("cloud.commandframework") }
|
||||
}
|
||||
// PlaceholderAPI
|
||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") {
|
||||
content { includeGroup("me.clip") }
|
||||
}
|
||||
maven("https://jitpack.io") {
|
||||
content { includeGroupByRegex("com\\.github\\..*") }
|
||||
}
|
||||
}
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
}
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
maven("https://repo.jpenilla.xyz/snapshots/") // todo: for shadow to be compatible with Records
|
||||
maven("https://repo.spongepowered.org/repository/maven-public/") // SpongeGradle snapshots
|
||||
maven("https://repo.jpenilla.xyz/snapshots/") // run-paper + shadow snapshot
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-14
@@ -3,7 +3,7 @@ import org.spongepowered.plugin.metadata.PluginDependency
|
||||
import java.util.Locale
|
||||
|
||||
plugins {
|
||||
id("carbon-shadow-subproject")
|
||||
id("carbon.shadow-platform")
|
||||
id("org.spongepowered.gradle.plugin")
|
||||
}
|
||||
|
||||
@@ -14,19 +14,6 @@ dependencies {
|
||||
}
|
||||
|
||||
tasks {
|
||||
runServer {
|
||||
classpath(shadowJar.map { it.archiveFile })
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
afterEvaluate {
|
||||
runServer {
|
||||
val path = classpath.toMutableList()
|
||||
path.removeIf {
|
||||
it.name == jar.forUseAtConfigurationTime().get().archiveFile.forUseAtConfigurationTime().get().asFile.name
|
||||
}
|
||||
classpath = objects.fileCollection().from(path)
|
||||
}
|
||||
}
|
||||
shadowJar {
|
||||
dependencies {
|
||||
// included in sponge
|
||||
@@ -39,6 +26,7 @@ tasks {
|
||||
}
|
||||
|
||||
sponge {
|
||||
injectRepositories(false) // We specify repositories in settings.gradle.kts
|
||||
apiVersion("8.0.0")
|
||||
plugin(rootProject.name.toLowerCase(Locale.ROOT)) {
|
||||
loader(PluginLoaders.JAVA_PLAIN)
|
||||
|
||||
Reference in new issue
Block a user