Example #1
0
  public void scanPrintList() {
    System.out.println("===========显示待处理文件清单=================");

    // 扫描并获取全部excel内容
    FilesList fileslist = excellisthelper.createFilesList();

    StringBuffer bugStr = new StringBuffer();
    String a1_Path = ""; // 用来比较上下路径的标记
    String lastStr = "";

    for (FilesListItem sf : fileslist) {
      String sPath = sf.getPath(pv.filekeyroot);
      // sf.setKeyRoot(pv.filekeyroot);

      String printStr = "";
      // 检查web工程名
      try {
        sf.checkProject();
        printStr = sf.toString();
      } catch (Exception e) {

        // e.printStackTrace();
        System.out.println("   >>>" + e.getMessage() + "<<<  " + sf);
      }

      // 判断是否目录,目录就不操作
      if (PathUtils.isFolder(sPath)) {
        System.out.print("<<< 注意 >>> 清单包含有目录:\n" + printStr);
      } else {

        System.out.print(printStr);
      }

      // 比较两个相邻的文件,相同标识重复
      if (sPath.equals(a1_Path)) {
        bugStr.append(lastStr);
        bugStr.append(printStr);
        lastStr = "";
      }

      lastStr = printStr;
      a1_Path = sPath;
    }
    System.out.println("\n共有文件数量:" + Integer.toString(fileslist.size()));
    System.out.println("==空的版本号,将获取最新的版本。==请仔细检查清单格式,路径不对将无法从svn获取。");
    if (pv.getProperty("file.excel.merge").equals("true"))
      System.out.println(" >>>合并生成了EXCEL为:" + ToExcelFile.getOutExcelFileName());

    if (bugStr.length() > 0) {
      System.err.println("\n<<<<文件有重复>>>>请注意核对,如下:");
      System.err.println(bugStr);
    }
  }
Example #2
0
  /** 扫描清单文件, 从svn导出每一个文件到 指定目录 */
  public void scanSvnToPath() {
    System.out.println("===========从svn库导出到临时目录,或者workspace=================");

    // 扫描并获取全部excel内容
    FilesList sfs = excellisthelper.createFilesList();

    // 排重
    sfs.removeDeuplicate();

    svnToPath(sfs);

    // export svn文件后,自动提交到基线分支
    if (pv.getProperty("svn.autocommit").equals("true"))
      SVNRepo.CommitSvn(pv.getProperty("svn.workspace"), pv.svntofolder, "提交文件:" + sfs.excelFiles);
  }
Example #3
0
  /** 从war包导出文件到增量 */
  public void scanWarToZip() {
    System.out.println("===========从指定压缩文件war、zip、jar 导出到zip文件=================");

    // 扫描并获取全部excel内容
    FilesList fileslist = excellisthelper.createFilesList();
    // 排重
    fileslist.removeDeuplicate();

    int fileCount = 0;

    SVNRepo svnrepo = SVNRepo.getInstance();
    ToZipFile tozipfile = new ToZipFile(svnrepo);

    // war包的清单
    WarFiles warlist =
        new WarFiles(pv.getProperty("zip.folder"), pv.getProperty("zip.folder.filter"));
    System.out.println("Loading.." + warlist);

    // 扫描excel文件的清单
    for (FilesListItem oitem : fileslist) {

      try {
        // 判断是否目录,目录就不操作
        if (PathUtils.isFolder(oitem.getPath())) {
          System.out.println("   >>>目录不处理" + oitem.getPath());
        } else fileCount += tozipfile.takeWarFileToZip(warlist, oitem);

      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    System.out.println("\n    >>> 成功抽取文件数:" + fileCount);

    // 对zip文件进行检查,对比excel的文件,和zip中的文件
    tozipfile.FileInfo();
  }