diff options
author | 2016-02-08 19:37:15 +0000 | |
---|---|---|
committer | 2016-02-09 12:19:26 +0000 | |
commit | 6742ffb92dc257888f5c6d428f12409799a4f3c5 (patch) | |
tree | f2e156dc8f9885b2c3afbbd751e724f46e17383d /src | |
parent | e67b048c5f82a31b0896ab6b6a37297ff11f394c (diff) |
Rollback of commit 40561f0bc889be8c0d90445befe75878ddee717b.
*** Reason for rollback ***
Collect all the temporary directories into one tree that will delete on exit.
*** Original change description ***
Automated [] rollback of commit 30469a9939c14f8d0d2708bd0a91525a2e161cc4.
*** Reason for rollback ***
Breaks density filtering.
*** Original change description ***
Collect all the temporary directories into one tree that will delete on exit.
--
MOS_MIGRATED_REVID=114132492
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java index 31bbdbfae5..5d22faac75 100644 --- a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java +++ b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java @@ -283,24 +283,24 @@ public class AndroidResourceProcessingAction { options = optionsParser.getOptions(Options.class); FileSystem fileSystem = FileSystems.getDefault(); Path working = fileSystem.getPath("").toAbsolutePath(); - Path mergedAssets = working.resolve("merged_assets"); - Path mergedResources = working.resolve("merged_resources"); - final AndroidResourceProcessor resourceProcessor = new AndroidResourceProcessor(STD_LOGGER); try { + final Path tmp = Files.createTempDirectory("android_resources_tmp"); + tmp.toFile().deleteOnExit(); - Path expandedOut = Files.createTempDirectory("tmp-expanded"); - expandedOut.toFile().deleteOnExit(); - Path deduplicatedOut = Files.createTempDirectory("tmp-deduplicated"); - deduplicatedOut.toFile().deleteOnExit(); + final Path expandedOut = tmp.resolve("tmp-expanded"); + final Path deduplicatedOut = tmp.resolve("tmp-deduplicated"); + final Path mergedAssets = tmp.resolve("merged_assets"); + final Path mergedResources = tmp.resolve("merged_resources"); + final Path filteredResources = tmp.resolve("resources-filtered"); + final Path densityManifest = tmp.resolve("manifest-filtered/AndroidManifest.xml"); Path generatedSources = null; if (options.srcJarOutput != null || options.rOutput != null || options.symbolsTxtOut != null) { - generatedSources = Files.createTempDirectory("generated_resources"); - generatedSources.toFile().deleteOnExit(); + generatedSources = tmp.resolve("generated_resources"); } LOGGER.fine(String.format("Setup finished at %sms", timer.elapsed(TimeUnit.MILLISECONDS))); @@ -329,10 +329,8 @@ public class AndroidResourceProcessingAction { true); LOGGER.fine(String.format("Merging finished at %sms", timer.elapsed(TimeUnit.MILLISECONDS))); - final Path filteredResources = fileSystem.getPath("resources-filtered"); - final Path densityManifest = fileSystem.getPath("manifest-filtered/AndroidManifest.xml"); final DensityFilteredAndroidData filteredData = mergedData.filter( - new DensitySpecificResourceFilter(options.densities, filteredResources, working), + new DensitySpecificResourceFilter(options.densities, filteredResources, mergedResources), new DensitySpecificManifestProcessor(options.densities, densityManifest)); LOGGER.fine( String.format("Density filtering finished at %sms", @@ -350,7 +348,7 @@ public class AndroidResourceProcessingAction { options.versionName, filteredData, data, - working.resolve("manifest"), + tmp.resolve("processed_manifest"), generatedSources, options.packagePath, options.proguardOutput, |