Skip to content

Commit 5d317ef

Browse files
committed
a lot more progress on integrating forked snakeyaml and proper tag handling
1 parent 98fec0e commit 5d317ef

38 files changed

+869
-2937
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
steps:
1515
- name: Checkout repository
1616
uses: actions/checkout@v2
17+
with:
18+
submodules: recursive
1719
- name: Setup JDK 11
1820
uses: actions/setup-java@v1
1921
with:

.github/workflows/test-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
uses: actions/checkout@v2
2626
with:
2727
fetch-depth: 0 # checkout full history for site generation
28+
submodules: recursive
2829
- name: Setup JDK 11
2930
uses: actions/setup-java@v2
3031
with:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "vendor/snakeyaml"]
2+
path = vendor/snakeyaml
3+
url = https://bitbucket.org/zml2008/snakeyaml.git

buildSrc/gradle.lockfile

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ com.github.siom79.japicmp:japicmp:0.15.3=compileClasspath,runtimeClasspath,testC
66
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
77
com.google.errorprone:error_prone_annotations:2.5.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
88
com.google.guava:failureaccess:1.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
9-
com.google.guava:guava:30.1-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
9+
com.google.guava:guava:30.1.1-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
1010
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
1111
com.google.j2objc:j2objc-annotations:1.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
1212
com.googlecode.javaewah:JavaEWAH:1.1.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -20,31 +20,31 @@ com.pinterest.ktlint:ktlint-ruleset-experimental:0.40.0=ktlint
2020
com.pinterest.ktlint:ktlint-ruleset-standard:0.40.0=ktlint
2121
com.pinterest.ktlint:ktlint-ruleset-test:0.40.0=ktlint
2222
com.pinterest:ktlint:0.40.0=ktlint
23-
com.sun.istack:istack-commons-runtime:3.0.8=compileClasspath,runtimeClasspath
24-
com.sun.xml.fastinfoset:FastInfoset:1.2.16=compileClasspath,runtimeClasspath
25-
de.thetaphi:forbiddenapis:3.1=compileClasspath,runtimeClasspath
26-
gradle.plugin.org.cadixdev.gradle:licenser:0.6.0=compileClasspath,runtimeClasspath
23+
com.sun.istack:istack-commons-runtime:3.0.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
24+
com.sun.xml.fastinfoset:FastInfoset:1.2.16=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
25+
de.thetaphi:forbiddenapis:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
26+
gradle.plugin.org.cadixdev.gradle:licenser:0.6.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
2727
info.picocli:picocli:3.9.6=ktlint
28-
io.github.gradle-nexus:publish-plugin:1.0.0=runtimeClasspath
29-
jakarta.activation:jakarta.activation-api:1.2.1=compileClasspath,runtimeClasspath
30-
jakarta.xml.bind:jakarta.xml.bind-api:2.3.2=compileClasspath,runtimeClasspath
31-
javax.activation:activation:1.1=compileClasspath,runtimeClasspath
32-
me.champeau.gradle:japicmp-gradle-plugin:0.2.9=compileClasspath,runtimeClasspath
33-
net.kyori:indra-common:2.0.3=compileClasspath,runtimeClasspath
34-
net.kyori:indra-git:2.0.3=compileClasspath,runtimeClasspath
35-
net.kyori:indra-publishing-sonatype:2.0.3=compileClasspath,runtimeClasspath
36-
net.kyori:mammoth:1.0.0=compileClasspath,runtimeClasspath
37-
net.ltgt.gradle:gradle-errorprone-plugin:2.0.1=compileClasspath,runtimeClasspath
38-
net.ltgt.gradle:gradle-nullaway-plugin:1.1.0=compileClasspath,runtimeClasspath
39-
org.checkerframework:checker-qual:3.12.0=compileClasspath
40-
org.checkerframework:checker-qual:3.8.0=runtimeClasspath
28+
io.github.gradle-nexus:publish-plugin:1.1.0=runtimeClasspath,testRuntimeClasspath
29+
jakarta.activation:jakarta.activation-api:1.2.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
30+
jakarta.xml.bind:jakarta.xml.bind-api:2.3.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
31+
javax.activation:activation:1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
32+
me.champeau.gradle:japicmp-gradle-plugin:0.2.9=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
33+
net.kyori:indra-common:2.0.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
34+
net.kyori:indra-git:2.0.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
35+
net.kyori:indra-publishing-sonatype:2.0.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
36+
net.kyori:mammoth:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
37+
net.ltgt.gradle:gradle-errorprone-plugin:2.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
38+
net.ltgt.gradle:gradle-nullaway-plugin:1.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
39+
org.checkerframework:checker-qual:3.13.0=compileClasspath,testCompileClasspath
40+
org.checkerframework:checker-qual:3.8.0=runtimeClasspath,testRuntimeClasspath
4141
org.ec4j.core:ec4j-core:0.2.2=ktlint
42-
org.eclipse.jgit:org.eclipse.jgit:5.11.0.202103091610-r=compileClasspath,runtimeClasspath
43-
org.glassfish.jaxb:jaxb-runtime:2.3.2=compileClasspath,runtimeClasspath
44-
org.glassfish.jaxb:txw2:2.3.2=compileClasspath,runtimeClasspath
45-
org.immutables:builder:2.8.8=compileClasspath
46-
org.immutables:value:2.8.8=compileClasspath
47-
org.javassist:javassist:3.24.0-GA=compileClasspath,runtimeClasspath
42+
org.eclipse.jgit:org.eclipse.jgit:5.11.0.202103091610-r=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
43+
org.glassfish.jaxb:jaxb-runtime:2.3.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
44+
org.glassfish.jaxb:txw2:2.3.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
45+
org.immutables:builder:2.8.8=compileClasspath,testCompileClasspath
46+
org.immutables:value:2.8.8=compileClasspath,testCompileClasspath
47+
org.javassist:javassist:3.24.0-GA=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
4848
org.jetbrains.intellij.deps:trove4j:1.0.20181211=kotlinCompilerClasspath,ktlint
4949
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10=ktlint
5050
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.31=kotlinCompilerClasspath
@@ -53,7 +53,7 @@ org.jetbrains.kotlin:kotlin-daemon-embeddable:1.4.31=kotlinCompilerClasspath
5353
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.4.31=kotlinCompilerPluginClasspath
5454
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.4.31=kotlinCompilerPluginClasspath
5555
org.jetbrains.kotlin:kotlin-reflect:1.4.10=ktlint
56-
org.jetbrains.kotlin:kotlin-reflect:1.4.31=compileClasspath,kotlinCompilerClasspath
56+
org.jetbrains.kotlin:kotlin-reflect:1.4.31=compileClasspath,kotlinCompilerClasspath,testCompileClasspath,testRuntimeClasspath
5757
org.jetbrains.kotlin:kotlin-sam-with-receiver:1.4.31=kotlinCompilerPluginClasspath
5858
org.jetbrains.kotlin:kotlin-script-runtime:1.4.10=ktlint
5959
org.jetbrains.kotlin:kotlin-script-runtime:1.4.31=kotlinCompilerClasspath,kotlinCompilerPluginClasspath
@@ -62,21 +62,17 @@ org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.31=kotlinCompilerP
6262
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.4.31=kotlinCompilerPluginClasspath
6363
org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.31=kotlinCompilerPluginClasspath
6464
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10=ktlint
65-
empty=ktlintReporter,ktlintRuleset
6665
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=runtimeClasspath
67-
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.31=compileClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspath
66+
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.31=compileClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,testCompileClasspath,testRuntimeClasspath
6867
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20=runtimeClasspath
69-
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.31=compileClasspath
68+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.31=compileClasspath,testCompileClasspath,testRuntimeClasspath
7069
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.20=runtimeClasspath
71-
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.31=compileClasspath
70+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.31=compileClasspath,testCompileClasspath,testRuntimeClasspath
7271
org.jetbrains.kotlin:kotlin-stdlib:1.4.10=ktlint
7372
org.jetbrains.kotlin:kotlin-stdlib:1.4.20=runtimeClasspath
74-
org.jetbrains.kotlin:kotlin-stdlib:1.4.31=compileClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspath
73+
org.jetbrains.kotlin:kotlin-stdlib:1.4.31=compileClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,testCompileClasspath,testRuntimeClasspath
7574
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8=kotlinCompilerPluginClasspath
7675
org.jetbrains:annotations:13.0=compileClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,ktlint,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
77-
org.jvnet.staxex:stax-ex:1.8.1=compileClasspath,runtimeClasspath
76+
org.jvnet.staxex:stax-ex:1.8.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7877
org.slf4j:slf4j-api:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
79-
xerces:xercesImpl:2.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
80-
xml-apis:xml-apis:1.3.04=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
81-
xml-resolver:xml-resolver:1.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
8278
empty=annotationProcessor,ktlintReporter,ktlintRuleset,testAnnotationProcessor

