2 REM Copyright (C) 2007 The Android Open Source Project
\r
4 REM Licensed under the Apache License, Version 2.0 (the "License");
\r
5 REM you may not use this file except in compliance with the License.
\r
6 REM You may obtain a copy of the License at
\r
8 REM http://www.apache.org/licenses/LICENSE-2.0
\r
10 REM Unless required by applicable law or agreed to in writing, software
\r
11 REM distributed under the License is distributed on an "AS IS" BASIS,
\r
12 REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 REM See the License for the specific language governing permissions and
\r
14 REM limitations under the License.
\r
16 REM don't modify the caller's environment
\r
19 REM Locate dx.jar in the directory where dx.bat was found and start it.
\r
21 REM Set up prog to be the path of this script, including following symlinks,
\r
22 REM and set up progdir to be the fully-qualified pathname of its directory.
\r
25 REM Change current directory to where dx is, to avoid issues with directories
\r
26 REM containing whitespaces.
\r
29 rem Check we have a valid Java.exe in the path.
\r
31 if exist ..\tools\lib\find_java.bat call ..\tools\lib\find_java.bat
\r
32 if exist ..\..\tools\lib\find_java.bat call ..\..\tools\lib\find_java.bat
\r
33 if not defined java_exe goto :EOF
\r
38 if exist %frameworkdir%%jarfile% goto JarFileOk
\r
39 set frameworkdir=lib\
\r
41 if exist %frameworkdir%%jarfile% goto JarFileOk
\r
42 set frameworkdir=..\framework\
\r
46 set jarpath=%frameworkdir%%jarfile%
\r
51 REM By default, give dx a max heap size of 1 gig and a stack size of 1meg.
\r
52 rem This can be overridden by using "-JXmx..." and "-JXss..." options below.
\r
53 set defaultXmx=-Xmx1024M
\r
54 set defaultXss=-Xss1m
\r
56 REM Capture all arguments that are not -J options.
\r
57 REM Note that when reading the input arguments with %1, the cmd.exe
\r
58 REM automagically converts --name=value arguments into 2 arguments "--name"
\r
59 REM followed by "value". Dx has been changed to know how to deal with that.
\r
63 if [%1]==[] goto endArgs
\r
66 if [%defaultXmx%]==[] goto notXmx
\r
67 if %a:~0,5% NEQ -JXmx goto notXmx
\r
71 if [%defaultXss%]==[] goto notXss
\r
72 if %a:~0,5% NEQ -JXss goto notXss
\r
76 if %a:~0,2% NEQ -J goto notJ
\r
77 set javaOpts=%javaOpts% -%a:~2%
\r
82 set params=%params% %1
\r
88 set javaOpts=%javaOpts% %defaultXmx% %defaultXss%
\r
90 call %java_exe% %javaOpts% -Djava.ext.dirs=%frameworkdir% -jar %jarpath% %params%
\r