PageRenderTime 55ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/sdkmanager/app/etc/android.bat

https://gitlab.com/Codeaurora/platform_sdk
Batch | 89 lines | 70 code | 18 blank | 1 comment | 8 complexity | 0b335cf92c7ab65b3bef2447b1aeb3f4 MD5 | raw file
  1. @echo off
  2. rem Copyright (C) 2007 The Android Open Source Project
  3. rem
  4. rem Licensed under the Apache License, Version 2.0 (the "License");
  5. rem you may not use this file except in compliance with the License.
  6. rem You may obtain a copy of the License at
  7. rem
  8. rem http://www.apache.org/licenses/LICENSE-2.0
  9. rem
  10. rem Unless required by applicable law or agreed to in writing, software
  11. rem distributed under the License is distributed on an "AS IS" BASIS,
  12. rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. rem See the License for the specific language governing permissions and
  14. rem limitations under the License.
  15. rem Useful links:
  16. rem Command-line reference:
  17. rem http://technet.microsoft.com/en-us/library/bb490890.aspx
  18. rem don't modify the caller's environment
  19. setlocal
  20. rem Set up prog to be the path of this script, including following symlinks,
  21. rem and set up progdir to be the fully-qualified pathname of its directory.
  22. set prog=%~f0
  23. rem Grab current directory before we change it
  24. set work_dir="%cd%"
  25. rem Change current directory and drive to where the script is, to avoid
  26. rem issues with directories containing whitespaces.
  27. cd /d %~dp0
  28. rem Check we have a valid Java.exe in the path.
  29. set java_exe=
  30. call lib\find_java.bat
  31. if not defined java_exe goto :EOF
  32. set jar_path=lib\sdkmanager.jar;lib\swtmenubar.jar
  33. rem Set SWT.Jar path based on current architecture (x86 or x86_64)
  34. for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
  35. if "%1 %2"=="update sdk" goto StartUi
  36. if not "%1"=="" goto EndTempCopy
  37. :StartUi
  38. rem Starting Android SDK and AVD Manager UI
  39. rem We're now going to create a temp dir to hold all the Jar files needed
  40. rem to run the android tool, copy them in the temp dir and finally execute
  41. rem from that path. We do this only when the launcher is run without
  42. rem arguments, to display the SDK Updater UI. This allows the updater to
  43. rem update the tools directory where the updater itself is located.
  44. set tmp_dir=%TEMP%\temp-android-tool
  45. xcopy %swt_path% %tmp_dir%\%swt_path% /I /E /C /G /R /Y /Q > nul
  46. copy /B /D /Y lib\androidprefs.jar %tmp_dir%\lib\ > nul
  47. copy /B /D /Y lib\org.eclipse.* %tmp_dir%\lib\ > nul
  48. copy /B /D /Y lib\sdk* %tmp_dir%\lib\ > nul
  49. copy /B /D /Y lib\common.jar %tmp_dir%\lib\ > nul
  50. copy /B /D /Y lib\commons-compress* %tmp_dir%\lib\ > nul
  51. copy /B /D /Y lib\swtmenubar.jar %tmp_dir%\lib\ > nul
  52. copy /B /D /Y lib\commons-logging* %tmp_dir%\lib\ > nul
  53. copy /B /D /Y lib\commons-codec* %tmp_dir%\lib\ > nul
  54. copy /B /D /Y lib\httpclient* %tmp_dir%\lib\ > nul
  55. copy /B /D /Y lib\httpcode* %tmp_dir%\lib\ > nul
  56. copy /B /D /Y lib\httpmime* %tmp_dir%\lib\ > nul
  57. rem jar_path and swt_path are relative to PWD so we don't need to adjust them, just change dirs.
  58. set tools_dir=%cd%
  59. cd /d %tmp_dir%
  60. :EndTempCopy
  61. rem The global ANDROID_SWT always override the SWT.Jar path
  62. if defined ANDROID_SWT set swt_path=%ANDROID_SWT%
  63. if exist %swt_path% goto SetPath
  64. echo ERROR: SWT folder '%swt_path%' does not exist.
  65. echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
  66. goto :EOF
  67. :SetPath
  68. rem Finally exec the java program and end here.
  69. REM set REMOTE_DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
  70. call %java_exe% %REMOTE_DEBUG% -Dcom.android.sdkmanager.toolsdir="%tools_dir%" -Dcom.android.sdkmanager.workdir=%work_dir% -classpath "%jar_path%;%swt_path%\swt.jar" com.android.sdkmanager.Main %*
  71. rem EOF