diff options
Diffstat (limited to 'anttasks/src/com/android/ant/TaskHelper.java')
-rw-r--r-- | anttasks/src/com/android/ant/TaskHelper.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/anttasks/src/com/android/ant/TaskHelper.java b/anttasks/src/com/android/ant/TaskHelper.java index a360eaf..8a3d6bc 100644 --- a/anttasks/src/com/android/ant/TaskHelper.java +++ b/anttasks/src/com/android/ant/TaskHelper.java @@ -59,7 +59,20 @@ final class TaskHelper { // tools folder must exist, or this custom task wouldn't run! File toolsFolder= new File(sdkFile, SdkConstants.FD_TOOLS); File sourceProp = new File(toolsFolder, SdkConstants.FN_SOURCE_PROP); - p.load(new FileInputStream(sourceProp)); + + FileInputStream fis = null; + try { + fis = new FileInputStream(sourceProp); + p.load(fis); + } finally { + if (fis != null) { + try { + fis.close(); + } catch (IOException ignore) { + } + } + } + String value = p.getProperty("Pkg.Revision"); //$NON-NLS-1$ if (value != null) { return Integer.parseInt(value); |