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

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

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

Project.getChildProjects介绍

暂无

代码示例

代码示例来源:origin: org.gradle/gradle-core

private void setProjectProperties(Project project, CachingPropertyApplicator applicator) {
  addPropertiesToProject(project, applicator);
  for (Project childProject : project.getChildProjects().values()) {
    setProjectProperties(childProject, applicator);
  }
}

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

/** A TreeDef for projects. */
  public static TreeDef.Parented<Project> treeDef() {
    return TreeDef.Parented.of(p -> ImmutableList.copyOf(p.getChildProjects().values()), Project::getParent);
  }
}

代码示例来源:origin: gradle.plugin.com.iperlane.gradle/android-jar

@Override
public void apply(Project project) {
  for (Project child : project.getChildProjects().values()) {
    this.apply(child);
  }
  project.afterEvaluate(new Action<Project>() {
    @Override
    public void execute(Project project) {
      BaseExtension android = null;
      if (project.getPlugins().hasPlugin(LibraryPlugin.class)) {
        android = project.getExtensions().getByType(LibraryExtension.class);
      } else if (project.getPlugins().hasPlugin(AppPlugin.class)) {
        android = project.getExtensions().getByType(AppExtension.class);
      } else if (project.getPlugins().hasPlugin(TestPlugin.class)) {
        android = project.getExtensions().getByType(TestExtension.class);
      }
      if (android != null) {
        System.err.println("Hacking project " + project.getName());
        useHackedAndroidJar(android);
        android.registerTransform(new ReflectionAccessorTransform());
        android.registerTransform(new IncludeWrapperTransform());
      } else {
        System.err.println("Skipping project " + project.getName());
      }
    }
  });
}

代码示例来源:origin: prezi/pride

private PrideProjectModel convertProject(Project project) {
    ImmutableSet.Builder<PrideProjectModel> childModels = ImmutableSet.builder();
    for (Project childProject : project.getChildProjects().values()) {
      childModels.add(convertProject(childProject));
    }
    if (project.getGroup() == null || String.valueOf(project.getGroup()).isEmpty()) {
      throw new IllegalStateException("Group is not specified for project in " + project.getProjectDir());
    }

    return new DefaultPrideProjectModel(
        project.getPath(),
        String.valueOf(project.getGroup()),
        project.getName(),
        String.valueOf(project.getVersion()),
        childModels.build(),
        project.getProjectDir().getAbsolutePath()
    );
  }
}

代码示例来源:origin: org.gradle/gradle-core

public ProjectInternal findProject(String projectPath, ProjectInternal startFrom) {
  if (projectPath.equals(Project.PATH_SEPARATOR)) {
    return startFrom.getRootProject();
  }
  Project current = startFrom;
  if (projectPath.startsWith(Project.PATH_SEPARATOR)) {
    current = current.getRootProject();
    projectPath = projectPath.substring(1);
  }
  for (String pattern : projectPath.split(Project.PATH_SEPARATOR)) {
    Map<String, Project> children = current.getChildProjects();
    NameMatcher matcher = new NameMatcher();
    Project child = matcher.find(pattern, children);
    if (child != null) {
      current = child;
      continue;
    }
    throw new ProjectLookupException(matcher.formatErrorMessage("project", current));
  }
  return (ProjectInternal) current;
}

代码示例来源:origin: org.sonarsource.scanner.gradle/sonarqube-gradle-plugin

List<Project> enabledChildProjects = project.getChildProjects().values().stream()
 .filter(p -> !p.getExtensions().getByType(SonarQubeExtension.class).isSkipProject())
 .collect(Collectors.toList());
List<Project> skippedChildProjects = project.getChildProjects().values().stream()
 .filter(p -> p.getExtensions().getByType(SonarQubeExtension.class).isSkipProject())
 .collect(Collectors.toList());

代码示例来源:origin: org.gradle/gradle-core

private LoadProjectsBuildOperationType.Result.Project convert(org.gradle.api.Project project) {
  return new BuildStructureOperationProject(
    project.getName(),
    project.getPath(),
    ((ProjectInternal) project).getIdentityPath().toString(),
    project.getProjectDir().getAbsolutePath(),
    project.getBuildFile().getAbsolutePath(),
    convert(project.getChildProjects().values()));
}

代码示例来源:origin: SonarSource/sonar-scanner-gradle

List<Project> enabledChildProjects = project.getChildProjects().values().stream()
 .filter(p -> !p.getExtensions().getByType(SonarQubeExtension.class).isSkipProject())
 .collect(Collectors.toList());
List<Project> skippedChildProjects = project.getChildProjects().values().stream()
 .filter(p -> p.getExtensions().getByType(SonarQubeExtension.class).isSkipProject())
 .collect(Collectors.toList());

代码示例来源:origin: com.palantir.gradle.conjure/gradle-conjure

}, Function.identity()));
  project.getChildProjects().entrySet().stream()
      .filter(e -> !FIRST_CLASS_GENERATOR_PROJECT_NAMES.contains(e.getKey()))
      .forEach(entry -> {
});
project.getChildProjects().entrySet().stream()
    .filter(e -> !FIRST_CLASS_GENERATOR_PROJECT_NAMES.contains(e.getKey()))
    .forEach(e -> {

相关文章