lint.bat revision 4c3b19c11bed6972f2ebf758af4025607b41b11b
1@echo off
2rem Copyright (C) 2011 The Android Open Source Project
3rem
4rem Licensed under the Apache License, Version 2.0 (the "License");
5rem you may not use this file except in compliance with the License.
6rem You may obtain a copy of the License at
7rem
8rem      http://www.apache.org/licenses/LICENSE-2.0
9rem
10rem Unless required by applicable law or agreed to in writing, software
11rem distributed under the License is distributed on an "AS IS" BASIS,
12rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13rem See the License for the specific language governing permissions and
14rem limitations under the License.
15
16rem don't modify the caller's environment
17setlocal
18
19rem Set up prog to be the path of this script, including following symlinks,
20rem and set up progdir to be the fully-qualified pathname of its directory.
21set prog=%~f0
22
23rem Grab current directory before we change it
24set work_dir=%cd%
25
26rem Change current directory and drive to where the script is, to avoid
27rem issues with directories containing whitespaces.
28cd /d %~dp0
29
30rem Get the CWD as a full path with short names only (without spaces)
31for %%i in ("%cd%") do set prog_dir=%%~fsi
32
33rem Check we have a valid Java.exe in the path.
34set java_exe=
35call lib\find_java.bat
36if not defined java_exe goto :EOF
37
38set jarfile=lint.jar
39set frameworkdir=.
40
41if exist %frameworkdir%\%jarfile% goto JarFileOk
42    set frameworkdir=lib
43
44if exist %frameworkdir%\%jarfile% goto JarFileOk
45    set frameworkdir=..\framework
46
47:JarFileOk
48
49if debug NEQ "%1" goto NoDebug
50    set java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
51    shift 1
52:NoDebug
53
54set jarpath=%frameworkdir%\%jarfile%
55set javaextdirs=%frameworkdir%
56
57call "%java_exe%" %java_debug% -Xmx512m "-Dcom.android.tools.lint.bindir=%prog_dir%" "-Dcom.android.tools.lint.workdir=%work_dir%" -Djava.awt.headless=true -classpath "%jarpath%" com.android.tools.lint.Main %*
58
59