ICU-23025 Fix cldr-to-icu deletes code files

This commit is contained in:
Mihai Nita 2025-01-29 01:51:15 -08:00
parent 8dfcbb5d09
commit 92b52ae6e3
3 changed files with 8 additions and 7 deletions

View file

@ -160,7 +160,7 @@ You can run it with `--help` for all the options supported.
* Outputting a subset of the supplemental data into a specified directory:
```sh
java -jar target/cldr-to-icu-1.0-SNAPSHOT-jar-with-dependencies.jar --outDir=/tmp/cldr --outputTypes=plurals,dayPeriods --dontGenCode=true
java -jar target/cldr-to-icu-1.0-SNAPSHOT-jar-with-dependencies.jar --outDir=/tmp/cldr --outputTypes=plurals,dayPeriods --dontGenCode
```
Note: Output types can be listed with mixedCase, lower_underscore or UPPER_UNDERSCORE.
Pass `-DoutputTypes=help` to see the full list.
@ -168,9 +168,9 @@ You can run it with `--help` for all the options supported.
* Outputting only a subset of locale IDs (and all the supplemental data):
```sh
java -jar target/cldr-to-icu-1.0-SNAPSHOT-jar-with-dependencies.jar --outDir=/tmp/cldr --outputTypes=plurals,dayPeriods --dontGenCode=true
java -jar target/cldr-to-icu-1.0-SNAPSHOT-jar-with-dependencies.jar --outDir=/tmp/cldr --outputTypes=plurals,dayPeriods --dontGenCode
java -jar target/cldr-to-icu-1.0-SNAPSHOT-jar-with-dependencies.jar --outDir=/tmp/cldr --localeIdFilter='(zh|yue).*' --dontGenCode=true
java -jar target/cldr-to-icu-1.0-SNAPSHOT-jar-with-dependencies.jar --outDir=/tmp/cldr --localeIdFilter='(zh|yue).*' --dontGenCode
```
* Overriding the default CLDR version string (which normally matches the CLDR library code):

View file

@ -53,7 +53,9 @@ public class Cldr2Icu {
private void clean() {
outputDirectories();
generateCode("clean");
if (!options.dontGenCode) {
generateCode("clean");
}
}
private void generate() {

View file

@ -61,8 +61,7 @@ class Cldr2IcuCliOptions {
String genJavaCodeDir;
private static final String DONT_GEN_CODE = "dontGenCode";
private static final String DONT_GEN_CODE_DESC = "Set this to true to prevent the generation of"
+ " ICU source files";
private static final String DONT_GEN_CODE_DESC = "Set this to prevent the generation of ICU source files";
private static final String DONT_GEN_CODE_DEFAULT = "false";
boolean dontGenCode;
@ -131,7 +130,7 @@ class Cldr2IcuCliOptions {
private static final String OUTPUT_TYPES_LIST_DEFAULT = "false";
private static final String FORCE_DELETE = "forceDelete";
private static final String FORCE_DELETE_DESC = "Override to force the 'clean' task to delete files it cannot"
private static final String FORCE_DELETE_DESC = "Specify to force the 'clean' task to delete files it cannot"
+ " determine to be auto-generated by this tool. This is useful if the file header changes since"
+ " the heading is what's used to recognize auto-generated files.";
private static final String FORCE_DELETE_DEFAULT = "false";