aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/libs
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2012-03-07 19:56:17 -0800
committerXavier Ducrohet <xav@android.com>2012-03-07 20:25:29 -0800
commita08befd52438d523cb2cd41b53f961785d3872fd (patch)
tree782b1febe0eb57200ef9af545380848ade67da4a /sdkmanager/libs
parent7d2737e54866f33553ee85c546dcea197bffd130 (diff)
downloadsdk-a08befd52438d523cb2cd41b53f961785d3872fd.zip
sdk-a08befd52438d523cb2cd41b53f961785d3872fd.tar.gz
sdk-a08befd52438d523cb2cd41b53f961785d3872fd.tar.bz2
Ant build now sanitize jar files in setup task.
Previously the list of jar files was sanitized (to remove duplicates) in the dex task, but this meant the full list (with duplicates) was passed to proguard when building in release mode. This changeset move the sanitization of the jar files in the Setup Task so that the script later only deals with a sanitized list. The means the content of libs/*.jar for the current project must be looked at in the task instead of later in the XML script. Change-Id: Ib5253b80ee7c1ded004bcdad6184e0900b7a7543
Diffstat (limited to 'sdkmanager/libs')
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/build/JarListSanitizer.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/JarListSanitizer.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/JarListSanitizer.java
index c6c0c22..fa7b00b 100644
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/JarListSanitizer.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/JarListSanitizer.java
@@ -364,8 +364,9 @@ public class JarListSanitizer {
private void writeJarList(Map<String, List<JarEntity>> nameMap) {
File cacheFile = new File(mOut, CACHE_FILENAME);
+ OutputStreamWriter writer = null;
try {
- OutputStreamWriter writer = new OutputStreamWriter(
+ writer = new OutputStreamWriter(
new FileOutputStream(cacheFile), "UTF-8");
writer.write("# cache for current jar dependecy. DO NOT EDIT.\n");
@@ -393,14 +394,19 @@ public class JarListSanitizer {
}
}
}
-
- writer.close();
} catch (IOException e) {
mOutStream.println("WARNING: unable to write jarlist cache file " +
cacheFile.getAbsolutePath());
} catch (Sha1Exception e) {
// shouldn't happen here since we check that the sha1 is present first, meaning it's
// already been computing.
+ } finally {
+ if (writer != null) {
+ try {
+ writer.close();
+ } catch (IOException e) {
+ }
+ }
}
}