Examples of ClassCompiler


Examples of org.apache.maven.dotnet.compiler.ClassCompiler

        System.setProperty( "java.class.path", new File( "src/test/resources",
                                                         "dotnet-compiler-ext-0.14-incubating-SNAPSHOT.jar" ).getAbsolutePath() );

        ctx.init( project, getDefaultDotnetCompilerConfig() );

        ClassCompiler compiler = ctx.getClassCompiler();
    }
View Full Code Here

Examples of org.mozilla.javascript.optimizer.ClassCompiler

        private Class<?> compileClass( final Context pContext, final String pSourceName, final String pClassName, final Class<?> pSuperClass, final Class<?>[] pInterfaces) {

            final CompilerEnvirons environments = new CompilerEnvirons();
            environments.initFromContext(pContext);
            final ClassCompiler compiler = new ClassCompiler(environments);

            if (pSuperClass != null) {
                compiler.setTargetExtends(pSuperClass);
            }

            if (pInterfaces != null) {
                compiler.setTargetImplements(pInterfaces);
            }

            final byte[] sourceBytes = reader.getBytes(pSourceName);

            final Object[] classes = compiler.compileToClassFiles(new String(sourceBytes), getName(pSourceName), 1, pClassName);

            final GeneratedClassLoader loader = pContext.createClassLoader(pContext.getApplicationClassLoader());

            Class<?> clazz = null;
View Full Code Here

Examples of org.mozilla.javascript.optimizer.ClassCompiler

    public Main()
    {
        reporter = new ToolErrorReporter(true);
        compilerEnv = new CompilerEnvirons();
        compilerEnv.setErrorReporter(reporter);
        compiler = new ClassCompiler(compilerEnv);
    }
View Full Code Here

Examples of org.mozilla.javascript.optimizer.ClassCompiler

    public Main()
    {
        reporter = new ToolErrorReporter(true);
        compilerEnv = new CompilerEnvirons();
        compilerEnv.setErrorReporter(reporter);
        compiler = new ClassCompiler(compilerEnv);
    }
View Full Code Here

Examples of org.mozilla.javascript.optimizer.ClassCompiler

    public Main()
    {
        reporter = new ToolErrorReporter(true);
        compilerEnv = new CompilerEnvirons();
        compilerEnv.setErrorReporter(reporter);
        compiler = new ClassCompiler(compilerEnv);
    }
View Full Code Here

Examples of org.mozilla.javascript.optimizer.ClassCompiler

    public Main()
    {
        reporter = new ToolErrorReporter(true);
        compilerEnv = new CompilerEnvirons();
        compilerEnv.setErrorReporter(reporter);
        compiler = new ClassCompiler(compilerEnv);
    }
View Full Code Here

Examples of org.mozilla.javascript.optimizer.ClassCompiler

        private Class compileClass( final Context pContext, final String pSourceName, final String pClassName, final Class pSuperClass, final Class[] pInterfaces) throws IOException {

            final CompilerEnvirons environments = new CompilerEnvirons();
            environments.initFromContext(pContext);
            final ClassCompiler compiler = new ClassCompiler(environments);

            if (pSuperClass != null) {
                compiler.setTargetExtends(pSuperClass);
            }

            if (pInterfaces != null) {
                compiler.setTargetImplements(pInterfaces);
            }

            final byte[] sourceBytes = reader.getBytes(pSourceName);

            final Object[] classes = compiler.compileToClassFiles(new String(sourceBytes), getName(pSourceName), 1, pClassName);

            final GeneratedClassLoader loader = pContext.createClassLoader(pContext.getApplicationClassLoader());

            Class clazz = null;
View Full Code Here

Examples of org.mozilla.javascript.optimizer.ClassCompiler

    public Main()
    {
        reporter = new ToolErrorReporter(true);
        compilerEnv = new CompilerEnvirons();
        compilerEnv.setErrorReporter(reporter);
        compiler = new ClassCompiler(compilerEnv);
    }
View Full Code Here

Examples of org.mozilla.javascript.optimizer.ClassCompiler

    {
        Log log = getLog();
        File baseDir = new File(directory);
        if (baseDir.exists() && baseDir.isDirectory()) {
            CompilerEnvirons env = createEnvironment();
            ClassCompiler compiler = new ClassCompiler(env);
            File targetDirFile = new File(targetPath);

            DirectoryScanner scanner = new DirectoryScanner();
            scanner.setBasedir(baseDir);
            scanner.setIncludes(new String[]{pattern});
            scanner.scan();

            for (String fn : scanner.getIncludedFiles()) {
                File input = new File(baseDir, fn);
                String baseName = getBaseName(fn);
                String className = baseName.replaceAll("[/\\\\]", ".");
                File output = new File(targetDirFile, baseName + ".class");
                File srcOutput = new File(targetDirFile, baseName + ".js");

                if (input.lastModified() >= output.lastModified()) {
                    if (output.getParentFile() != null) {
                        output.getParentFile().mkdirs();
                    }

                    log.info("Compiling " + fn + " to " + output.getPath());

                    try {
                        String source = loadSource(input);

                        Object[] bytes;
                        try {
                            bytes = compiler.compileToClassFiles(addPrefixes(source), input.getName(),
                                                                 1, className);
                        } catch (RhinoException re) {
                            throw new MojoExecutionException(
                                "Error compiling script file " + fn + " :" + re.lineNumber() + ':' + re, re);
                        }
View Full Code Here

Examples of org.mozilla.javascript.optimizer.ClassCompiler

    public CacheManager(CompilerEnvirons compilerEnv) {
        if (compilerEnv == null) {
            compilerEnv = new CompilerEnvirons();
            compilerEnv.setErrorReporter(new ToolErrorReporter(true));
        }
        this.compiler = new ClassCompiler(compilerEnv);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.