gpt4 book ai didi

org.gradle.api.tasks.bundling.Zip类的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 04:54:49 26 4
gpt4 key购买 nike

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

Zip介绍

[英]Assembles a ZIP archive. The default is to compress the contents of the zip.
[中]组装一个ZIP档案。默认情况下,压缩zip文件的内容。

代码示例

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

private void createZipDocTask()
{
  final Zip task = this.project.getTasks().create( ZIP_DOC_TASK, Zip.class );
  task.from( new File( getDocsOutputDir(), "html5" ) );
  task.setClassifier( "doc" );
  task.setGroup( GROUP );
  task.setDescription( "Create a zip archive of the documentation." );
  task.dependsOn( BUILD_DOC_TASK );
}

代码示例来源:origin: com.amazon.device.tools.build/gradle-core

@Nullable
@Override
public File getOutputFile() {
  return packageLibTask == null ? null : packageLibTask.getArchivePath();
}

代码示例来源:origin: gradle.plugin.com.banderous.getpack/plugin

@Override
  public void execute(Zip zip) {
   zip.dependsOn("launchUnity");
   zip.from(files);
   zip.setIncludeEmptyDirs(false);
   zip.into("Assets");
   zip.setBaseName(pkg.getName());
   zip.setVersion(pkg.getVersion());
   zip.setDestinationDir(project.getBuildDir());
  }
});

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

@Override
protected CopyAction createCopyAction() {
  DocumentationRegistry documentationRegistry = getServices().get(DocumentationRegistry.class);
  return new ZipCopyAction(getArchivePath(), getCompressor(), documentationRegistry, metadataCharset, isPreserveFileTimestamps());
}

代码示例来源:origin: com.amazon.device.tools.build/gradle-core

bundle.dependsOn(libVariantData.generateAnnotationsTask);
bundle.dependsOn(packageRes.getName(), packageRenderscript, lintCopy, packageJniLibs,
    mergeProGuardFileTask);
TaskManager.optionalDependsOn(bundle, pcData.getClassGeneratingTasks());
TaskManager.optionalDependsOn(bundle, pcData.getLibraryGeneratingTasks());
bundle.setDescription("Assembles a bundle containing the library in " +
    variantConfig.getFullName() + ".");
bundle.setDestinationDir(new File(variantScope.getGlobalScope().getOutputsDir(), "aar"));
bundle.setArchiveName(project.getName() + "-" + variantConfig.getBaseName() + "."
    + BuilderConstants.EXT_LIB_ARCHIVE);
bundle.setExtension(BuilderConstants.EXT_LIB_ARCHIVE);
bundle.from(new File(
    variantScope.getGlobalScope().getIntermediatesDir(),
    DIR_BUNDLES + "/" + dirName));
bundle.from(new File(
    variantScope.getGlobalScope().getIntermediatesDir(),
    ANNOTATIONS + "/" + dirName));
  project.getArtifacts().add(
      variantData.getVariantDependency().getPublishConfiguration().getName(), bundle);
  bundle.setClassifier(
      variantData.getVariantDependency().getPublishConfiguration().getName());
    bundle.getArchivePath(),
    new File(variantScope.getGlobalScope().getIntermediatesDir(),
        DIR_BUNDLES + "/" + dirName),

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

installer.from(outputJar);
installer.from(delayedTree(JAR_INSTALLER), new CopyInto(PatcherPlugin.class, "", "!*.json", "!*.png"));
installer.from(delayedTree(JSON_INSTALLER));
installer.setBaseName(project.getName());
installer.setClassifier("installer");
installer.setExtension("jar");
installer.setDestinationDir(new File(DIR_OUTPUT));
installer.setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE);
installer.getOutputs().upToDateWhen(Constants.CALL_FALSE); // rebuild every time.
installer.dependsOn(dlInstaller, outputJar, procJson);
combineRes.setDestinationDir(out.getParentFile());
combineRes.setArchiveName(out.getName());
combineRes.setIncludeEmptyDirs(false);
combineRes.setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE);
packagePatches.setDestinationDir(out.getParentFile());
packagePatches.setArchiveName(out.getName());
packagePatches.from(delayedFile(DIR_USERDEV_PATCHES));
packagePatches.dependsOn(userdevPatches);
userdev.from(delayedFile(DIR_USERDEV));
userdev.from(getExtension().getDelayedVersionJson()); // cant forge that now can we..
userdev.rename(".+-dev\\.json", "dev.json");
userdev.setBaseName(project.getName());
userdev.setClassifier("userdev");
userdev.setExtension("jar");
userdev.setDestinationDir(new File(DIR_OUTPUT));
userdev.setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE);

