Esempio n. 1
0
 /** Removes all temporary files */
 @Override
 public void cleanUp() {
   for (VersionedFile appPackageFile : mAppPackageFiles) {
     appPackageFile.getFile().delete();
   }
   mAppPackageFiles.clear();
 }
Esempio n. 2
0
  /** {@inheritDoc} */
  @Override
  public IBuildInfo clone() {
    AppBuildInfo copy = new AppBuildInfo(getBuildId(), getTestTag(), getBuildTargetName());
    copy.addAllBuildAttributes(this);
    try {
      for (VersionedFile origVerFile : mAppPackageFiles) {
        // Only using createTempFile to create a unique dest filename
        File origFile = origVerFile.getFile();
        File copyFile =
            FileUtil.createTempFile(
                FileUtil.getBaseName(origFile.getName()),
                FileUtil.getExtension(origFile.getName()));
        copyFile.delete();
        FileUtil.hardlinkFile(origFile, copyFile);
        copy.addAppPackageFile(copyFile, origVerFile.getVersion());
      }
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    copy.setBuildBranch(getBuildBranch());
    copy.setBuildFlavor(getBuildFlavor());

    return copy;
  }