Package org.jvnet.sorcerer

Examples of org.jvnet.sorcerer.Analyzer


    private void run() throws IOException, CmdLineException {
        if(debug)
            System.setProperty("sorcerer.debug","true");

        Analyzer a = new Analyzer();

        a.setProjectDir(projectDir);

        for (String f : files) {
            File file = new File(f);
            if(!file.exists())
                throw new CmdLineException("No such file nor directory exists: "+file);

            if(file.getName().equals(".classpath")) {
                a.parseDotClassPath(file.getAbsoluteFile().getParentFile());
                continue;
            }
            if(file.getName().endsWith(".ipr")) {
                a.parseIpr(file);
                continue;
            }

            if(file.isDirectory()) {
                if(auto)
                    autoScan(file,a);
                else
                    a.addSourceFolder(file);
            } else
                a.addSourceFile(file);
        }

        for (String path : paths) {
            StringTokenizer tokens = new StringTokenizer(path, File.pathSeparator);
            while(tokens.hasMoreTokens())
                a.addClasspath(new File(tokens.nextToken()));
        }

        for (String lib : jarpaths) {
            jarScan(new File(lib),a);
        }

        ParsedSourceSet pss = a.analyze(new DiagnosticPrinter());
        addDependency(pss.getDependencies());

        new FecruJSonGenerator(pss).generateAll(outDir);
//        new FrameSetGenerator(pss).generateAll(outDir);
    }
View Full Code Here


    public void execute() throws BuildException {
        try {
            classpath.setProject(getProject());

            Analyzer a = new Analyzer();
            if(encoding!=null)
                a.setSourceEncoding(encoding);

            DirectoryScanner ds = getDirectoryScanner(dir);
            for (String f : ds.getIncludedFiles())
                a.addSourceFile(new File(dir,f));

            for (String p : classpath.list())
                a.addClasspath(getProject().resolveFile(p));

            a.setTabWidth(tabWidth);
            ParsedSourceSet pss = a.analyze(new DiagnosticPrinter());
            addDependencies(pss.getDependencies());

            FrameSetGenerator fsg = new FrameSetGenerator(pss);
            if(windowTitle!=null)
                fsg.setTitle(windowTitle);
View Full Code Here

        if (canGenerateReport(sourceDirs)) {
            // init some attributes -- TODO (javadoc)
            init();

            try {
                Analyzer a = new Analyzer();
                for (String dir : sourceDirs) {
                    a.addSourceFolder(new File(dir));
                }

                for( String path : getClasspathElements() ) {
                    a.addClasspath(new File(path));
                }


                a.setSourceEncoding(encoding);
                a.setLocale(locale);
                a.setTabWidth(tabWidth);
                ParsedSourceSet pss = a.analyze(new Listener(getLog()));
                addDependencies(pss.getDependencies());

                // TODO: support i18n and use locale for HTML generation
                FrameSetGenerator fsg = new FrameSetGenerator(pss);
                fsg.setTitle(windowTitle);
View Full Code Here

*/
public class WebAppMain implements ServletContextListener {

    public void contextInitialized(ServletContextEvent servletContextEvent) {
        try {
            Analyzer a = new Analyzer();
            a.addSourceFolder(new File("src/main/java/demo"));

            Sorcerer app = new Sorcerer(a.analyze());

            servletContextEvent.getServletContext().setAttribute("app",app);
        } catch (IOException e) {
            throw new Error(e);
        }
View Full Code Here

TOP

Related Classes of org.jvnet.sorcerer.Analyzer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.