build: Use version catalogs
This commit is contained in:
1 parent
0ab91e435a
commit
94c0e34e1d
8 files changed
+84
-57
No files matched your search
+7
-6
@@ -2,12 +2,13 @@ import com.diffplug.gradle.spotless.FormatExtension
|
||||
|
||||
plugins {
|
||||
eclipse
|
||||
id("org.jetbrains.gradle.plugin.idea-ext")
|
||||
id("net.kyori.indra") apply false
|
||||
id("net.kyori.indra.git") apply false
|
||||
id("com.diffplug.spotless")
|
||||
id("net.kyori.indra.licenser.spotless") apply false
|
||||
id("com.diffplug.eclipse.apt") apply false
|
||||
alias(libs.plugins.ideaExt)
|
||||
alias(libs.plugins.indra) apply false
|
||||
alias(libs.plugins.indra.publishing) apply false
|
||||
alias(libs.plugins.indra.git) apply false
|
||||
alias(libs.plugins.spotless)
|
||||
alias(libs.plugins.indra.licenserSpotless) apply false
|
||||
alias(libs.plugins.eclipseApt) apply false
|
||||
}
|
||||
|
||||
group = "org.spongepowered"
|
||||
|
||||
@@ -3,12 +3,4 @@ url=https://www.spongepowered.org
|
||||
organization=SpongePowered
|
||||
projectUrl=https://www.spongepowered.org
|
||||
|
||||
accessWidenerVersion=1.1.0
|
||||
asmVersion=9.4
|
||||
checkerVersion=3.26.0
|
||||
forgeAutoRenamingToolVersion=0.1.24
|
||||
forgeFlowerVersion=1.5.605.9
|
||||
junitVersion=5.9.1
|
||||
mergeToolVersion=1.1.5
|
||||
|
||||
org.gradle.parallel=true
|
||||
@@ -0,0 +1,49 @@
|
||||
[metadata]
|
||||
version = "1.0"
|
||||
|
||||
[versions]
|
||||
accessWidener = "1.1.0"
|
||||
asm = "9.4"
|
||||
checker = "3.26.0"
|
||||
forgeAutoRenamingTool = "0.1.24"
|
||||
forgeFlower = "1.5.605.9"
|
||||
ideaExt = "1.1.6"
|
||||
immutables = "2.9.2"
|
||||
indra = "3.0.1"
|
||||
junit = "5.9.1"
|
||||
mergeTool = "1.1.5"
|
||||
|
||||
[libraries]
|
||||
# shared
|
||||
checkerQual = { module = "org.checkerframework:checker-qual", version = "3.26.0" }
|
||||
|
||||
# downloader-apache-http
|
||||
apache-httpClient5 = { module = "org.apache.httpcomponents.client5:httpclient5", version = "5.1.3" }
|
||||
|
||||
# gradle-plugin
|
||||
accessWidener = { module = "net.fabricmc:access-widener", version.ref = "accessWidener" }
|
||||
asm = { module = "org.ow2.asm:asm", version.ref = "asm" }
|
||||
asm-commons = { module = "org.ow2.asm:asm-commons", version.ref = "asm" }
|
||||
asm-util = { module = "org.ow2.asm:asm-util", version.ref = "asm" }
|
||||
forgeAutoRenamingTool = { module = "net.minecraftforge:ForgeAutoRenamingTool", version.ref = "forgeAutoRenamingTool" }
|
||||
forgeFlower = { module = "net.minecraftforge:forgeflower", version.ref = "forgeFlower" }
|
||||
gson = { module = "com.google.code.gson:gson", version = "2.9.1" }
|
||||
ideaExt = { module = "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext", version.ref = "ideaExt" }
|
||||
immutables-value = { module = "org.immutables:value", version.ref = "immutables" }
|
||||
immutables-gson = { module = "org.immutables:gson", version.ref = "immutables" }
|
||||
junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
|
||||
junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
|
||||
mergeTool = { module = "net.minecraftforge:mergetool", version.ref = "mergeTool" }
|
||||
shadowPlugin = { module = "com.github.jengelman.gradle.plugins:shadow", version = "6.1.0" }
|
||||
|
||||
[plugins]
|
||||
eclipseApt = { id = "com.diffplug.eclipse.apt", version = "3.39.0" }
|
||||
gradlePluginPublish = { id = "com.gradle.plugin-publish", version = "0.21.0" }
|
||||
ideaExt = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "ideaExt" }
|
||||
indra = { id = "net.kyori.indra", version.ref = "indra" }
|
||||
indra-git = { id = "net.kyori.indra.git", version.ref = "indra" }
|
||||
indra-licenserSpotless = { id = "net.kyori.indra.licenser.spotless", version.ref = "indra" }
|
||||
indra-publishing = { id = "net.kyori.indra.publishing", version.ref = "indra" }
|
||||
indra-publishing-gradlePlugin = { id = "net.kyori.indra.publishing.gradle-plugin", version.ref = "indra" }
|
||||
indra-publishing-sonatype = { id = "net.kyori.indra.publishing.sonatype", version.ref = "indra" }
|
||||
spotless = { id = "com.diffplug.spotless", version = "6.11.0" }
|
||||
@@ -4,19 +4,6 @@ pluginManagement {
|
||||
name = "sponge"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
val indraVersion = "3.0.1"
|
||||
id("com.gradle.plugin-publish") version "0.21.0"
|
||||
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.6"
|
||||
id("com.diffplug.eclipse.apt") version "3.39.0"
|
||||
id("com.diffplug.spotless") version "6.11.0"
|
||||
id("net.kyori.indra") version indraVersion
|
||||
id("net.kyori.indra.git") version indraVersion
|
||||
id("net.kyori.indra.licenser.spotless") version indraVersion
|
||||
id("net.kyori.indra.publishing.gradle-plugin") version indraVersion
|
||||
id("net.kyori.indra.publishing.sonatype") version indraVersion
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
plugins {
|
||||
id("net.kyori.indra.publishing")
|
||||
alias(libs.plugins.indra.publishing)
|
||||
}
|
||||
|
||||
description = "An implementation of the resolver Downloader based on the JDK 11 HTTP Client"
|
||||
|
||||
dependencies {
|
||||
api(project(":vanillagradle-resolver-core"))
|
||||
implementation("org.apache.httpcomponents.client5:httpclient5:5.1.3")
|
||||
implementation(libs.apache.httpClient5)
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("net.kyori.indra.publishing")
|
||||
alias(libs.plugins.indra.publishing)
|
||||
}
|
||||
|
||||
description = "An implementation of the resolver Downloader based on the JDK 11 HTTP Client"
|
||||
|
||||
@@ -3,9 +3,9 @@ import org.jetbrains.gradle.ext.TaskTriggersConfig
|
||||
|
||||
plugins {
|
||||
`java-gradle-plugin`
|
||||
id("com.gradle.plugin-publish")
|
||||
id("net.kyori.indra.publishing.gradle-plugin")
|
||||
id("org.jetbrains.gradle.plugin.idea-ext")
|
||||
alias(libs.plugins.gradlePluginPublish)
|
||||
alias(libs.plugins.indra.publishing.gradlePlugin)
|
||||
alias(libs.plugins.ideaExt)
|
||||
}
|
||||
|
||||
val commonDeps by configurations.creating {
|
||||
@@ -37,49 +37,49 @@ val mergeToolVersion: String by project
|
||||
dependencies {
|
||||
// All source sets
|
||||
commonDeps(gradleApi())
|
||||
commonDeps("org.ow2.asm:asm:$asmVersion")
|
||||
commonDeps("org.ow2.asm:asm-commons:$asmVersion")
|
||||
commonDeps("org.ow2.asm:asm-util:$asmVersion")
|
||||
commonDeps("net.minecraftforge:ForgeAutoRenamingTool:$forgeAutoRenamingToolVersion") {
|
||||
commonDeps(libs.asm)
|
||||
commonDeps(libs.asm.commons)
|
||||
commonDeps(libs.asm.util)
|
||||
commonDeps(libs.forgeAutoRenamingTool) {
|
||||
exclude("org.ow2.asm") // Use our own ASM
|
||||
exclude("net.sf.jopt-simple")
|
||||
}
|
||||
|
||||
// Just main
|
||||
implementation("com.google.code.gson:gson:2.9.1")
|
||||
implementation(libs.gson)
|
||||
|
||||
compileOnlyApi("org.checkerframework:checker-qual:$checkerVersion")
|
||||
annotationProcessor("org.immutables:value:2.9.2")
|
||||
compileOnlyApi("org.immutables:value:2.9.0:annotations")
|
||||
api("org.immutables:gson:2.9.2")
|
||||
compileOnlyApi(libs.checkerQual)
|
||||
annotationProcessor(libs.immutables.value)
|
||||
compileOnlyApi(variantOf(libs.immutables.value) { classifier("annotations") })
|
||||
api(libs.immutables.gson)
|
||||
|
||||
implementation(project(":vanillagradle-resolver-core"))
|
||||
implementation(project(":vanillagradle-downloader-apache-http"))
|
||||
|
||||
// IDE support
|
||||
implementation("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:1.1.6")
|
||||
implementation(libs.ideaExt)
|
||||
|
||||
// Jar merge worker (match with Constants)
|
||||
"jarMergeCompileOnly"("net.minecraftforge:mergetool:$mergeToolVersion") {
|
||||
"jarMergeCompileOnly"(libs.mergeTool) {
|
||||
exclude("org.ow2.asm")
|
||||
}
|
||||
implementation(jarMerge.output)
|
||||
|
||||
// Jar decompile worker (match with Constants)
|
||||
"jarDecompileCompileOnly"("net.minecraftforge:forgeflower:$forgeFlowerVersion")
|
||||
"jarDecompileCompileOnly"(libs.forgeFlower)
|
||||
implementation(jarDecompile.output)
|
||||
|
||||
// Access widener worker (match with Constants)
|
||||
"accessWidenCompileOnly"("net.fabricmc:access-widener:$accessWidenerVersion") {
|
||||
"accessWidenCompileOnly"(libs.accessWidener) {
|
||||
exclude("org.ow2.asm")
|
||||
}
|
||||
implementation(accessWiden.output)
|
||||
|
||||
"shadowCompileOnly"("com.github.jengelman.gradle.plugins:shadow:6.1.0")
|
||||
"shadowCompileOnly"(libs.shadowPlugin)
|
||||
implementation(shadow.output)
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
|
||||
testImplementation(libs.junit.api)
|
||||
testRuntimeOnly(libs.junit.engine)
|
||||
}
|
||||
|
||||
tasks {
|
||||
@@ -90,10 +90,10 @@ tasks {
|
||||
group = "sponge"
|
||||
description = "Generate classes from templates for VanillaGradle"
|
||||
val properties = mutableMapOf(
|
||||
"asmVersion" to asmVersion,
|
||||
"forgeFlowerVersion" to forgeFlowerVersion,
|
||||
"mergeToolVersion" to mergeToolVersion,
|
||||
"accessWidenerVersion" to accessWidenerVersion
|
||||
"asmVersion" to libs.versions.asm.get(),
|
||||
"forgeFlowerVersion" to libs.versions.forgeFlower.get(),
|
||||
"mergeToolVersion" to libs.versions.mergeTool.get(),
|
||||
"accessWidenerVersion" to libs.versions.accessWidener.get()
|
||||
)
|
||||
inputs.properties(properties)
|
||||
|
||||
@@ -115,7 +115,6 @@ tasks {
|
||||
synchronizationTasks(generateTemplates)
|
||||
}
|
||||
|
||||
val archiveOperations = project.serviceOf<ArchiveOperations>()
|
||||
jar {
|
||||
from(jarMerge.output)
|
||||
from(jarDecompile.output)
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
plugins {
|
||||
id("net.kyori.indra.publishing")
|
||||
alias(libs.plugins.indra.publishing)
|
||||
}
|
||||
|
||||
description = "The core resolver behind VanillaGradle"
|
||||
|
||||
dependencies {
|
||||
val checkerVersion: String by project
|
||||
compileOnlyApi("org.checkerframework:checker-qual:$checkerVersion")
|
||||
compileOnlyApi(libs.checkerQual)
|
||||
}
|
||||
Reference in new issue
Block a user