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

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

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

Project.artifacts介绍

暂无

代码示例

代码示例来源:origin: com.ca.apim.gateway/gateway-developer-plugin

private static void configureGeneratedArtifacts(@NotNull Project project,
                        GatewayDeveloperPluginConfig pluginConfig,
                        BuildDeploymentBundleTask buildDeploymentBundleTask,
                        BuildEnvironmentBundleTask buildEnvironmentBundleTask,
                        BuildFullBundleTask buildFullBundleTask,
                        PackageTask packageGW7Task) {
  // add build-bundle to the default build task
  project.afterEvaluate(p -> project.getTasks().getByPath("build").dependsOn(buildDeploymentBundleTask, packageGW7Task));
  // add the deployment bundle to the default artifacts
  project.artifacts(artifactHandler -> addBundleArtifact(artifactHandler, packageGW7Task.getBundle(), buildDeploymentBundleTask, project::getName, "deployment"));
  // add the environment bundle to the artifacts only if the environment bundle task was triggered
  if (project.getGradle().getStartParameter().getTaskNames().contains(BUILD_ENVIRONMENT_BUNDLE)) {
    project.artifacts(artifactHandler -> addBundleArtifact(
      artifactHandler,
      pluginConfig.getBuiltBundleDir().file(new DefaultProvider<>(() -> getBuiltArtifactName(project, "-environment", BUNDLE_FILE_EXTENSION))),
      buildEnvironmentBundleTask,
      project::getName,
      "environment"));
  }
  // add the full bundle to the artifacts only if the full bundle task was triggered
  if (project.getGradle().getStartParameter().getTaskNames().contains(BUILD_FULL_BUNDLE)) {
    project.artifacts(artifactHandler -> addBundleArtifact(
        artifactHandler,
        pluginConfig.getBuiltBundleDir().file(new DefaultProvider<>(() -> getBuiltArtifactName(project, "-full", BUNDLE_FILE_EXTENSION))),
        buildFullBundleTask,
        project::getName,
        "full"));
  }
}

代码示例来源:origin: gradle.plugin.com.ca.apim.gateway/gateway-developer-plugin

project.artifacts(artifactHandler -> artifactHandler.add("archives", pluginConfig.getBuiltBundleDir(), configurablePublishArtifact -> {
  configurablePublishArtifact.builtBy(buildBundleTask);
  configurablePublishArtifact.setExtension(BUNDLE_FILE_EXTENSION);

相关文章