Java 类org.springframework.boot.cli.compiler.GroovyCompilerConfiguration 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:GrabCommand.java   
@Override
protected ExitStatus run(OptionSet options) throws Exception {
    SourceOptions sourceOptions = new SourceOptions(options);

    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();

    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);

    if (System.getProperty("grape.root") == null) {
        System.setProperty("grape.root", ".");
    }

    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.compile(sourceOptions.getSourcesArray());
    return ExitStatus.OK;
}
项目:spring-boot-concourse    文件:GrabCommand.java   
@Override
protected ExitStatus run(OptionSet options) throws Exception {
    SourceOptions sourceOptions = new SourceOptions(options);

    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();

    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);

    if (System.getProperty("grape.root") == null) {
        System.setProperty("grape.root", ".");
    }

    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.compile(sourceOptions.getSourcesArray());
    return ExitStatus.OK;
}
项目:contestparser    文件:GrabCommand.java   
@Override
protected ExitStatus run(OptionSet options) throws Exception {
    SourceOptions sourceOptions = new SourceOptions(options);

    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();

    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);

    if (System.getProperty("grape.root") == null) {
        System.setProperty("grape.root", ".");
    }

    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.compile(sourceOptions.getSourcesArray());
    return ExitStatus.OK;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ArchiveCommand.java   
private GroovyCompiler createCompiler(OptionSet options) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);
    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.getAstTransformations().add(0, new GrabAnnotationTransform());
    return groovyCompiler;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:Installer.java   
