diff --git a/tools/java/common/src/com/google/i18n/phonenumbers/tools/FileUtils.java b/tools/java/common/src/com/google/i18n/phonenumbers/tools/FileUtils.java index 425ddd1c9..89e338feb 100644 --- a/tools/java/common/src/com/google/i18n/phonenumbers/tools/FileUtils.java +++ b/tools/java/common/src/com/google/i18n/phonenumbers/tools/FileUtils.java @@ -18,10 +18,7 @@ package com.google.i18n.phonenumbers.tools; import java.io.Closeable; -import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; /** * Helper class containing methods designed to ease file manipulation and generation. @@ -52,36 +49,4 @@ public class FileUtils { close(closeable); } } - - /** - * Returns true if the provided output file/directory is older than the provided input - * file/directory. The last modification time of a directory is the maximum last - * modification time of its children. It assumes the provided output directory only contains - * generated files. - */ - public static boolean isGenerationRequired(File inputFile, File outputDir) { - if (!outputDir.exists()) { - return true; - } - return getLastModificationTime(inputFile) > getLastModificationTime(outputDir); - } - - /** - * Gets the modification time of the most recently modified file contained in a directory. - */ - private static long getLastModificationTime(File file) { - if (!file.isDirectory()) { - return file.lastModified(); - } - long maxModificationTime = 0; - - for (File child : file.listFiles()) { - long modificationTime = getLastModificationTime(child); - - if (modificationTime > maxModificationTime) { - maxModificationTime = modificationTime; - } - } - return maxModificationTime; - } } diff --git a/tools/java/java-build/src/com/google/i18n/phonenumbers/tools/BuildMetadataProtoFromXml.java b/tools/java/java-build/src/com/google/i18n/phonenumbers/tools/BuildMetadataProtoFromXml.java index c5bfc7b46..5d2332cc4 100644 --- a/tools/java/java-build/src/com/google/i18n/phonenumbers/tools/BuildMetadataProtoFromXml.java +++ b/tools/java/java-build/src/com/google/i18n/phonenumbers/tools/BuildMetadataProtoFromXml.java @@ -90,12 +90,6 @@ public class BuildMetadataProtoFromXml extends Command { boolean forTesting = args[3].equals("true"); boolean liteBuild = args.length > 4 && args[4].equals("true"); - if (!FileUtils.isGenerationRequired( - new File(inputFile), - new File(outputDir, new File(META_DATA_FILE_PREFIX).getParent()))) { - System.out.println("Metadata code up-to-date."); - return true; - } String filePrefix; if (forTesting) { filePrefix = outputDir + TEST_META_DATA_FILE_PREFIX; diff --git a/tools/java/java-build/src/com/google/i18n/phonenumbers/tools/GenerateAreaCodeData.java b/tools/java/java-build/src/com/google/i18n/phonenumbers/tools/GenerateAreaCodeData.java index 96883bfb2..5c0c66352 100644 --- a/tools/java/java-build/src/com/google/i18n/phonenumbers/tools/GenerateAreaCodeData.java +++ b/tools/java/java-build/src/com/google/i18n/phonenumbers/tools/GenerateAreaCodeData.java @@ -239,10 +239,6 @@ public class GenerateAreaCodeData extends Command { * @throws FileNotFoundException */ public void run() throws FileNotFoundException, IOException { - if (!FileUtils.isGenerationRequired(inputPath, outputPath)) { - LOGGER.log(Level.INFO, "Geocoding data up-to-date."); - return; - } List> inputOutputMappings = createInputOutputFileMappings(); SortedMap> availableDataFiles = new TreeMap>(); diff --git a/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar b/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar index 10555728e..426827c81 100644 Binary files a/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar and b/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar differ