代码示例来源:origin: gradle.plugin.mpern.sap.commerce/commerce-gradle-plugin

z.from(packageFolder);
  z.into(packageName);
  z.setBaseName(packageName);
  z.setDestinationDir(extension.getDistributionFolder().getAsFile().get());
});
zipPackage.dependsOn(writeProps);
  args.put("file", zipPackage.getArchivePath());
  args.put("format", "MD5SUM");
  args.put("fileext", ".MD5");
  p.getAnt().invokeMethod("checksum", args);
  Path resolve = zipPackage.getDestinationDir().toPath().resolve(zipPackage.getArchiveName() + ".MD5");
  Path target = zipPackage.getDestinationDir().toPath().resolve(zipPackage.getBaseName() + ".md5");
  try {
    Files.delete(target);

代码示例来源:origin: gradle.plugin.de.uni-passau.fim.prog1pa/GradlePlugin

Zip solutionZip = project.getTasks().create("solutionZip", Zip.class);
solutionZip.setGroup("exercise");
solutionZip.setDescription("Produces an archive containing files that must be turned in as the solution for "
              + "this exercise.");
    solutionZip.setBaseName((String) archiveName);
solutionZip.from(project.getRootDir());
solutionZip.include("gradle/**");
solutionZip.include("src/main/java/**/*.java");
solutionZip.include("src/main/resources/**");
solutionZip.include("src/test/java/**/*.java");
solutionZip.include("src/test/resources/**");
solutionZip.include("build.gradle");
solutionZip.include("gradlew");
solutionZip.include("gradlew.bat");
solutionZip.include("settings.gradle");

代码示例来源:origin: gradle.plugin.com.github.kaklakariada.aws/aws-sam-gradle

private Zip createBuildZipTask() {
  final Zip task = createTask("buildLambdaZip", Zip.class);
  task.setDescription("Build lambda zip");
  task.setGroup(TASK_GROUP);
  task.getArchiveBaseName().set(project.getName());
  task.into("lib", closure(task, CopySpec.class,
      delegate -> delegate.from(project.getConfigurations().getByName("runtime"))));
  task.into("lib", closure(task, CopySpec.class,
      delegate -> delegate.from(project.getConfigurations().getByName("runtimeClasspath"))));
  task.into("", closure(task, CopySpec.class, delegate -> delegate
      .from(project.getTasks().getByName("compileJava"), project.getTasks().getByName("processResources"))));
  return task;
}

代码示例来源:origin: com.amazon.device.tools.build/gradle-core

@Override
public void setOutputFile(@NonNull File file) {
  packageLibTask.setDestinationDir(file.getParentFile());
  packageLibTask.setArchiveName(file.getName());
}

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

resourceZip.from(patcher.getDelayedResourcesDir());
  outputJar.from(patcher.getDelayedResourcesDir());
((Zip)project.getTasks().getByName(TASK_BUILD_USERDEV)).setVersion(project.getVersion().toString());
((Zip)project.getTasks().getByName(TASK_BUILD_INSTALLER)).setVersion(project.getVersion().toString());

代码示例来源:origin: gradle.plugin.mpern.sap.commerce/commerce-gradle-plugin

private void setupSolrPackaging(Project p, PackagingExtension extension, Path packageFolder, Zip zipPackage, Task cleanTargetFolder) {
  // FIXME This is only POC for Solr configuration only.
  Set<String> environments = extension.getEnvironments().get();
  Path configurationFolder = extension.getConfigurationFolder().getAsFile().get().toPath();
  for (String environment : environments) {
    Path sourceFolder = configurationFolder.resolve(environment).resolve("solr");
    Path commonFolder = configurationFolder.resolve(COMMON_CONFIG).resolve("solr");
    Path targetFolder = packageFolder.resolve("solr/config/" + environment);
    Copy copySolrCommonConfig = p.getTasks().create("copySolrCommonEnv_" + environment, Copy.class, t -> {
      t.from(commonFolder);
      t.into(targetFolder);
      t.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE);
      t.exclude(SOLR_CONFIG_EXCLUDE);
    });
    copySolrCommonConfig.dependsOn(cleanTargetFolder);
    Copy copySolrConfig = p.getTasks().create("copySolrEnv_" + environment, Copy.class, t -> {
      t.from(sourceFolder);
      t.into(targetFolder);
      t.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE);
      t.exclude(SOLR_CONFIG_EXCLUDE);
    });
    copySolrConfig.dependsOn(copySolrCommonConfig);
    zipPackage.dependsOn(copySolrConfig);
  }
}

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

