org.gradle.api.Project.afterEvaluate()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(540)

本文整理了Java中org.gradle.api.Project.afterEvaluate()方法的一些代码示例,展示了Project.afterEvaluate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.afterEvaluate()方法的具体详情如下:
包路径:org.gradle.api.Project
类名称:Project
方法名:afterEvaluate

Project.afterEvaluate介绍

暂无

代码示例

代码示例来源:origin: uber/okbuck

public ExternalDependenciesExtension(Project project) {
 project.afterEvaluate(
   evaluatedProject -> {
    validateExtension();
   });
}

代码示例来源:origin: uber/okbuck

RuleOverridesExtension(Project project) {
 project.afterEvaluate(
   evaluatedProject -> {
    validateExtension();
    preProcessExtension();
   });
}

代码示例来源:origin: meituan/WMRouter

@Override
  public void apply(Project project) {
    WMRouterExtension extension = project.getExtensions()
        .create(Const.NAME, WMRouterExtension.class);

    WMRouterLogger.info("register transform");
    project.getExtensions().findByType(BaseExtension.class)
        .registerTransform(new WMRouterTransform());

    project.afterEvaluate(p -> WMRouterLogger.setConfig(extension));
  }
}

代码示例来源:origin: hibernate/hibernate-orm

public void apply(Project project) {
  project.getPlugins().apply( "java" );
  final HibernateExtension hibernateExtension = new HibernateExtension( project );
  project.getLogger().debug( "Adding Hibernate extensions to the build [{}]", project.getName() );
  project.getExtensions().add( "hibernate", hibernateExtension );
  project.afterEvaluate(
      new Action<Project>() {
        @Override
        public void execute(Project project) {
          if ( hibernateExtension.enhance != null ) {
            applyEnhancement( project, hibernateExtension );
          }
        }
      }
  );
}

代码示例来源:origin: uber/okbuck

rootProject.getConfigurations().maybeCreate(FORCED_OKBUCK);
rootProject.afterEvaluate(
  rootBuckProject -> {

代码示例来源:origin: diffplug/spotless

@Override
public void apply(Project project) {
  // make sure there's a `clean` task
  project.getPlugins().apply(BasePlugin.class);
  // setup the extension
  spotlessExtension = project.getExtensions().create(EXTENSION, SpotlessExtension.class, project);
  // after the project has been evaluated, configure the check and format tasks per source set
  project.afterEvaluate(this::createTasks);
}

代码示例来源:origin: com.google.cloud.tools/appengine-gradle-plugin

private void configureCloudSdkBuilderFactory() {
 project.afterEvaluate(
   new Action<Project>() {
    @Override
    public void execute(Project project) {
     // create the sdk builder factory after we know the location of the sdk
     cloudSdkBuilderFactory = new CloudSdkBuilderFactory(toolsExtension.getCloudSdkHome());
    }
   });
}

代码示例来源:origin: gradle.plugin.com.github.mazzeb/auto-version

@Override
public void apply(Project project) {
  logger.debug("plugin apply");
  project.afterEvaluate(this::afterEvaluate);
  TaskContainer taskContainer = project.getTasks();
  autoVersionConfig = project.getExtensions().create("autoversion", AutoVersionConfig.class);
  taskContainer.create("nextMajor", this::configureNextMajor);
  taskContainer.create("nextMinor", this::configureNextMinor);
  taskContainer.create("nextPatch", this::configureNextPatch);
}

代码示例来源:origin: gradle.plugin.com.github.honourednihilist/gradle-kafka-deserializers

@Override
  public void apply(Project project) {
    project.getExtensions().create(KafkaDeserializersExtension.NAME, KafkaDeserializersExtension.class);
    GenerateThriftKafkaDeserializersTask task = project.getTasks().create(GenerateThriftKafkaDeserializersTask.NAME, GenerateThriftKafkaDeserializersTask.class);

    project.afterEvaluate(pro -> task.updateProperties());
  }
}

代码示例来源:origin: gradle.plugin.ca.coglinc2/javacc-gradle-plugin

private void configureTaskDependencies(Project project) {
    JavaToJavaccDependencyAction compileJavaDependsOnCompileJavacc = new JavaToJavaccDependencyAction();
    project.afterEvaluate(compileJavaDependsOnCompileJavacc);
  }
}

代码示例来源:origin: diffplug/goomph

/** Applies the EclipsePlugin and provides the eclipse model for modification. */
  public static void modifyEclipseProject(Project project, Consumer<EclipseModel> modifier) {
    // make sure the eclipse plugin has been applied
    ProjectPlugin.getPlugin(project, EclipsePlugin.class);

    // exclude the build folder
    project.afterEvaluate(p -> {
      EclipseModel eclipseModel = p.getExtensions().getByType(EclipseModel.class);
      modifier.accept(eclipseModel);
    });
  }
}

