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

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

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

Project.copy介绍

暂无

代码示例

代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin

@TaskAction
public void action()
{
  getProject().copy( this::configureCopySpec );
}

代码示例来源:origin: gradle.plugin.com.enonic.gradle/xp-gradle-plugin

@TaskAction
public void action()
{
  getProject().copy( this::configureCopySpec );
}

代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin

@TaskAction
public void run()
{
  getProject().copy( this::doCopy );
}

代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin

@TaskAction
public void run()
{
  getProject().copy( this::doCopy );
}

代码示例来源:origin: gradle.plugin.com.enonic.gradle/xp-gradle-plugin

@TaskAction
public void run()
{
  getProject().copy( this::doCopy );
}

代码示例来源:origin: gradle.plugin.com.enonic.gradle/xp-gradle-plugin

@TaskAction
public void run()
{
  getProject().copy( this::copySpec );
}

代码示例来源:origin: gradle.plugin.com.enonic.gradle/xp-gradle-plugin

@TaskAction
public void run()
{
  getProject().copy( this::doCopy );
}

代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin

@TaskAction
public void run()
{
  getProject().copy( this::copySpec );
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-node

@Override
public void execute(Task task) {
  ProcessResources processResourcesTask =
    (ProcessResources)task;
  final File processResourcesDir =
    processResourcesTask.getDestinationDir();
  final File npmRunBuildOutputsDir = new File(
    sourceDigestFile.getParentFile(), "outputs");
  project.copy(
    new Action<CopySpec>() {
      @Override
      public void execute(CopySpec copySpec) {
        copySpec.from(npmRunBuildOutputsDir);
        copySpec.into(processResourcesDir);
      }
    });
}

代码示例来源:origin: com.liferay/com.liferay.gradle.plugins.node

@Override
public void execute(Task task) {
  ProcessResources processResourcesTask =
    (ProcessResources)task;
  final File processResourcesDir =
    processResourcesTask.getDestinationDir();
  final File npmRunBuildOutputsDir = new File(
    sourceDigestFile.getParentFile(), "outputs");
  project.copy(
    new Action<CopySpec>() {
      @Override
      public void execute(CopySpec copySpec) {
        copySpec.from(npmRunBuildOutputsDir);
        copySpec.into(processResourcesDir);
      }
    });
}

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

@TaskAction
protected void buildWarTemplate() {
  // TODO usage of ActionClosure can be removed when updating to Gradle 2.5+
  getProject().copy(new ActionClosure<CopySpec>(this, new Action<CopySpec>() {
    @Override
    public void execute(CopySpec spec) {
      spec.into(getDestinationDir());
      spec.with(root);
    }}));
}

代码示例来源:origin: com.liferay/com.liferay.gradle.plugins.node

@Override
public void execute(Task task) {
  ProcessResources processResourcesTask =
    (ProcessResources)task;
  final File processResourcesDir =
    processResourcesTask.getDestinationDir();
  final File npmRunBuildOutputsDir = new File(
    sourceDigestFile.getParentFile(), "outputs");
  project.delete(npmRunBuildOutputsDir);
  npmRunBuildOutputsDir.mkdirs();
  project.copy(
    new Action<CopySpec>() {
      @Override
      public void execute(CopySpec copySpec) {
        copySpec.from(processResourcesDir);
        copySpec.include("**/*.js");
        copySpec.into(npmRunBuildOutputsDir);
        copySpec.setIncludeEmptyDirs(false);
      }
    });
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-node

@Override
public void execute(Task task) {
  ProcessResources processResourcesTask =
    (ProcessResources)task;
  final File processResourcesDir =
    processResourcesTask.getDestinationDir();
  final File npmRunBuildOutputsDir = new File(
    sourceDigestFile.getParentFile(), "outputs");
  project.delete(npmRunBuildOutputsDir);
  npmRunBuildOutputsDir.mkdirs();
  project.copy(
    new Action<CopySpec>() {
      @Override
      public void execute(CopySpec copySpec) {
        copySpec.from(processResourcesDir);
        copySpec.include("**/*.js");
        copySpec.into(npmRunBuildOutputsDir);
        copySpec.setIncludeEmptyDirs(false);
      }
    });
}

代码示例来源:origin: gradle.plugin.com.enonic.gradle/xp-gradle-plugin

@TaskAction
public void action()
{
  getProject().delete( getInstallDir() );
  getProject().copy( this::configureCopySpec );
}

代码示例来源:origin: gradle.plugin.com.enonic.xp/xp-gradle-plugin

@TaskAction
public void action()
{
  getProject().delete( getInstallDir() );
  getProject().copy( this::configureCopySpec );
}

代码示例来源:origin: typelead/gradle-eta

private void copyFreezeConfigIfChanged(File workingDir) {

    if (isFreezeConfigChanged()) {
      /* Copy the project-global freeze file into the working directory. */

      File tmpFreezeConfig = null;

      try {
        tmpFreezeConfig = freezeConfigFile
          .filter(file -> file.getName().endsWith(".freeze")).getSingleFile();
      } catch (IllegalStateException e) {
        throw new GradleException
          ("The freezeConfig file collection contains more than one element!", e);
      }

      final File freezeConfig = tmpFreezeConfig;

      project.copy(copySpec -> {
          copySpec.from(freezeConfig);
          copySpec.into(workingDir);
        });
    }
  }
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-js-module-config-generator

@Override
public void executeNode() throws Exception {
  Project project = getProject();
  final File outputDir = getOutputDir();
  project.delete(getOutputFile(), outputDir);
  project.copy(
    new Action<CopySpec>() {
      @Override
      public void execute(CopySpec copySpec) {
        copySpec.from(getSourceFiles());
        copySpec.into(outputDir);
      }
    });
  super.executeNode();
  project.copy(
    new Action<CopySpec>() {
      @Override
      public void execute(CopySpec copySpec) {
        copySpec.from(outputDir);
        copySpec.into(getSourceDir());
      }
    });
}

代码示例来源:origin: gradle.plugin.com.liferay/gradle-plugins-js-transpiler

@Override
public void executeNode() throws Exception {
  final File sourceDir = getSourceDir();
  final File workingDir = getWorkingDir();
  if (!sourceDir.equals(workingDir)) {
    Project project = getProject();
    project.copy(
      new Action<CopySpec>() {
        @Override
        public void execute(CopySpec copySpec) {
          copySpec.from(sourceDir);
          copySpec.include(getSoySrcIncludes());
          copySpec.include(getSrcIncludes());
          copySpec.into(workingDir);
          copySpec.setIncludeEmptyDirs(false);
        }
      });
  }
  super.executeNode();
}

代码示例来源:origin: gradle.plugin.com.github.rmee/jpa-schema-gen

private void copyResource(String name, boolean optional) {
  SourceSet sourceSet = getMainSourceSet();
  SourceDirectorySet resources = sourceSet.getResources();
  File outputDir = sourceSet.getOutput().getResourcesDir();
  File outputResourceFile = new File(outputDir, name);
  File inputResourceFile = getInputResource(resources, name);
  if (optional && inputResourceFile == null) {
    throw new IllegalStateException("no " + name + " found in " + resources.getSrcDirs());
  }
  else if (inputResourceFile != null && hasChanged(inputResourceFile, outputResourceFile)) {
    outputResourceFile.getParentFile().mkdirs();
    Project project = getProject();
    project.copy(copySpec -> {
      copySpec.from(inputResourceFile);
      copySpec.into(outputResourceFile.getParentFile());
    });
  }
}

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

public void filterCopy(Closure<CopySpec> config) {
  doLast(
      task -> {
        final Profile profile = profileResolver.getSelectedProfile();
        if ( profile == null ) {
          // do nothing
          return;
        }
        getProject().copy(
            copySpec -> {
              ConfigureUtil.configure( config, copySpec );
              copySpec.filter(
                  Collections.singletonMap( "tokens", profile.getHibernateProperties() ),
                  ReplaceTokens.class
              );
            }
        );
      }
  );
}

相关文章