org.apache.tools.ant.taskdefs.Expand.setTaskType()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(94)

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

Expand.setTaskType介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

private static void unzipExceptClasses(File archive, File destDir, Project prj) {
  Expand e = new Expand();
  e.setProject(prj);
  e.setTaskType("unzip");
  e.setSrc(archive);
  e.setDest(destDir);
  PatternSet p = new PatternSet();
  p.setExcludes("WEB-INF/classes/");
  e.addPatternset(p);
  e.execute();
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Explodes the plugin into a directory, if necessary.
 */
private static void explode(File archive, File destDir) throws IOException {
  if(!destDir.exists())
    destDir.mkdirs();
  // timestamp check
  File explodeTime = new File(destDir,".timestamp");
  if(explodeTime.exists() && explodeTime.lastModified()==archive.lastModified())
    return; // no need to expand
  // delete the contents so that old files won't interfere with new files
  Util.deleteContentsRecursive(destDir);
  try {
    Expand e = new Expand();
    e.setProject(new Project());
    e.setTaskType("unzip");
    e.setSrc(archive);
    e.setDest(destDir);
    e.execute();
  } catch (BuildException x) {
    throw new IOException2("Failed to expand " + archive,x);
  }
  try {
    new FilePath(explodeTime).touch(archive.lastModified());
  } catch (InterruptedException e) {
    throw new AssertionError(e); // impossible
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Explodes the plugin into a directory, if necessary.
 */
private static void explode(File archive, File destDir) throws IOException {
  if(!destDir.exists())
    destDir.mkdirs();
  // timestamp check
  File explodeTime = new File(destDir,".timestamp");
  if(explodeTime.exists() && explodeTime.lastModified()==archive.lastModified())
    return; // no need to expand
  // delete the contents so that old files won't interfere with new files
  Util.deleteContentsRecursive(destDir);
  try {
    Expand e = new Expand();
    e.setProject(new Project());
    e.setTaskType("unzip");
    e.setSrc(archive);
    e.setDest(destDir);
    e.execute();
  } catch (BuildException x) {
    throw new IOException2("Failed to expand " + archive,x);
  }
  try {
    new FilePath(explodeTime).touch(archive.lastModified());
  } catch (InterruptedException e) {
    throw new AssertionError(e); // impossible
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Explodes the plugin into a directory, if necessary.
 */
private static void explode(File archive, File destDir) throws IOException {
  if(!destDir.exists())
    destDir.mkdirs();
  // timestamp check
  File explodeTime = new File(destDir,".timestamp");
  if(explodeTime.exists() && explodeTime.lastModified()==archive.lastModified())
    return; // no need to expand
  // delete the contents so that old files won't interfere with new files
  Util.deleteContentsRecursive(destDir);
  try {
    Expand e = new Expand();
    e.setProject(new Project());
    e.setTaskType("unzip");
    e.setSrc(archive);
    e.setDest(destDir);
    e.execute();
  } catch (BuildException x) {
    throw new IOException2("Failed to expand " + archive,x);
  }
  try {
    new FilePath(explodeTime).touch(archive.lastModified());
  } catch (InterruptedException e) {
    throw new AssertionError(e); // impossible
  }
}

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

/**
 * Explodes the plugin into a directory, if necessary.
 */
private static void explode(File archive, File destDir) throws IOException {
  if (!destDir.exists()) {
    destDir.mkdirs();
  }
  // timestamp check
  File explodeTime = new File(destDir, ".timestamp");
  if (explodeTime.exists() && explodeTime.lastModified() == archive.lastModified()) {
    return; // no need to expand
  }
  // delete the contents so that old files won't interfere with new files
  Util.deleteContentsRecursive(destDir);
  try {
    Expand e = new Expand();
    e.setProject(new Project());
    e.setTaskType("unzip");
    e.setSrc(archive);
    e.setDest(destDir);
    e.execute();
  } catch (BuildException x) {
    throw new IOException2("Failed to expand " + archive, x);
  }
  try {
    new FilePath(explodeTime).touch(archive.lastModified());
  } catch (InterruptedException e) {
    throw new AssertionError(e); // impossible
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

private static void unzipExceptClasses(File archive, File destDir, Project prj) {
  Expand e = new Expand();
  e.setProject(prj);
  e.setTaskType("unzip");
  e.setSrc(archive);
  e.setDest(destDir);
  PatternSet p = new PatternSet();
  p.setExcludes("WEB-INF/classes/");
  e.addPatternset(p);
  e.execute();
}

代码示例来源:origin: org.hudsonci.plugins/cvs

e.setDest(destdir);
e.setSrc(CVSSCM.getArchiveFile(build));
e.setTaskType("unzip");
e.execute();

代码示例来源:origin: org.jvnet.hudson.plugins/cvs

e.setDest(destdir);
e.setSrc(CVSSCM.getArchiveFile(build));
e.setTaskType("unzip");
e.execute();

相关文章