diff --git a/vendor/.editorconfig b/vendor/.editorconfig new file mode 100644 index 000000000..e9d21fd10 --- /dev/null +++ b/vendor/.editorconfig @@ -0,0 +1,2 @@ +[*] +indent_size = 2 \ No newline at end of file diff --git a/vendor/build.gradle b/vendor/build.gradle index 6a5dbb733..a2f567307 100644 --- a/vendor/build.gradle +++ b/vendor/build.gradle @@ -59,6 +59,7 @@ project(":snakeyaml") { spotless { java { + targetExclude 'src/main/java9/**' // upstream doesn't format this for some reason eclipse() .configFile('../snakeyaml-upstream/src/etc/eclipse-java-google-style.xml') } @@ -72,6 +73,9 @@ project(":snakeyaml") { tasks.withType(ProcessResources).configureEach { dependsOn ':applyPatches' } + spotlessJava { + dependsOn ':applyPatches' + } tasks.named("test", Test) { environment( @@ -83,4 +87,32 @@ project(":snakeyaml") { excludeTest("org.yaml.snakeyaml.issues.issue318.ContextClassLoaderTest", null) } } -} \ No newline at end of file + + // Set up multi-release jar + sourceSets { + java9 { SourceSet set -> + set.compileClasspath += main.compileClasspath + set.runtimeClasspath += main.runtimeClasspath + set.java.setSrcDirs(['src/main/java9']) + } + } + + dependencies { + java9Implementation sourceSets.main.output + } + + jar { + from(sourceSets.java9.output) { + into 'META-INF/versions/9/' + exclude 'module-info.class' // not used for our purposes + } + manifest { + attributes 'Multi-Release': 'true' + } + } + + compileJava9Java { + options.release = 9 + options.compilerArgs += "--patch-module=org.yaml.snakeyaml=${sourceSets.main.output.classesDirs.asPath}" + } +} diff --git a/vendor/snakeyaml-patches/0001-scanner-Initial-implementation-of-tab-acceptance.patch b/vendor/snakeyaml-patches/0001-scanner-Initial-implementation-of-tab-acceptance.patch index 53f303ce3..96a9bb0ba 100644 --- a/vendor/snakeyaml-patches/0001-scanner-Initial-implementation-of-tab-acceptance.patch +++ b/vendor/snakeyaml-patches/0001-scanner-Initial-implementation-of-tab-acceptance.patch @@ -5,19 +5,20 @@ Subject: [PATCH] scanner: Initial implementation of tab acceptance diff --git a/src/main/java/org/yaml/snakeyaml/LoaderOptions.java b/src/main/java/org/yaml/snakeyaml/LoaderOptions.java -index 432730bee858cfaa9e638b87272265826d6270a6..03bcf0d12e35768cee5cc6e179d7150cc5857dee 100644 +index 12038cbbab7d0263739b8738a309412157be71c5..772c8819aab4b39d702d89d0508dc79d2126c13f 100644 --- a/src/main/java/org/yaml/snakeyaml/LoaderOptions.java +++ b/src/main/java/org/yaml/snakeyaml/LoaderOptions.java -@@ -28,6 +28,7 @@ public class LoaderOptions { - // https://en.wikipedia.org/wiki/Billion_laughs_attack - private boolean allowRecursiveKeys = false; +@@ -32,6 +32,8 @@ public class LoaderOptions { + private boolean processComments = false; + + private boolean acceptTabs = false; ++ private boolean enumCaseSensitive = true; + private int nestingDepthLimit = 50; - private int codePointLimit = 3 * 1024 * 1024; // 3 MB -@@ -148,6 +149,30 @@ public class LoaderOptions { - return processComments; +@@ -149,6 +151,30 @@ public class LoaderOptions { + return this; } + /** @@ -48,19 +49,17 @@ index 432730bee858cfaa9e638b87272265826d6270a6..03bcf0d12e35768cee5cc6e179d7150c * getter * diff --git a/src/main/java/org/yaml/snakeyaml/scanner/ScannerImpl.java b/src/main/java/org/yaml/snakeyaml/scanner/ScannerImpl.java -index c9ae314ce57c268e169b99b77d050ac02a143ce2..373e4c1845b0f739b2f805612887b8d84d057700 100644 +index ca2343c2d223abee59c219aa58629efd46429fdf..e566816b2cf7719a14c601f2551aa7f6f0c13cd6 100644 --- a/src/main/java/org/yaml/snakeyaml/scanner/ScannerImpl.java +++ b/src/main/java/org/yaml/snakeyaml/scanner/ScannerImpl.java -@@ -216,6 +216,8 @@ public final class ScannerImpl implements Scanner { +@@ -216,11 +216,14 @@ public final class ScannerImpl implements Scanner { */ private final Map possibleSimpleKeys; + private final boolean acceptTabs; + - /** - * Create - * -@@ -232,6 +234,7 @@ public final class ScannerImpl implements Scanner { + public ScannerImpl(StreamReader reader, LoaderOptions options) { + if (options == null) { throw new NullPointerException("LoaderOptions must be provided."); } this.parseComments = options.isProcessComments(); @@ -68,7 +67,7 @@ index c9ae314ce57c268e169b99b77d050ac02a143ce2..373e4c1845b0f739b2f805612887b8d8 this.reader = reader; this.tokens = new ArrayList(100); this.indents = new ArrayStack(10); -@@ -1241,7 +1244,7 @@ public final class ScannerImpl implements Scanner { +@@ -1213,7 +1216,7 @@ public final class ScannerImpl implements Scanner { int ff = 0; // Peek ahead until we find the first non-space character, then // move forward directly to that character. diff --git a/vendor/snakeyaml-patches/0002-emitter-Force-enable-prettyFlow-when-there-are-comme.patch b/vendor/snakeyaml-patches/0002-emitter-Force-enable-prettyFlow-when-there-are-comme.patch index cfa013b29..18cd2826c 100644 --- a/vendor/snakeyaml-patches/0002-emitter-Force-enable-prettyFlow-when-there-are-comme.patch +++ b/vendor/snakeyaml-patches/0002-emitter-Force-enable-prettyFlow-when-there-are-comme.patch @@ -8,7 +8,7 @@ sequences. It might be nice to capture the prettiness status of input data, but that seems extremely error-prone and probably not worth doing. diff --git a/src/main/java/org/yaml/snakeyaml/emitter/Emitter.java b/src/main/java/org/yaml/snakeyaml/emitter/Emitter.java -index 155e1f5775c20ae7efb6aa7f8a39c35480231452..81a0a14835931a6b0f201d102b5e9b66d9888bb5 100644 +index 7ba1cd72dfe51ca80131b05d38fdba8e7f37e60c..1cdf6658139bb08939a830ce1dbf1d762d0f8fda 100644 --- a/src/main/java/org/yaml/snakeyaml/emitter/Emitter.java +++ b/src/main/java/org/yaml/snakeyaml/emitter/Emitter.java @@ -161,7 +161,14 @@ public final class Emitter implements Emitable { @@ -104,7 +104,7 @@ index 155e1f5775c20ae7efb6aa7f8a39c35480231452..81a0a14835931a6b0f201d102b5e9b66 inlineCommentsCollector.collectEvents(); writeInlineComments(); state = states.pop(); -@@ -1532,6 +1565,10 @@ public final class Emitter implements Emitable { +@@ -1545,6 +1578,10 @@ public final class Emitter implements Emitable { if (!blockCommentsCollector.isEmpty()) { writeIndent(); writeCommentLines(blockCommentsCollector.consume()); diff --git a/vendor/snakeyaml-patches/0003-emitter-Emit-block-sequence-comments-before-the-indi.patch b/vendor/snakeyaml-patches/0003-emitter-Emit-block-sequence-comments-before-the-indi.patch index a4df5edf3..8767326c2 100644 --- a/vendor/snakeyaml-patches/0003-emitter-Emit-block-sequence-comments-before-the-indi.patch +++ b/vendor/snakeyaml-patches/0003-emitter-Emit-block-sequence-comments-before-the-indi.patch @@ -8,7 +8,7 @@ first element of the sequence. I don't think there's anything we can do about that though.... needs more thought i suppose diff --git a/src/main/java/org/yaml/snakeyaml/emitter/Emitter.java b/src/main/java/org/yaml/snakeyaml/emitter/Emitter.java -index 81a0a14835931a6b0f201d102b5e9b66d9888bb5..c30d3fb69004d63e752d6207f2df376d079da172 100644 +index 1cdf6658139bb08939a830ce1dbf1d762d0f8fda..b2f9e9486fd43570b831cf2409e1321aeedcb38b 100644 --- a/src/main/java/org/yaml/snakeyaml/emitter/Emitter.java +++ b/src/main/java/org/yaml/snakeyaml/emitter/Emitter.java @@ -753,6 +753,9 @@ public final class Emitter implements Emitable { diff --git a/vendor/snakeyaml-upstream b/vendor/snakeyaml-upstream index fc1701c11..a4df9e7d7 160000 --- a/vendor/snakeyaml-upstream +++ b/vendor/snakeyaml-upstream @@ -1 +1 @@ -Subproject commit fc1701c1130f83469c3712fb824b27af50c88898 +Subproject commit a4df9e7d7ffdc0c21fe268f872a1e30d03aa8f02