diff options
author | Elliott Baron <ebaron@fedoraproject.org> | 2010-06-26 22:27:34 -0400 |
---|---|---|
committer | Elliott Baron <ebaron@fedoraproject.org> | 2010-06-26 22:27:34 -0400 |
commit | 4e112eca7750a4f530c986be55c178c43c16d3ea (patch) | |
tree | db140c4fe4db9945502398e4869707ca0346353e /org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanApplication.java | |
parent | aa73b3f2503808e4b4029a73368a75b258d6f0dc (diff) | |
download | codan-master.tar.gz codan-master.tar.xz codan-master.zip |
* org.eclipse.cdt.codan.checkers.ui: Updated.
* org.eclipse.cdt.codan.checkers: Updated.
* org.eclipse.cdt.codan.core: Updated.
* org.eclipse.cdt.codan.ui: Updated.
* org.eclipse.cdt.codan.core.cxx: Added.
* org.eclipse.cdt.codan.extension/META-INF/MANIFEST.MF: Import org.eclipse.cdt.codan.core.cxx.model.
* org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/checkers/AbstractPropSimChecker.java: Superclass moved.
Diffstat (limited to 'org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanApplication.java')
-rw-r--r-- | org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanApplication.java | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanApplication.java b/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanApplication.java deleted file mode 100644 index e0287b1..0000000 --- a/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/CodanApplication.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.eclipse.cdt.codan.core; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.cdt.codan.internal.core.CodanBuilder; -import org.eclipse.cdt.codan.internal.core.model.CodanMarkerProblemReporter; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.equinox.app.IApplication; -import org.eclipse.equinox.app.IApplicationContext; - -public class CodanApplication implements IApplication { - private Collection<String> projects = new ArrayList<String>(); - private boolean verbose = false; - private boolean all = false; - - public Object start(IApplicationContext context) throws Exception { - String[] args = (String[]) context.getArguments().get( - "application.args"); - if (args == null || args.length == 0) { - help(); - return EXIT_OK; - } - extractArguments(args); - CodanBuilder codanBuilder = new CodanBuilder(); - CodanRuntime runtime = CodanRuntime.getInstance(); - runtime.setProblemReporter(new CodanMarkerProblemReporter() { - @Override - public void reportProblem(String id, int severity, IFile file, - int lineNumber, int startChar, int endChar, String message) { - System.out.println(file.getLocation() + ":" + lineNumber + ": " - + message); - } - }); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - if (all) { - log("Launching analysis on workspace"); - root.accept(codanBuilder.new CodanResourceVisitor()); - } else { - for (String project : projects) { - log("Launching analysis on project " + project); - IProject wProject = root.getProject(project); - if (!wProject.exists()) { - System.err.println("Error: project " + project - + " does not exist"); - continue; - } - wProject.accept(codanBuilder.new CodanResourceVisitor()); - } - } - return EXIT_OK; - } - - /** - * @param string - */ - private void log(String string) { - if (verbose) - System.err.println(string); - } - - /** - * @param args - */ - private void extractArguments(String[] args) { - for (int i = 0; i < args.length; i++) { - String string = args[i]; - if (string.equals("-verbose")) { - verbose = true; - } else if (string.equals("-all")) { - all = true; - } else { - projects.add(string); - } - } - } - - /** - * - */ - private void help() { - System.out.println("Usage: [options] <project1> <project2> ..."); - System.out.println("Options:"); - System.out.println(" -all - run on all projects in workspace"); - System.out.println(" -verbose - print extra build information"); - } - - public void stop() { - // nothing - } -} |