aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/app
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2011-11-11 10:43:03 -0800
committerRaphael <raphael@google.com>2011-11-11 14:17:33 -0800
commit58fd50795e20449fcf880022a9debbbcb2357376 (patch)
tree65ea6454b88409756cd6837d478391f2d7add357 /sdkmanager/app
parent560f2d0d14992389a367cbfef84b0e4a16796681 (diff)
downloadsdk-58fd50795e20449fcf880022a9debbbcb2357376.zip
sdk-58fd50795e20449fcf880022a9debbbcb2357376.tar.gz
sdk-58fd50795e20449fcf880022a9debbbcb2357376.tar.bz2
SDK Manager Windows: detach from java process.
This fixes 2 issues: - A bug in android.bat was that the bat+lib were only copied if the arguments were 'update sdk'. However since Tools R14 the sdkmanager doesn't use these arguments anymore. - Consequently when invoked as 'android sdk' it was not copying itself in the temp folder and thus was locking the tools folder, preventing updates. - The new behavior is to always copy, like that we don't care how the app is launched. - The SDK Manager.exe was launching android.bat and then waiting for it to finish, capturing its stdout in care there's an error to display. That locks SDK Manager.exe and thus prevent from updating it too. So instead we just don't wait for the bat to finish, don't capture/display its stdout. If there's an error, the user can still use the command line version to find out what's wrong. SDK Bugs: 21212:SDK Setup.exe [keeps] an open file handle SDK Bugs: 11989:SDK Manager.exe should be able to detach (it doesn't do the part where the sdk manager could restart itself after an update though. I'll file a different issue.) Change-Id: Id473ce58d3f36d417b6c0ee5f07a039adbbe06c0
Diffstat (limited to 'sdkmanager/app')
-rwxr-xr-xsdkmanager/app/etc/android.bat13
1 files changed, 3 insertions, 10 deletions
diff --git a/sdkmanager/app/etc/android.bat b/sdkmanager/app/etc/android.bat
index 6f93c7b..56a3e99 100755
--- a/sdkmanager/app/etc/android.bat
+++ b/sdkmanager/app/etc/android.bat
@@ -42,16 +42,9 @@ set jar_path=lib\sdkmanager.jar;lib\swtmenubar.jar
rem Set SWT.Jar path based on current architecture (x86 or x86_64)
for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
-if "%1 %2"=="update sdk" goto StartUi
-if not "%1"=="" goto EndTempCopy
-:StartUi
- rem Starting Android SDK and AVD Manager UI
-
- rem We're now going to create a temp dir to hold all the Jar files needed
- rem to run the android tool, copy them in the temp dir and finally execute
- rem from that path. We do this only when the launcher is run without
- rem arguments, to display the SDK Updater UI. This allows the updater to
- rem update the tools directory where the updater itself is located.
+:MkTempCopy
+ rem Copy android.bat and its required libs to a temp dir.
+ rem This avoids locking the tool dir in case the user is trying to update it.
set tmp_dir=%TEMP%\temp-android-tool
xcopy %swt_path% %tmp_dir%\%swt_path% /I /E /C /G /R /Y /Q > nul