private static GroovyCompilerConfiguration createCompilerConfiguration(
        OptionSet options, CompilerOptionHandler compilerOptionHandler) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    return new OptionSetGroovyCompilerConfiguration(options, compilerOptionHandler,
            repositoryConfiguration) {
        @Override
        public boolean isAutoconfigure() {
            return false;
        }
    };
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringTestCompilerAutoConfiguration.java   
@Override
public void apply(GroovyClassLoader loader, GroovyCompilerConfiguration configuration,
        GeneratorContext generatorContext, SourceUnit source, ClassNode classNode)
                throws CompilationFailedException {
    if (!AstUtils.hasAtLeastOneAnnotation(classNode, "RunWith")) {
        AnnotationNode runWith = new AnnotationNode(ClassHelper.make("RunWith"));
        runWith.addMember("value",
                new ClassExpression(ClassHelper.make("SpringRunner")));
        classNode.addAnnotation(runWith);
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:GroovyGrabDependencyResolverTests.java   
@Before
public void setupResolver() {
    GroovyCompilerConfiguration configuration = new GroovyCompilerConfiguration() {

        @Override
        public boolean isGuessImports() {
            return true;
        }

        @Override
        public boolean isGuessDependencies() {
            return true;
        }

        @Override
        public boolean isAutoconfigure() {
            return false;
        }

        @Override
        public GroovyCompilerScope getScope() {
            return GroovyCompilerScope.DEFAULT;
        }

        @Override
        public List<RepositoryConfiguration> getRepositoryConfiguration() {
            return RepositoryConfigurationFactory
                    .createDefaultRepositoryConfiguration();
        }

        @Override
        public String[] getClasspath() {
            return new String[] { "." };
        }

    };
    this.resolver = new GroovyGrabDependencyResolver(configuration);
}
项目:spring-boot-concourse    文件:ArchiveCommand.java   
private GroovyCompiler createCompiler(OptionSet options) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);
    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.getAstTransformations().add(0, new GrabAnnotationTransform());
    return groovyCompiler;
}
项目:spring-boot-concourse    文件:Installer.java   
private static GroovyCompilerConfiguration createCompilerConfiguration(
        OptionSet options, CompilerOptionHandler compilerOptionHandler) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    return new OptionSetGroovyCompilerConfiguration(options, compilerOptionHandler,
            repositoryConfiguration) {
        @Override
        public boolean isAutoconfigure() {
            return false;
        }
    };
}
项目:spring-boot-concourse    文件:SpringTestCompilerAutoConfiguration.java   
@Override
public void apply(GroovyClassLoader loader, GroovyCompilerConfiguration configuration,
        GeneratorContext generatorContext, SourceUnit source, ClassNode classNode)
                throws CompilationFailedException {
    if (!AstUtils.hasAtLeastOneAnnotation(classNode, "RunWith")) {
        AnnotationNode runWith = new AnnotationNode(ClassHelper.make("RunWith"));
        runWith.addMember("value",
                new ClassExpression(ClassHelper.make("SpringRunner")));
        classNode.addAnnotation(runWith);
    }
}
项目:spring-boot-concourse    文件:GroovyGrabDependencyResolverTests.java   
@Before
public void setupResolver() {
    GroovyCompilerConfiguration configuration = new GroovyCompilerConfiguration() {

        @Override
        public boolean isGuessImports() {
            return true;
        }

        @Override
        public boolean isGuessDependencies() {
            return true;
        }

        @Override
        public boolean isAutoconfigure() {
            return false;
        }

        @Override
        public GroovyCompilerScope getScope() {
            return GroovyCompilerScope.DEFAULT;
        }

        @Override
        public List<RepositoryConfiguration> getRepositoryConfiguration() {
            return RepositoryConfigurationFactory
                    .createDefaultRepositoryConfiguration();
        }

        @Override
        public String[] getClasspath() {
            return new String[] { "." };
        }

    };
    this.resolver = new GroovyGrabDependencyResolver(configuration);
}
项目:contestparser    文件:ArchiveCommand.java   
private GroovyCompiler createCompiler(OptionSet options) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    GroovyCompilerConfiguration configuration = new OptionSetGroovyCompilerConfiguration(
            options, this, repositoryConfiguration);
    GroovyCompiler groovyCompiler = new GroovyCompiler(configuration);
    groovyCompiler.getAstTransformations().add(0, new GrabAnnotationTransform());
    return groovyCompiler;
}
项目:contestparser    文件:Installer.java   
private static GroovyCompilerConfiguration createCompilerConfiguration(
        OptionSet options, CompilerOptionHandler compilerOptionHandler) {
    List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
            .createDefaultRepositoryConfiguration();
    return new OptionSetGroovyCompilerConfiguration(options, compilerOptionHandler,
            repositoryConfiguration) {
        @Override
        public boolean isAutoconfigure() {
            return false;
        }
    };
}
项目:contestparser    文件:SpringTestCompilerAutoConfiguration.java   
@Override
public void apply(GroovyClassLoader loader, GroovyCompilerConfiguration configuration,
        GeneratorContext generatorContext, SourceUnit source, ClassNode classNode)
                throws CompilationFailedException {
    if (!AstUtils.hasAtLeastOneAnnotation(classNode, "RunWith")) {
        AnnotationNode runwith = new AnnotationNode(ClassHelper.make("RunWith"));
        runwith.addMember("value",
                new ClassExpression(ClassHelper.make("SpringJUnit4ClassRunner")));
        classNode.addAnnotation(runwith);
    }
}
项目:contestparser    文件:GroovyGrabDependencyResolverTests.java   
@Before
public void setupResolver() {
    GroovyCompilerConfiguration configuration = new GroovyCompilerConfiguration() {

        @Override
        public boolean isGuessImports() {
            return true;
        }

        @Override
        public boolean isGuessDependencies() {
            return true;
        }

        @Override
        public boolean isAutoconfigure() {
            return false;
        }

        @Override
        public GroovyCompilerScope getScope() {
            return GroovyCompilerScope.DEFAULT;
        }

        @Override
        public List<RepositoryConfiguration> getRepositoryConfiguration() {
            return RepositoryConfigurationFactory
                    .createDefaultRepositoryConfiguration();
        }

        @Override
        public String[] getClasspath() {
            return new String[] { "." };
        }

    };
    this.resolver = new GroovyGrabDependencyResolver(configuration);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:GroovyGrabDependencyResolver.java   
GroovyGrabDependencyResolver(GroovyCompilerConfiguration configuration) {
    this.configuration = configuration;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringBootCompilerAutoConfiguration.java   
@Override
public void applyToMainClass(GroovyClassLoader loader,
        GroovyCompilerConfiguration configuration, GeneratorContext generatorContext,
        SourceUnit source, ClassNode classNode) throws CompilationFailedException {
    addEnableAutoConfigurationAnnotation(source, classNode);
}
项目:spring-boot-concourse    文件:GroovyGrabDependencyResolver.java   
GroovyGrabDependencyResolver(GroovyCompilerConfiguration configuration) {
    this.configuration = configuration;
}
项目:spring-boot-concourse    文件:SpringBootCompilerAutoConfiguration.java   
@Override
public void applyToMainClass(GroovyClassLoader loader,
        GroovyCompilerConfiguration configuration, GeneratorContext generatorContext,
        SourceUnit source, ClassNode classNode) throws CompilationFailedException {
    addEnableAutoConfigurationAnnotation(source, classNode);
}
项目:contestparser    文件:GroovyGrabDependencyResolver.java   
GroovyGrabDependencyResolver(GroovyCompilerConfiguration configuration) {
    this.configuration = configuration;
}
项目:contestparser    文件:SpringBootCompilerAutoConfiguration.java   
@Override
public void applyToMainClass(GroovyClassLoader loader,
        GroovyCompilerConfiguration configuration, GeneratorContext generatorContext,
        SourceUnit source, ClassNode classNode) throws CompilationFailedException {
    addEnableAutoConfigurationAnnotation(source, classNode);
}