From e8d24ad5b63f26f23874c561b2937cf0139f8524 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 23 Oct 2023 12:52:08 -0500 Subject: [PATCH 1/3] CLDR-17137 json: fix LICENSE file - code reading LICENSE file was inadvertently using an obsolete filename See: 076d4f53e88f74555411089e0953266111ce2fdc #3300 --- .../unicode/cldr/json/Ldml2JsonConverter.java | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java index 3a3af824b93..ec5768807ff 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java @@ -42,8 +42,31 @@ import org.unicode.cldr.draft.ScriptMetadata; import org.unicode.cldr.draft.ScriptMetadata.Info; import org.unicode.cldr.tool.Option.Options; -import org.unicode.cldr.util.*; +import org.unicode.cldr.util.Annotations; +import org.unicode.cldr.util.CLDRConfig; +import org.unicode.cldr.util.CLDRFile; import org.unicode.cldr.util.CLDRFile.DraftStatus; +import org.unicode.cldr.util.CLDRLocale; +import org.unicode.cldr.util.CLDRPaths; +import org.unicode.cldr.util.CLDRTool; +import org.unicode.cldr.util.CLDRURLS; +import org.unicode.cldr.util.CalculatedCoverageLevels; +import org.unicode.cldr.util.CldrUtility; +import org.unicode.cldr.util.CoverageInfo; +import org.unicode.cldr.util.DtdData; +import org.unicode.cldr.util.DtdType; +import org.unicode.cldr.util.Factory; +import org.unicode.cldr.util.FileCopier; +import org.unicode.cldr.util.GlossonymConstructor; +import org.unicode.cldr.util.Level; +import org.unicode.cldr.util.LocaleIDParser; +import org.unicode.cldr.util.Pair; +import org.unicode.cldr.util.PatternCache; +import org.unicode.cldr.util.StandardCodes; +import org.unicode.cldr.util.SupplementalDataInfo; +import org.unicode.cldr.util.Timer; +import org.unicode.cldr.util.XMLSource; +import org.unicode.cldr.util.XPathParts; /** * Utility methods to extract data from CLDR repository and export it in JSON format. @@ -1246,13 +1269,14 @@ public void writeReadme(String outputDir, String packageName) throws IOException writeReadmeSection(outf); } try (PrintWriter outf = - FileUtilities.openUTF8Writer(outputDir + "/" + packageName, "LICENSE"); ) { + FileUtilities.openUTF8Writer( + outputDir + "/" + packageName, CldrUtility.LICENSE); ) { if (licenseFile.isPresent()) { try (BufferedReader br = FileUtilities.openUTF8Reader("", licenseFile.get()); ) { FileCopier.copy(br, outf); } } else { - FileCopier.copy(CldrUtility.getUTF8Data("unicode-license.txt"), outf); + FileCopier.copy(CldrUtility.getUTF8Data(CldrUtility.LICENSE), outf); } } } From 427b895f0b7d0a35e9fdb6f9167bb78715ce5044 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 23 Oct 2023 12:57:59 -0500 Subject: [PATCH 2/3] CLDR-17137 json: fix LICENSE file - add a short -L option for the license-file option --- .../unicode/cldr/json/Ldml2JsonConverter.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java index ec5768807ff..1fca1b1eab9 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java @@ -1,20 +1,5 @@ package org.unicode.cldr.json; -import com.google.common.base.Joiner; -import com.google.common.collect.Lists; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import com.ibm.icu.number.IntegerWidth; -import com.ibm.icu.number.LocalizedNumberFormatter; -import com.ibm.icu.number.NumberFormatter; -import com.ibm.icu.number.Precision; -import com.ibm.icu.text.MessageFormat; -import com.ibm.icu.util.NoUnit; -import com.ibm.icu.util.ULocale; import java.io.BufferedReader; import java.io.File; import java.io.IOException; @@ -38,6 +23,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; + import org.unicode.cldr.draft.FileUtilities; import org.unicode.cldr.draft.ScriptMetadata; import org.unicode.cldr.draft.ScriptMetadata.Info; @@ -68,6 +54,22 @@ import org.unicode.cldr.util.XMLSource; import org.unicode.cldr.util.XPathParts; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.ibm.icu.number.IntegerWidth; +import com.ibm.icu.number.LocalizedNumberFormatter; +import com.ibm.icu.number.NumberFormatter; +import com.ibm.icu.number.Precision; +import com.ibm.icu.text.MessageFormat; +import com.ibm.icu.util.NoUnit; +import com.ibm.icu.util.ULocale; + /** * Utility methods to extract data from CLDR repository and export it in JSON format. * @@ -267,7 +269,7 @@ private class AvailableLocales { // not be available as it is put in place by pom.xml .add( "license-file", - null, + 'L', ".*", "", "Override the license file included in the bundle"); From e2deec72d5825b178c02bb59fe2f163eaf9b5551 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 23 Oct 2023 12:59:53 -0500 Subject: [PATCH 3/3] CLDR-17137 spotless again --- .../unicode/cldr/json/Ldml2JsonConverter.java | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java index 1fca1b1eab9..978a277afbf 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java @@ -1,5 +1,20 @@ package org.unicode.cldr.json; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.ibm.icu.number.IntegerWidth; +import com.ibm.icu.number.LocalizedNumberFormatter; +import com.ibm.icu.number.NumberFormatter; +import com.ibm.icu.number.Precision; +import com.ibm.icu.text.MessageFormat; +import com.ibm.icu.util.NoUnit; +import com.ibm.icu.util.ULocale; import java.io.BufferedReader; import java.io.File; import java.io.IOException; @@ -23,7 +38,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; - import org.unicode.cldr.draft.FileUtilities; import org.unicode.cldr.draft.ScriptMetadata; import org.unicode.cldr.draft.ScriptMetadata.Info; @@ -54,22 +68,6 @@ import org.unicode.cldr.util.XMLSource; import org.unicode.cldr.util.XPathParts; -import com.google.common.base.Joiner; -import com.google.common.collect.Lists; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import com.ibm.icu.number.IntegerWidth; -import com.ibm.icu.number.LocalizedNumberFormatter; -import com.ibm.icu.number.NumberFormatter; -import com.ibm.icu.number.Precision; -import com.ibm.icu.text.MessageFormat; -import com.ibm.icu.util.NoUnit; -import com.ibm.icu.util.ULocale; - /** * Utility methods to extract data from CLDR repository and export it in JSON format. *