mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 06:28:54 +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
@@ -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"
|
||||
Reference in new issue
Block a user