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

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

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

Project.copySpec介绍

暂无

代码示例

代码示例来源:origin: MinecraftForge/ForgeGradle

@SuppressWarnings({ "serial", "unused" })
private static CopySpec configureDistSpec(Project project)
{
  CopySpec distSpec = project.copySpec(new Closure<Object>(Launch4jPlugin.class) {});
  Jar jar = (Jar) project.getTasks().getByName(JavaPlugin.JAR_TASK_NAME);
  distSpec.from(jar);
  distSpec.from(project.getConfigurations().getByName("runtime"));
  return distSpec;
}

代码示例来源:origin: org.shipkit/shipkit

@Override
  public void apply(final Project project) {
    project.getPlugins().apply("java");

    final CopySpec license = project.copySpec(copy -> copy.from(project.getRootDir()).include("LICENSE"));

    ((Jar) project.getTasks().getByName("jar")).with(license);

    final Jar sourcesJar = project.getTasks().create(SOURCES_JAR_TASK, Jar.class, jar -> {
      jar.from(JavaPluginUtil.getMainSourceSet(project).getAllSource());
      jar.setClassifier("sources");
      jar.with(license);
    });

    final Task javadocJar = project.getTasks().create(JAVADOC_JAR_TASK, Jar.class, jar -> {
      jar.from(project.getTasks().getByName("javadoc"));
      jar.setClassifier("javadoc");
      jar.with(license);
    });

    project.getArtifacts().add("archives", sourcesJar);
    project.getArtifacts().add("archives", javadocJar);
  }
}

代码示例来源:origin: mockito/shipkit

@Override
  public void apply(final Project project) {
    project.getPlugins().apply("java");

    final CopySpec license = project.copySpec(copy -> copy.from(project.getRootDir()).include("LICENSE"));

    ((Jar) project.getTasks().getByName("jar")).with(license);

    final Jar sourcesJar = project.getTasks().create(SOURCES_JAR_TASK, Jar.class, jar -> {
      jar.from(JavaPluginUtil.getMainSourceSet(project).getAllSource());
      jar.setClassifier("sources");
      jar.with(license);
    });

    final Task javadocJar = project.getTasks().create(JAVADOC_JAR_TASK, Jar.class, jar -> {
      jar.from(project.getTasks().getByName("javadoc"));
      jar.setClassifier("javadoc");
      jar.with(license);
    });

    project.getArtifacts().add("archives", sourcesJar);
    project.getArtifacts().add("archives", javadocJar);
  }
}

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

project.getPlugins().apply("maven-publish");
final CopySpec license = project.copySpec(new Action<CopySpec>() {
  public void execute(CopySpec copy) {
  copy.from(project.getRootDir()).include("LICENSE");

代码示例来源:origin: steffenschaefer/gwt-gradle-plugin

public ExplodedWar() {
  root = getProject().copySpec(new ActionClosure<CopySpec>(this, new Action<CopySpec>() {
    @Override
    public void execute(CopySpec spec) {

相关文章