代码示例来源:origin: gradle.plugin.de.lukaskoerfer.gradle/debugging

/**
 * Creates a new debug task
 */
public Debug() {
  getProject().afterEvaluate(project -> finalizedBy(target));
}

代码示例来源:origin: dodie/scott

@Override
public void apply(Project project) {
  ScottPluginExtension extension = project.getExtensions().create(PLUGIN_EXTENSION_NAME, ScottPluginExtension.class, DEFAULT_SCOTT_VERSION);
  Configuration configuration = configureAgentDependencies(project,extension);
  project.afterEvaluate( p -> {
    Task test = p.getTasks().getByName("test");
    JavaForkOptions opts = (JavaForkOptions)test;
    opts.getJvmArgumentProviders().add(new ScottAgent(configuration,extension));
  });
}

代码示例来源:origin: wildfly-swarm-archive/ARCHIVE-wildfly-swarm

@Override
  public void apply(Project project) {
    project.getExtensions().create("swarm", SwarmExtension.class);
    project.afterEvaluate(__ -> {
      final TaskContainer tasks = project.getTasks();
      final PackageTask packageTask = tasks.create("wildfly-swarm-package", PackageTask.class);
      tasks.withType(Jar.class, task -> packageTask.jarTask(task).dependsOn(task));
      tasks.getByName("build").dependsOn(packageTask);
    });
  }
}

代码示例来源:origin: gradle.plugin.com.github.kaklakariada.aws/aws-sam-gradle

@Override
public void apply(Project project) {
  this.project = project;
  this.log = project.getLogger();
  this.config = createConfigDsl();
  log.info("Initialize AwsSam plugin...");
  project.afterEvaluate(p -> createTasks());
}

代码示例来源:origin: diffplug/goomph

@Override
public final void apply(Project project) {
  // ensure we don't double-apply the plugin
  if (project.getPlugins().hasPlugin(this.getClass())) {
    return;
  }
  project.afterEvaluate(GoomphCacheLocations::initFromProject);
  // apply the plugin once
  applyOnce(project);
}

代码示例来源:origin: gradle.plugin.io.forgo.plugins.gradle/keystore-gradle-plugin

private void addSSLCertTask(Project project, KeystoreExtension extension) {
  project.getTasks().create(TASK_SSL_CERT, SSLCertTask.class, task -> {
    project.afterEvaluate(p -> {
      task.setOutputDir(extension.getOutputDir());
      task.setKeyFile(extension.getKeyFile());
      task.setKeyPassword(extension.getKeyPassword());
      task.setCertFile(extension.getCertFile());
    });
    task.dependsOn(project.getTasks().getByName(TASK_SSL_KEY));
  });
}

代码示例来源:origin: gradle.plugin.com.enonic.gradle/xp-gradle-plugin

@Override
public void apply( final Project project )
{
  this.project = project;
  this.project.getPlugins().apply( BasePlugin.class );
  this.ext = XpExtension.get( this.project );
  createInstallTask();
  createRunTask();
  createDeployAllTask();
  addConfigurations();
  this.project.afterEvaluate( this::configureDependencies );
}

代码示例来源:origin: gradle.plugin.com.digitalascent/digitalascent-gradle-project

private void configureNebulaResolutionRules(Project project) {
    Configuration resolutionRulesConfiguration = project.getRootProject().getConfigurations().getAt("resolutionRules");
    resolutionRulesConfiguration.getDependencies().add(project.getDependencies().create("com.netflix.nebula:gradle-resolution-rules:0.52.0"));

    NebulaResolutionRulesExtension resolutionRulesExtension = (NebulaResolutionRulesExtension) project.getExtensions().getByName("nebulaResolutionRules");
    resolutionRulesExtension.getOptional().add("slf4j-bridge");
    project.afterEvaluate((o) -> {
      project.getLogger().lifecycle("Optional resolution rules: {}", resolutionRulesExtension.getOptional());
      resolutionRulesConfiguration.getDependencies().forEach(dependency -> project.getLogger().lifecycle("Resolution rules dependency: {}", dependency));
    });
  }
}

代码示例来源:origin: gradle.plugin.com.jonaslasauskas.capsule/gradle-capsule-plugin

void executesInside(Project project) {
 this.setBaseName(project.getName());
 
 project.afterEvaluate(p -> {
  mergeContentOf(p.getConfigurations().getAt("capsule"), p);
  
  from(p.getTasks().getAt("jar").getOutputs().getFiles());
  from(p.getConfigurations().getAt(RUNTIME_CONFIGURATION_NAME));
  
  defaultAttributesUsingDetailsFrom(p);
  capsuleManifest.writeTo(getManifest());
 });
}

相关文章