Skip to content

Commit 9fe3e80

Browse files
authored
CLDR-17583 v46 BRS Births, part 2 (#3725)
1 parent 795135e commit 9fe3e80

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

tools/cldr-code/src/main/java/org/unicode/cldr/tool/GenerateBirth.java

+20-13
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,11 @@ public static void main(String[] args) throws IOException {
137137

138138
String logDirectory = myOptions.get("log").getValue();
139139

140-
System.out.println("en");
140+
System.out.println("en\tBegin");
141141
Births english = new Births("en");
142142
english.writeBirth(logDirectory, "en", null);
143-
english.writeBirthValues(dataDirectory + "/" + OutdatedPaths.OUTDATED_ENGLISH_DATA);
143+
String englishDataFile = dataDirectory + "/" + OutdatedPaths.OUTDATED_ENGLISH_DATA;
144+
english.writeBirthValues(englishDataFile);
144145

145146
Map<Long, Pair<CldrVersion, String>> pathToPrevious = new HashMap<>();
146147

@@ -194,8 +195,9 @@ public static void main(String[] args) throws IOException {
194195
if (!ltp.set(fileName).getRegion().isEmpty()) {
195196
continue; // skip region locales
196197
}
197-
// TODO skip default content locales
198-
System.out.println(fileName);
198+
// TODO skip default content
199+
System.out.println();
200+
System.out.println(fileName + "\t" + "Begin");
199201
Births other = new Births(fileName);
200202
Set<String> newer = other.writeBirth(logDirectory, fileName, english);
201203

@@ -254,11 +256,15 @@ public static void main(String[] args) throws IOException {
254256
}
255257
}
256258
}
259+
// give a reminder since the above will be lost
260+
System.out.println("Wrote: " + englishDataFile);
257261
if (errorCount != 0) {
258-
throw new IllegalArgumentException("Done, but " + errorCount + " errors");
262+
throw new IllegalArgumentException(
263+
"Done, but " + errorCount + " errors writing to " + outputDataFile);
259264
} else {
260-
System.out.println("Done, no errors");
265+
System.out.println("Done, no errors writing to: " + outputDataFile);
261266
}
267+
System.out.println("Please commit the above two files and start a PR.");
262268
}
263269

264270
static class Births {
@@ -277,20 +283,21 @@ static class Births {
277283
DisplayAndInputProcessor[] processors = new DisplayAndInputProcessor[factories.length];
278284

279285
for (int i = 0; i < factories.length; ++i) {
286+
final CldrVersion ver = CldrVersion.CLDR_VERSIONS_DESCENDING.get(i);
280287
try {
281288
files[i] = factories[i].make(file, USE_RESOLVED);
282289
processors[i] = new DisplayAndInputProcessor(files[i], false);
283-
} catch (Exception e) {
284-
// stop when we fail to find
290+
} catch (SimpleFactory.NoSourceDirectoryException nsd) {
291+
// stop when we fail to find a dir
285292
System.out.println(
286-
"Stopped at "
287-
+ file
288-
+ ", "
289-
+ CldrVersion.CLDR_VERSIONS_DESCENDING.get(i));
290-
// e.printStackTrace();
293+
String.format("%s\tEnd of source directories at v%s", file, ver));
291294
break;
295+
} catch (Throwable t) {
296+
throw new RuntimeException(
297+
"Exception while processing " + file + " v" + ver, t);
292298
}
293299
}
300+
System.out.println(String.format("%s\tDone", file));
294301
birthToPaths = Relation.of(new TreeMap<CldrVersion, Set<String>>(), TreeSet.class);
295302
pathToBirthCurrentPrevious = new HashMap<>();
296303
for (String xpath : files[0]) {

0 commit comments

Comments
 (0)