public final File base;
+ private boolean hadErrors = false;
+
public TranslationCollector(File base, File conf) {
this.base = base;
taint = new LinkedList<>();
System.out.println("Total Translatable Strings: " + translations.size());
TreeSet<TranslationEntry> trs = new TreeSet<>(translations.values());
writePOFile(out, trs);
-
}
public void add(String text, String line) {
for (TypeDeclaration td : parsedUnit.types) {
td.traverse(v, td.scope);
}
+ hadErrors |= v.hadErrors();
}
parsedUnits[i] = parsedUnit;
}
private LinkedList<TaintSource> taint;
public static void main(String[] args) throws IOException {
- new TranslationCollector(new File(args[1]), new File(args[0])).run(new File(args[2]));
+ TranslationCollector tc = new TranslationCollector(new File(args[1]), new File(args[0]));
+ tc.run(new File(args[2]));
+ if (tc.hadErrors) {
+ System.exit(1);
+ } else {
+ System.exit(0);
+ }
}
public static void writePOFile(File target, Collection<TranslationEntry> strings) throws IOException {