Exemple #1
0
 public static void main(String[] args) throws Exception {
   WorkingCopy wc =
       new WorkingCopy(
           "svnuser",
           "svnuser",
           "svn://itit.io/repo/HwWebSystem",
           "/Users/yama/Desktop/svn_test/");
   wc.cleanup();
   wc.checkout();
   wc.update();
 }
 public static void compileApp(Application app, OutputListener listener) {
   if (app.scmUser == null) {
     return;
   }
   File localPath = new File(DeployManager.repoPath, app.id);
   if (!localPath.exists()) {
     logger.info("create local path:{}", localPath.getAbsolutePath());
     localPath.mkdirs();
   }
   WorkingCopy wc =
       new WorkingCopy(app.scmUser, app.scmPassword, app.scmPath, localPath.getAbsolutePath());
   wc.setOutputListener(listener);
   try {
     wc.cleanup();
     wc.checkout();
     wc.update();
   } catch (SVNException e) {
     logger.catching(e);
     listener.onOutput(e.getMessage());
     return;
   }
   //
   if (app.antTarget != null) {
     AntManager antManager = new AntManager(DeployManager.antPath);
     antManager.setOutputListener(listener);
     antManager.setCommonLib(DeployManager.antCommonLibPath);
     File buildFile = new File(localPath, "build.xml");
     try {
       antManager.antCall(app.antTarget, buildFile.getAbsolutePath());
     } catch (Exception e) {
       logger.catching(e);
       listener.onOutput(e.getMessage());
       return;
     }
   }
 }