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

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

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

Project.subprojects介绍

暂无

代码示例

代码示例来源:origin: gradle.plugin.org.amdatu.blueprint/org.amdatu.blueprint.gradle

private void createRunAllTask(Project project, String taskName, Class<? extends Task> taskClass) {
  project.subprojects(subProject -> {
    TaskCollection<?> tasks = subProject.getTasks().withType(taskClass);
    if (!tasks.isEmpty()) {
      Task runAllTask = project.getTasks().findByName(taskName);
      if (runAllTask == null) {
        runAllTask = project.getTasks().create(taskName);
      }
      runAllTask.dependsOn(tasks.toArray());
    }
  });
}

代码示例来源:origin: com.netflix.nebula/nebula-dependency-recommender

@Override
  public void execute(Project p) {
    p.getConfigurations().all(new ExtendRecommenderConfigurationAction(bomConfiguration, p, recommendationProviderContainer));
    p.subprojects(new Action<Project>() {
      @Override
      public void execute(Project sub) {
        sub.getConfigurations().all(new ExtendRecommenderConfigurationAction(bomConfiguration, sub, recommendationProviderContainer));
      }
    });
  }
});

代码示例来源:origin: gradle.plugin.edu.wpi.first/gradle-cpp-vscode

public void apply(Project project) {
 registry.register(new NativeToolingModelBuilder());
 project.subprojects(subproject -> {
  subproject.apply(config -> {
   config.plugin(GradleVsCode.class);

代码示例来源:origin: gradle.plugin.org.amdatu.blueprint/org.amdatu.blueprint.gradle

@Override
public void apply(Object receiver) {
  if (receiver instanceof Settings) {
    Settings settings = ((Settings) receiver);
    settings.getGradle().projectsEvaluated(action -> {
      settings.getGradle().getRootProject().apply(a -> a.plugin(AmdatuBlueprintPlugin.class));
    });
  } else if (receiver instanceof Project) {
    Project project = (Project) receiver;
    Workspace bndWorkspace = (Workspace) project.getProperties().get("bndWorkspace");
    if (bndWorkspace == null) {
      throw new GradleException("Bnd workspace not available!");
    }
    project.subprojects(subProject -> subProject
        .fileTree(subProject.getProjectDir(), files -> files.include("*.bndrun"))
        .forEach(bndrun -> addDockerTasks(bndWorkspace, subProject, bndrun)));
    createRunAllTask(project, "docker", DockerTask.class);
    createRunAllTask(project, "dockerPush", DockerPushTask.class);
  }
}

代码示例来源:origin: gradle.plugin.org.hibernate.build.gradle/hibernate-matrix-testing

project.subprojects(
    subproject -> {

相关文章