-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hocon: setup vendor project, remove config sorting on write and use o…
…rder preserving collections (#446) * hocon: setup vendor project * hocon: don't sort configs by key * hocon: make sort on write an option * build: deduplicate logic between hocon and yaml loaders * build: adjust shadow catalog entry and gitpatcher ver * Revert "hocon: make sort on write an option" This reverts commit 549655d. * hocon: remove some unnecessary diff * build: bump gitpatcher to 1.1.0 * build: don't shade scala files
- Loading branch information
Showing
17 changed files
with
659 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "vendor/snakeyaml-upstream"] | ||
path = vendor/snakeyaml-upstream | ||
url = https://bitbucket.org/snakeyaml/snakeyaml.git | ||
[submodule "vendor/typesafe-config-upstream"] | ||
path = vendor/typesafe-config-upstream | ||
url = https://github.com/lightbend/config.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
build-logic/src/main/groovy/org.spongepowered.configurate.build.shadow-component.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
plugins { | ||
id "org.spongepowered.configurate.build.component" | ||
id "com.github.johnrengelman.shadow" | ||
} | ||
|
||
configurations { | ||
shaded | ||
compileClasspath { extendsFrom shaded } | ||
runtimeClasspath { extendsFrom shaded } | ||
testImplementation { extendsFrom shaded } | ||
} | ||
|
||
tasks { | ||
shadowJar { | ||
dependsOn ':core:jar' // why? | ||
configurations = [project.configurations.shaded] | ||
minimize() | ||
} | ||
|
||
assemble { | ||
dependsOn shadowJar | ||
} | ||
|
||
pmdMain { | ||
enabled = false | ||
} | ||
} | ||
|
||
if (project.hasProperty("spongeKeyStore")) { | ||
// Just update the input of the sign jar task | ||
tasks.shadowJar { | ||
dependsOn ':core:signJar' // why? | ||
archiveClassifier = "unsigned-all" | ||
} | ||
tasks.jar { | ||
archiveClassifier = "unsigned" | ||
} | ||
|
||
tasks.named("signJar", org.spongepowered.configurate.build.SignJarTask) { | ||
dependsOn(tasks.shadowJar) | ||
|
||
from(zipTree(tasks.shadowJar.outputs.files.singleFile)) | ||
} | ||
} else { | ||
// Replace the default artifact | ||
// We have to replace the default artifact which is a bit ugly | ||
// https://github.com/gradle/gradle/pull/13650 should make it easier | ||
def forRelevantOutgoings = { action -> | ||
action.resolveStrategy = Closure.DELEGATE_FIRST | ||
action.delegate = configurations[JavaPlugin.API_ELEMENTS_CONFIGURATION_NAME].outgoing | ||
action() | ||
action.delegate = configurations[JavaPlugin.RUNTIME_ELEMENTS_CONFIGURATION_NAME].outgoing | ||
action() | ||
} | ||
|
||
forRelevantOutgoings { | ||
artifact(tasks.shadowJar) | ||
} | ||
|
||
tasks.shadowJar { | ||
archiveClassifier = "" | ||
} | ||
tasks.jar { | ||
archiveClassifier = "thin" | ||
} | ||
|
||
afterEvaluate { | ||
forRelevantOutgoings { | ||
artifacts.removeIf { it.classifier.equals("thin") } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
plugins { | ||
id "org.spongepowered.configurate.build.component" | ||
id 'org.spongepowered.configurate.build.shadow-component' | ||
} | ||
|
||
description = "HOCON format loader for Configurate" | ||
|
||
dependencies { | ||
api projects.core | ||
implementation libs.hocon | ||
shaded("configurate.thirdparty:typesafe-config:version-from-submodule") { | ||
// lib has no dependencies, but classpath is polluted by scala for tests... | ||
transitive = false | ||
} | ||
testImplementation libs.guava | ||
} | ||
|
||
tasks { | ||
shadowJar { | ||
relocate("com.typesafe.config", "${project.group}.configurate.hocon.internal.typesafeconfig") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# Gotta test an empty node | ||
empty {} | ||
other { | ||
location="dog park" | ||
op-level=dragon | ||
} | ||
# Test node | ||
test { | ||
op-level=unicorn | ||
} | ||
other { | ||
op-level=dragon | ||
location="dog park" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,16 @@ | ||
plugins { | ||
id 'org.spongepowered.configurate.build.component' | ||
alias(libs.plugins.shadow) | ||
id 'org.spongepowered.configurate.build.shadow-component' | ||
} | ||
|
||
description = "YAML format loader for Configurate" | ||
|
||
configurations { | ||
shaded | ||
compileClasspath { extendsFrom shaded } | ||
runtimeClasspath { extendsFrom shaded } | ||
testImplementation { extendsFrom shaded } | ||
} | ||
|
||
dependencies { | ||
api projects.core | ||
shaded "configurate.thirdparty:snakeyaml:version-from-submodule" | ||
} | ||
|
||
tasks { | ||
shadowJar { | ||
dependsOn ':core:jar' // why? | ||
configurations = [project.configurations.shaded] | ||
minimize() | ||
relocate("org.yaml.snakeyaml", "${project.group}.configurate.yaml.internal.snakeyaml") | ||
} | ||
|
||
assemble { | ||
dependsOn shadowJar | ||
} | ||
|
||
pmdMain { | ||
enabled = false | ||
} | ||
} | ||
|
||
if (project.hasProperty("spongeKeyStore")) { | ||
// Just update the input of the sign jar task | ||
tasks.shadowJar { | ||
dependsOn ':core:signJar' // why? | ||
archiveClassifier = "unsigned-all" | ||
} | ||
tasks.jar { | ||
archiveClassifier = "unsigned" | ||
} | ||
|
||
tasks.named("signJar", org.spongepowered.configurate.build.SignJarTask) { | ||
dependsOn(tasks.shadowJar) | ||
|
||
from(zipTree(tasks.shadowJar.outputs.files.singleFile)) | ||
} | ||
} else { | ||
// Replace the default artifact | ||
// We have to replace the default artifact which is a bit ugly | ||
// https://github.com/gradle/gradle/pull/13650 should make it easier | ||
def forRelevantOutgoings = { action -> | ||
action.resolveStrategy = Closure.DELEGATE_FIRST | ||
action.delegate = configurations[JavaPlugin.API_ELEMENTS_CONFIGURATION_NAME].outgoing | ||
action() | ||
action.delegate = configurations[JavaPlugin.RUNTIME_ELEMENTS_CONFIGURATION_NAME].outgoing | ||
action() | ||
} | ||
|
||
forRelevantOutgoings { | ||
artifact(tasks.shadowJar) | ||
} | ||
|
||
tasks.shadowJar { | ||
archiveClassifier = "" | ||
} | ||
tasks.jar { | ||
archiveClassifier = "thin" | ||
} | ||
|
||
afterEvaluate { | ||
forRelevantOutgoings { | ||
artifacts.removeIf { it.classifier.equals("thin") } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[*] | ||
indent_size = 2 | ||
[snakeyaml/**] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.