private void writeReportFile() throws IOException {
    ReportParams params = new ReportParams();
    params.setSource(tempDir + "/output_merge.xml");
    params.setOutput(xmlout);

    params.alias(xstream);

    String xmlContents = xstream.toXML(params);
    FileUtils.write(new File(tempDir, "dotcover_report.xml"), xmlContents);
  }
  private void writeMergeFile() throws IOException {

    MergeParams params = new MergeParams();
    params.setOutput(tempDir + "/output_merge.xml");
    // TODO: set the tempdir to be the dir where the snapshots will be saved
    params.setTempDir(tempDir);
    params.setSource(new Source(tempDir + "/output_coverage.xml"));

    params.alias(xstream);

    String xmlContents = xstream.toXML(params);
    FileUtils.write(new File(tempDir, "dotcover_merge.xml"), xmlContents);
  }
  /**
   * Write the XML for the coverage step
   *
   * @throws IOException
   */
  private void writeCoverageFiles() throws IOException {
    CoverageParams params = new CoverageParams();
    params.setExecutable(nunitPath);
    params.setArguments(assembliesAsString());
    params.setWorkingDir(workingDir);
    params.setOutput(tempDir + "/output_coverage.xml");
    params.setTempDir(tempDir);

    params.setFilters(getFilters());

    params.alias(xstream);

    String xmlContents = xstream.toXML(params);
    FileUtils.write(new File(tempDir, "dotcover_coverage.xml"), xmlContents);
  }
  private void storeSnapshot() throws IOException {
    if (snapshotPath == null) return;

    File file = new File(tempDir + "/output_merge.xml");
    String contents = FileUtils.read(file);

    if (contents == null) {
      log(
          "Can't find the file (" + file.getPath() + "), won't rename the snapshot",
          Project.MSG_WARN);
      return;
    }

    Pattern p = Pattern.compile("<string>(.+)</string>");
    Matcher matcher = p.matcher(contents);
    while (matcher.find()) {
      String filename = matcher.group(1);
      filename.trim();

      log(String.format("Renaming %s to %s", filename, snapshotPath), Project.MSG_VERBOSE);
      new File(filename).renameTo(new File(snapshotPath));
    }
  }