Home | History | Annotate | Download | only in tools
      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 
     16 rem don't modify the caller's environment
     17 setlocal
     18 
     19 rem Set up prog to be the path of this script, including following symlinks,
     20 rem and set up progdir to be the fully-qualified pathname of its directory.
     21 set prog=%~f0
     22 
     23 rem Change current directory and drive to where the script is, to avoid
     24 rem issues with directories containing whitespaces.
     25 cd /d %~dp0
     26 
     27 rem Check we have a valid Java.exe in the path.
     28 set java_exe=
     29 call lib\find_java.bat
     30 if not defined java_exe goto :EOF
     31 
     32 set jarfile=traceview.jar
     33 set frameworkdir=
     34 
     35 if exist %frameworkdir%%jarfile% goto JarFileOk
     36     set frameworkdir=lib\
     37 
     38 if exist %frameworkdir%%jarfile% goto JarFileOk
     39     set frameworkdir=..\framework\
     40 
     41 :JarFileOk
     42 
     43 set jarpath=%frameworkdir%%jarfile%
     44 
     45 if not defined ANDROID_SWT goto QueryArch
     46     set swt_path=%ANDROID_SWT%
     47     goto SwtDone
     48 
     49 :QueryArch
     50 
     51     for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a
     52 
     53 :SwtDone
     54 
     55 if exist %swt_path% goto SetPath
     56     echo SWT folder '%swt_path%' does not exist.
     57     echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
     58     exit /B
     59 
     60 :SetPath
     61 set javaextdirs=%swt_path%;%frameworkdir%
     62 
     63 echo The standalone version of traceview is deprecated.
     64 echo Please use Android Device Monitor (tools/monitor) instead.
     65 call %java_exe% -Djava.ext.dirs=%javaextdirs% -Dcom.android.traceview.toolsdir= -jar %jarpath% %*
     66