diff options
author | Tor Norbye <tnorbye@google.com> | 2012-08-06 09:23:06 -0700 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-08-06 09:23:07 -0700 |
commit | 057e5374a3c774555b8c0d8457997b4c368cf732 (patch) | |
tree | d624405e96848fdb8318407db90f544b23de308d /lint/cli | |
parent | e68867b12b200d82c80d8e2f77bbe11478027152 (diff) | |
parent | ee4780f1de04e7c87b3fe172a4b1510bd4c7e9bf (diff) | |
download | sdk-057e5374a3c774555b8c0d8457997b4c368cf732.zip sdk-057e5374a3c774555b8c0d8457997b4c368cf732.tar.gz sdk-057e5374a3c774555b8c0d8457997b4c368cf732.tar.bz2 |
Merge "Allow lint cli --sources to specify a path, and use from ant lint"
Diffstat (limited to 'lint/cli')
-rw-r--r-- | lint/cli/src/com/android/tools/lint/Main.java | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/lint/cli/src/com/android/tools/lint/Main.java b/lint/cli/src/com/android/tools/lint/Main.java index 8ca3c50..6cdb689 100644 --- a/lint/cli/src/com/android/tools/lint/Main.java +++ b/lint/cli/src/com/android/tools/lint/Main.java @@ -86,7 +86,7 @@ public class Main extends LintClient { private static final String ARG_URL = "--url"; //$NON-NLS-1$ private static final String ARG_VERSION = "--version"; //$NON-NLS-1$ private static final String ARG_EXITCODE = "--exitcode"; //$NON-NLS-1$ - private static final String ARG_CLASSES = "--classes"; //$NON-NLS-1$ + private static final String ARG_CLASSES = "--classpath"; //$NON-NLS-1$ private static final String ARG_SOURCES = "--sources"; //$NON-NLS-1$ private static final String ARG_NOWARN2 = "--nowarn"; //$NON-NLS-1$ @@ -466,29 +466,35 @@ public class Main extends LintClient { System.err.println("Missing class folder name"); System.exit(ERRNO_INVALIDARGS); } - File input = getInArgumentPath(args[++index]); - if (!input.exists()) { - System.err.println("Source folder " + input + " does not exist."); - System.exit(ERRNO_INVALIDARGS); - } - if (mClasses == null) { - mClasses = new ArrayList<File>(); + String paths = args[++index]; + for (String path : LintUtils.splitPath(paths)) { + File input = getInArgumentPath(path); + if (!input.exists()) { + System.err.println("Class path entry " + input + " does not exist."); + System.exit(ERRNO_INVALIDARGS); + } + if (mClasses == null) { + mClasses = new ArrayList<File>(); + } + mClasses.add(input); } - mClasses.add(input); } else if (arg.equals(ARG_SOURCES)) { if (index == args.length - 1) { System.err.println("Missing source folder name"); System.exit(ERRNO_INVALIDARGS); } - File input = getInArgumentPath(args[++index]); - if (!input.exists()) { - System.err.println("Source folder " + input + " does not exist."); - System.exit(ERRNO_INVALIDARGS); - } - if (mSources == null) { - mSources = new ArrayList<File>(); + String paths = args[++index]; + for (String path : LintUtils.splitPath(paths)) { + File input = getInArgumentPath(path); + if (!input.exists()) { + System.err.println("Source folder " + input + " does not exist."); + System.exit(ERRNO_INVALIDARGS); + } + if (mSources == null) { + mSources = new ArrayList<File>(); + } + mSources.add(input); } - mSources.add(input); } else if (arg.startsWith("--")) { System.err.println("Invalid argument " + arg + "\n"); printUsage(System.err); @@ -943,10 +949,10 @@ public class Main extends LintClient { ARG_XML + " <filename>", "Create an XML report instead.", "", "\nProject Options:", - ARG_SOURCES + " <dir>", "Add the given folder as a source directory for the " + - "project. Only valid when running lint on a single project.", - ARG_CLASSES + " <dir>", "Add the given folder (or jar file) as a class directory " + - "for the project. Only valid when running lint on a single project.", + ARG_SOURCES + " <dir>", "Add the given folder (or path) as a source directory for " + + "the project. Only valid when running lint on a single project.", + ARG_CLASSES + " <dir>", "Add the given folder (or jar file, or path) as a class " + + "directory for the project. Only valid when running lint on a single project.", "", "\nExit Status:", "0", "Success.", |