format/yaml/build.gradle.kts

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,90 @@ import org.spongepowered.configurate.build.useAutoValue
33

44
plugins {
55
id("org.spongepowered.configurate.build.component")
6+
id("com.github.johnrengelman.shadow") version "6.1.0"
67
groovy // For writing tests
78
}
89

910
description = "YAML format loader for Configurate"
1011

1112
tasks.withType(GroovyCompile::class).configureEach {
1213
// Toolchains need this... for some reason
13-
options.release.set(indra.javaVersions.target)
14+
options.release.set(indra.javaVersions().target())
1415
sourceCompatibility = "1.8"
1516
targetCompatibility = "1.8"
1617
}
1718

19+
val shaded by configurations.registering {
20+
resolutionStrategy.deactivateDependencyLocking()
21+
}
22+
23+
configurations {
24+
compileClasspath { extendsFrom(shaded.get()) }
25+
runtimeClasspath { extendsFrom(shaded.get()) }
26+
}
27+
1828
useAutoValue()
1929
dependencies {
2030
api(projects.core)
2131
// When updating snakeyaml, check ConfigurateScanner for changes against upstream
22-
implementation("org.yaml:snakeyaml:1.+")
32+
"shaded"("configurate.thirdparty:snakeyaml:version-from-submodule")
2333

2434
testImplementation("org.codehaus.groovy:groovy:3.+:indy")
2535
testImplementation("org.codehaus.groovy:groovy-nio:3.+:indy")
2636
testImplementation("org.codehaus.groovy:groovy-test-junit5:3.+:indy")
2737
testImplementation("org.codehaus.groovy:groovy-templates:3.+:indy")
2838
}
39+
tasks {
40+
shadowJar {
41+
configurations = listOf(shaded.get())
42+
minimize()
43+
relocate("org.yaml.snakeyaml", "${project.group}.configurate.yaml.internal.snakeyaml")
44+
}
45+
46+
assemble {
47+
dependsOn(shadowJar)
48+
}
49+
50+
pmdMain {
51+
isEnabled = false
52+
}
53+
}
54+
55+
if (project.hasProperty("spongeKeyStore")) {
56+
// Just update the input of the sign jar task
57+
tasks.shadowJar {
58+
archiveClassifier.set("unsigned-all")
59+
}
60+
61+
tasks.named("sign", org.spongepowered.configurate.build.SignJarTask::class) {
62+
dependsOn(tasks.shadowJar)
63+
// TODO: this is super ugly, need to give jar signing a bit of a redesign
64+
(this.rootSpec as org.gradle.api.internal.file.copy.DefaultCopySpec).sourcePaths.clear()
65+
from(zipTree(tasks.shadowJar.get().outputs.files.singleFile))
66+
}
67+
} else {
68+
// Replace the default artifact
69+
// We have to replace the default artifact which is a bit ugly
70+
// https://github.com/gradle/gradle/pull/13650 should make it easier
71+
fun forRelevantOutgoings(action: ConfigurationPublications.() -> Unit) {
72+
configurations[JavaPlugin.API_ELEMENTS_CONFIGURATION_NAME].outgoing.action()
73+
configurations[JavaPlugin.RUNTIME_ELEMENTS_CONFIGURATION_NAME].outgoing.action()
74+
}
75+
76+
forRelevantOutgoings {
77+
artifact(tasks.shadowJar)
78+
}
79+
80+
tasks.shadowJar {
81+
archiveClassifier.set("")
82+
}
83+
tasks.jar {
84+
archiveClassifier.set("thin")
85+
}
2986

30-
tasks.compileJava {
31-
options.errorprone.excludedPaths.set(".*org[\\\\/]spongepowered[\\\\/]configurate[\\\\/]yaml[\\\\/]ConfigurateScanner.*")
32-
// our vendored version of ScannerImpl has invalid JD, so we have to suppress some warnings
33-
options.compilerArgs.add("-Xdoclint:-html")
87+
afterEvaluate {
88+
forRelevantOutgoings {
89+
artifacts.removeIf { it.classifier == "thin" }
90+
}
91+
}
3492
}

0 commit comments

Comments
 (0)