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

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:GroovyCompiler.java   
/**
 * Create a new {@link GroovyCompiler} instance.
 * @param configuration the compiler configuration
 */
public GroovyCompiler(final GroovyCompilerConfiguration configuration) {

    this.configuration = configuration;
    this.loader = createLoader(configuration);

    DependencyResolutionContext resolutionContext = new DependencyResolutionContext();

    AetherGrapeEngine grapeEngine = AetherGrapeEngineFactory.create(this.loader,
            configuration.getRepositoryConfiguration(), resolutionContext);

    GrapeEngineInstaller.install(grapeEngine);

    this.loader.getConfiguration()
            .addCompilationCustomizers(new CompilerAutoConfigureCustomizer());
    if (configuration.isAutoconfigure()) {
        this.compilerAutoConfigurations = ServiceLoader
                .load(CompilerAutoConfiguration.class);
    }
    else {
        this.compilerAutoConfigurations = Collections.emptySet();
    }

    this.transformations = new ArrayList<ASTTransformation>();
    this.transformations
            .add(new DependencyManagementBomTransformation(resolutionContext));
    this.transformations.add(new DependencyAutoConfigurationTransformation(
            this.loader, resolutionContext, this.compilerAutoConfigurations));
    this.transformations.add(new GroovyBeansTransformation());
    if (this.configuration.isGuessDependencies()) {
        this.transformations.add(
                new ResolveDependencyCoordinatesTransformation(resolutionContext));
    }
    for (ASTTransformation transformation : ServiceLoader
            .load(SpringBootAstTransformation.class)) {
        this.transformations.add(transformation);
    }
    Collections.sort(this.transformations, AnnotationAwareOrderComparator.INSTANCE);
}
项目:spring-boot-concourse    文件:GroovyCompiler.java   
/**
 * Create a new {@link GroovyCompiler} instance.
 * @param configuration the compiler configuration
 */
public GroovyCompiler(final GroovyCompilerConfiguration configuration) {

    this.configuration = configuration;
    this.loader = createLoader(configuration);

    DependencyResolutionContext resolutionContext = new DependencyResolutionContext();

    AetherGrapeEngine grapeEngine = AetherGrapeEngineFactory.create(this.loader,
            configuration.getRepositoryConfiguration(), resolutionContext);

    GrapeEngineInstaller.install(grapeEngine);

    this.loader.getConfiguration()
            .addCompilationCustomizers(new CompilerAutoConfigureCustomizer());
    if (configuration.isAutoconfigure()) {
        this.compilerAutoConfigurations = ServiceLoader
                .load(CompilerAutoConfiguration.class);
    }
    else {
        this.compilerAutoConfigurations = Collections.emptySet();
    }

    this.transformations = new ArrayList<ASTTransformation>();
    this.transformations
            .add(new DependencyManagementBomTransformation(resolutionContext));
    this.transformations.add(new DependencyAutoConfigurationTransformation(
            this.loader, resolutionContext, this.compilerAutoConfigurations));
    this.transformations.add(new GroovyBeansTransformation());
    if (this.configuration.isGuessDependencies()) {
        this.transformations.add(
                new ResolveDependencyCoordinatesTransformation(resolutionContext));
    }
    for (ASTTransformation transformation : ServiceLoader
            .load(SpringBootAstTransformation.class)) {
        this.transformations.add(transformation);
    }
    Collections.sort(this.transformations, AnnotationAwareOrderComparator.INSTANCE);
}
项目:contestparser    文件:GroovyCompiler.java   
/**
 * Create a new {@link GroovyCompiler} instance.
 * @param configuration the compiler configuration
 */
public GroovyCompiler(final GroovyCompilerConfiguration configuration) {

    this.configuration = configuration;
    this.loader = createLoader(configuration);

    DependencyResolutionContext resolutionContext = new DependencyResolutionContext();

    AetherGrapeEngine grapeEngine = AetherGrapeEngineFactory.create(this.loader,
            configuration.getRepositoryConfiguration(), resolutionContext);

    GrapeEngineInstaller.install(grapeEngine);

    this.loader.getConfiguration()
            .addCompilationCustomizers(new CompilerAutoConfigureCustomizer());
    if (configuration.isAutoconfigure()) {
        this.compilerAutoConfigurations = ServiceLoader
                .load(CompilerAutoConfiguration.class);
    }
    else {
        this.compilerAutoConfigurations = Collections.emptySet();
    }

    this.transformations = new ArrayList<ASTTransformation>();
    this.transformations
            .add(new DependencyManagementBomTransformation(resolutionContext));
    this.transformations.add(new DependencyAutoConfigurationTransformation(
            this.loader, resolutionContext, this.compilerAutoConfigurations));
    this.transformations.add(new GroovyBeansTransformation());
    if (this.configuration.isGuessDependencies()) {
        this.transformations.add(
                new ResolveDependencyCoordinatesTransformation(resolutionContext));
    }
    for (ASTTransformation transformation : ServiceLoader
            .load(SpringBootAstTransformation.class)) {
        this.transformations.add(transformation);
    }
    Collections.sort(this.transformations, AnnotationAwareOrderComparator.INSTANCE);
}