public Zip() {
  setExtension(ZIP_EXTENSION);
  allowZip64 = false;
}

代码示例来源:origin: gradle.plugin.com.twcable.gradle/gradle-plugin-cq-package

public void setArchiveName(String name) {
  this.customName = name; // capture for validation purposes
  super.setArchiveName(name);
}

代码示例来源:origin: com.android.tools.build/gradle-core

extractAnnotationsTask.dependsOn(tasks, libVariantData.getScope().getJavacTask());
  if (!generateSourcesOnly) {
    bundle.dependsOn(extractAnnotationsTask.getName());
bundle.dependsOn(
    packageRes.getName(),
    packageRenderscriptTask.getName(),
    variantData.getMainOutput().getScope().getManifestProcessorTask().getName());
if (!generateSourcesOnly) {
  bundle.dependsOn(variantScope.getNdkBuildable());
bundle.setDescription("Assembles a bundle containing the library in " +
    variantConfig.getFullName() + ".");
bundle.setDestinationDir(variantScope.getOutputBundleFile().getParentFile());
bundle.setArchiveName(variantScope.getOutputBundleFile().getName());
bundle.setExtension(BuilderConstants.EXT_LIB_ARCHIVE);
bundle.from(variantBundleDir);
bundle.from(
    FileUtils.join(
        intermediatesDir,
  project.getArtifacts().add(
      variantData.getVariantDependency().getPublishConfiguration().getName(), bundle);
  bundle.setClassifier(
      variantData.getVariantDependency().getPublishConfiguration().getName());
    bundle.getArchivePath(),
    variantData.getName(),

代码示例来源:origin: com.android.tools.build/gradle-core

@Override
public void setOutputFile(@NonNull File file) {
  packageLibTask.setDestinationDir(file.getParentFile());
  packageLibTask.setArchiveName(file.getName());
}

代码示例来源:origin: gradle.plugin.mpern.sap.commerce/commerce-gradle-plugin

});
copyDataHubWar.dependsOn(cleanTargetFolder);
zipPackage.dependsOn(copyDataHubWar);
  mergeProperties.dependsOn(copyDatahubConfig);
  zipPackage.dependsOn(mergeProperties);

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

private void createZipDocTask()
{
  final Zip task = this.project.getTasks().create( ZIP_DOC_TASK, Zip.class );
  task.from( new File( getDocsOutputDir(), "html5" ) );
  task.setClassifier( "doc" );
  task.setGroup( GROUP );
  task.setDescription( "Create a zip archive of the documentation." );
  task.dependsOn( BUILD_DOC_TASK );
}

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

private void createPublish2DocTask()
{
  final Publish2DocTask task = this.project.getTasks().create( "publish2Doc", Publish2DocTask.class );
  task.setGroup( GROUP );
  task.setZipFile( ( (Zip) this.project.getTasks().getByName( ZIP_DOC_TASK ) ).getArchivePath() );
}

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

private void createPublish2DocTask()
{
  final Publish2DocTask task = this.project.getTasks().create( "publish2Doc", Publish2DocTask.class );
  task.setGroup( GROUP );
  task.setZipFile( ( (Zip) this.project.getTasks().getByName( ZIP_DOC_TASK ) ).getArchivePath() );
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com