mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 14:38:51 +00:00
build script cleanup
This commit is contained in:
1 parent
bef6eff47c
commit
da4b5051ca
11 files changed
+53
-23
No files matched your search
@@ -28,3 +28,6 @@ indent_size = 4
|
|||||||
indent_style = space
|
indent_style = space
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
max_line_length = off
|
max_line_length = off
|
||||||
|
|
||||||
|
[{*.kt,*.kts,*.yml}]
|
||||||
|
indent_size = 2
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
`kotlin-dsl`
|
`kotlin-dsl`
|
||||||
|
`kotlin-dsl-precompiled-script-plugins`
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import org.gradle.api.DefaultTask
|
||||||
|
import org.gradle.api.tasks.InputFile
|
||||||
|
import org.gradle.api.tasks.OutputDirectory
|
||||||
|
import org.gradle.api.tasks.TaskAction
|
||||||
|
|
||||||
|
open class FileCopyTask : DefaultTask() {
|
||||||
|
@InputFile
|
||||||
|
val fileToCopy = project.objects.fileProperty()
|
||||||
|
|
||||||
|
@OutputDirectory
|
||||||
|
val destinationDirectory = project.objects.directoryProperty()
|
||||||
|
|
||||||
|
private val destination = project.objects.fileProperty().convention(destinationDirectory.file(fileToCopy.map { it.asFile.name }))
|
||||||
|
|
||||||
|
@TaskAction
|
||||||
|
private fun copyFile() {
|
||||||
|
destinationDirectory.get().asFile.mkdirs()
|
||||||
|
fileToCopy.get().asFile.copyTo(destination.get().asFile, overwrite = true)
|
||||||
|
}
|
||||||
|
}
|
||||||
Whitespace-only changes.
@@ -0,0 +1,23 @@
|
|||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
File renamed without changes.
@@ -27,16 +27,7 @@ fun ShadowJar.standardRelocations() {
|
|||||||
|
|
||||||
fun ShadowJar.configureShadowJar() {
|
fun ShadowJar.configureShadowJar() {
|
||||||
minimize()
|
minimize()
|
||||||
|
|
||||||
standardRelocations()
|
standardRelocations()
|
||||||
|
|
||||||
doLast {
|
|
||||||
val archive = archiveFile.get().asFile
|
|
||||||
val libs = project.rootProject.buildDir.resolve("libs")
|
|
||||||
libs.mkdirs()
|
|
||||||
archive.copyTo(libs.resolve(archive.name), overwrite = true)
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// not needed at runtime
|
// not needed at runtime
|
||||||
exclude(dependency("com.google.code.findbugs:jsr305"))
|
exclude(dependency("com.google.code.findbugs:jsr305"))
|
||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
import net.kyori.indra.repository.sonatypeSnapshots
|
import net.kyori.indra.repository.sonatypeSnapshots
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
id("carbon-build-logic")
|
||||||
id("net.kyori.indra")
|
id("net.kyori.indra")
|
||||||
id("net.kyori.indra.git")
|
id("net.kyori.indra.git")
|
||||||
id("net.kyori.indra.checkstyle")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "net.draycia"
|
group = "net.draycia"
|
||||||
@@ -45,7 +45,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
checkstyle(rootProject.libs.stylecheck)
|
"checkstyle"(rootProject.libs.stylecheck)
|
||||||
}
|
}
|
||||||
|
|
||||||
configure<JavaPluginConvention> {
|
configure<JavaPluginConvention> {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription.Permission.Default.TRUE
|
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription.Permission.Default.TRUE
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.github.johnrengelman.shadow")
|
id("carbon-shadow-subproject")
|
||||||
id("net.minecrell.plugin-yml.bukkit")
|
id("net.minecrell.plugin-yml.bukkit")
|
||||||
id("xyz.jpenilla.run-paper")
|
id("xyz.jpenilla.run-paper")
|
||||||
}
|
}
|
||||||
@@ -25,12 +25,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
build {
|
|
||||||
dependsOn(shadowJar)
|
|
||||||
}
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
archiveFileName.set(project.name + "-" + project.version + ".jar")
|
|
||||||
configureShadowJar()
|
|
||||||
relocateDependency("io.papermc.lib")
|
relocateDependency("io.papermc.lib")
|
||||||
relocateDependency("io.leangen.geantyref")
|
relocateDependency("io.leangen.geantyref")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ plugins {
|
|||||||
|
|
||||||
rootProject.name = "CarbonChat"
|
rootProject.name = "CarbonChat"
|
||||||
|
|
||||||
|
includeBuild("build-logic")
|
||||||
|
|
||||||
setupSubproject("carbonchat-api") {
|
setupSubproject("carbonchat-api") {
|
||||||
projectDir = file("api")
|
projectDir = file("api")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import org.spongepowered.plugin.metadata.PluginDependency
|
|||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.github.johnrengelman.shadow")
|
id("carbon-shadow-subproject")
|
||||||
id("org.spongepowered.gradle.plugin")
|
id("org.spongepowered.gradle.plugin")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,12 +17,7 @@ tasks {
|
|||||||
runServer {
|
runServer {
|
||||||
classpath(shadowJar)
|
classpath(shadowJar)
|
||||||
}
|
}
|
||||||
build {
|
|
||||||
dependsOn(shadowJar)
|
|
||||||
}
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
archiveFileName.set(project.name + "-" + project.version + ".jar")
|
|
||||||
configureShadowJar()
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// included in sponge
|
// included in sponge
|
||||||
exclude(dependency("io.leangen.geantyref:geantyref"))
|
exclude(dependency("io.leangen.geantyref:geantyref"))
|
||||||
|
|||||||
Reference in new issue
Block a user