• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DefaultProject类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.gradle.api.internal.project.DefaultProject的典型用法代码示例。如果您正苦于以下问题:Java DefaultProject类的具体用法?Java DefaultProject怎么用?Java DefaultProject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

DefaultProject类属于org.gradle.api.internal.project包,在下文中一共展示了DefaultProject类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createChildProject

点赞 3

import org.gradle.api.internal.project.DefaultProject; //导入依赖的package包/类
public Project createChildProject(String name, Project parent, File projectDir) {
    ProjectInternal parentProject = (ProjectInternal) parent;
    DefaultProject project = CLASS_GENERATOR.newInstance(
            DefaultProject.class,
            name,
            parentProject,
            (projectDir != null) ? projectDir.getAbsoluteFile() : new File(parentProject.getProjectDir(), name),
            new StringScriptSource("test build file", null),
            parentProject.getGradle(),
            parentProject.getGradle().getServiceRegistryFactory(),
            parentProject.getClassLoaderScope().createChild("project-" + name),
            parentProject.getBaseClassLoaderScope()
    );
    parentProject.addChildProject(project);
    parentProject.getProjectRegistry().addProject(project);
    return project;
}
 

开发者ID:lxxlxx888,
项目名称:Reer,
代码行数:18,
代码来源:ProjectBuilderImpl.java

示例2: createChildProject

点赞 3

import org.gradle.api.internal.project.DefaultProject; //导入依赖的package包/类
public Project createChildProject(String name, Project parent, File projectDir) {
    ProjectInternal parentProject = (ProjectInternal) parent;
    DefaultProject project = CLASS_GENERATOR.newInstance(
            DefaultProject.class,
            name,
            parentProject,
            (projectDir != null) ? projectDir.getAbsoluteFile() : new File(parentProject.getProjectDir(), name),
            new StringScriptSource("test build file", null),
            parentProject.getGradle(),
            parentProject.getGradle().getServiceRegistryFactory(),
            parentProject.getClassLoaderScope().createChild(),
            parentProject.getBaseClassLoaderScope()
    );
    parentProject.addChildProject(project);
    parentProject.getProjectRegistry().addProject(project);
    return project;
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:18,
代码来源:ProjectBuilderImpl.java

示例3: createChildProject

点赞 3

import org.gradle.api.internal.project.DefaultProject; //导入依赖的package包/类
public Project createChildProject(String name, Project parent, File projectDir) {
    ProjectInternal parentProject = (ProjectInternal) parent;
    DefaultProject project = CLASS_GENERATOR.newInstance(
            DefaultProject.class,
            name,
            parentProject,
            (projectDir != null) ? projectDir.getAbsoluteFile() : new File(parentProject.getProjectDir(), name),
            new StringScriptSource("test build file", null),
            parentProject.getGradle(),
            parentProject.getGradle().getServiceRegistryFactory(),
            parentProject.getClassLoaderScope().createChild()
    );
    parentProject.addChildProject(project);
    parentProject.getProjectRegistry().addProject(project);
    return project;
}
 

开发者ID:Pushjet,
项目名称:Pushjet-Android,
代码行数:17,
代码来源:ProjectBuilderImpl.java

示例4: normal

点赞 2

import org.gradle.api.internal.project.DefaultProject; //导入依赖的package包/类
@Test
public void normal() throws Exception {
  Project project = ProjectBuilder.builder().withName("api").build();
  project.setGroup("org.curioswitch.test");

  project.getPluginManager().apply(DependencyManagementPlugin.class);
  DependencyManagementExtension dependencyManagement =
      project.getExtensions().getByType(DependencyManagementExtension.class);
  dependencyManagement.dependencies(
      handler -> {
        handler.dependency("io.grpc:grpc-core:5.0.0");
        handler.dependency("io.grpc:grpc-protobuf:5.0.0");
        handler.dependency("io.grpc:grpc-stub:5.0.0");
        handler.dependency("com.google.protobuf:protoc:6.0.0");
      });

  project.getPluginManager().apply("org.curioswitch.gradle-grpc-api-plugin");
  project.setProperty("archivesBaseName", "curio-test-api");

  ((DefaultProject) project).evaluate();

  Task task = project.getTasks().findByName("generateProto");
  assertThat(task).isInstanceOf(GenerateProtoTask.class).isNotNull();
  GenerateProtoTask generateProtoTask = (GenerateProtoTask) task;
  // 2 output dirs for java and grpc, but they are the same in our config.
  String outputDir = project.getBuildDir().getAbsolutePath() + "/generated/source/proto/main";
  assertThat(generateProtoTask.getAllOutputDirs().stream().map(File::getAbsolutePath))
      .containsExactly(outputDir, outputDir);
  assertThat(generateProtoTask.getGenerateDescriptorSet()).isTrue();
  assertThat(generateProtoTask.getDescriptorSetOptions().getIncludeSourceInfo()).isTrue();
  assertThat(generateProtoTask.getDescriptorSetOptions().getIncludeImports()).isTrue();
  assertThat(generateProtoTask.getDescriptorSetOptions().getPath().toString())
      .isEqualTo(
          project.getBuildDir()
              + "/resources/main/META-INF/armeria/grpc/org.curioswitch.test.curio-test-api.dsc");

  ProtobufConfigurator protobuf =
      project.getConvention().getPlugin(ProtobufConvention.class).getProtobuf();
  protobuf.protoc(
      LambdaClosure.of(
          (ExecutableLocator locator) ->
              assertThat(locator.getArtifact()).isEqualTo("com.google.protobuf:protoc:6.0.0")));
  protobuf.plugins(
      LambdaClosure.of(
          (NamedDomainObjectContainer<ExecutableLocator> locators) ->
              assertThat(locators.getByName("grpc").getArtifact())
                  .isEqualTo("io.grpc:protoc-gen-grpc-java:5.0.0")));
}
 

开发者ID:curioswitch,
项目名称:curiostack,
代码行数:49,
代码来源:GrpcApiPluginTest.java

示例5: setup

点赞 2

import org.gradle.api.internal.project.DefaultProject; //导入依赖的package包/类
@Before
public void setup() {
    project = (DefaultProject) ProjectBuilder.builder().withProjectDir(new File("build/tmp/" + getClass().getSimpleName())).build();
}
 

开发者ID:w25r,
项目名称:property-setter-gradle-plugin,
代码行数:5,
代码来源:PropertySetterPluginTest.java

示例6: shouldApplyPlugin

点赞 2

import org.gradle.api.internal.project.DefaultProject; //导入依赖的package包/类
@Test
public void shouldApplyPlugin() {
    DefaultProject project = (DefaultProject) ProjectBuilder.builder().withProjectDir(new File("build/tmp/" + getClass().getSimpleName())).build();
    project.getPlugins().apply("sources");
}
 

开发者ID:w25r,
项目名称:sources-gradle-plugin,
代码行数:6,
代码来源:SourcesPluginTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)