Beispiel #1
0
 private File getBuildSonarScript(final File sonarBaseDir) {
   if (Environment.isWindowsPlatform()) {
     return new File(sonarBaseDir, "war/build-war.bat");
   }
   File file = new File(sonarBaseDir, "war/build-war.sh");
   file.setExecutable(true);
   return file;
 }
Beispiel #2
0
  @Override
  public String getWarPath() {
    File downloadsDir = Environment.getDownloadsDir();

    // Download the sonar.zip
    File zipFile = new File(downloadsDir, "sonar.zip");
    String url = "http://dist.sonar.codehaus.org/sonar-" + version + ".zip";
    zipFile = DownloadHelper.downloadFile(url, zipFile);
    File sonarBaseDir = getSonarBaseDir();

    if (!sonarBaseDir.exists()) {
      try {
        Unzip.unzip(zipFile, downloadsDir);
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
    File sonarWar = execBuildWar(sonarBaseDir);
    injectPlugins();
    return sonarWar.getAbsolutePath();
  }
Beispiel #3
0
 /**
  * @param downloadsDir
  * @return
  */
 private File getSonarBaseDir() {
   File downloadsDir = Environment.getDownloadsDir();
   return new File(downloadsDir, "sonar-" + version);
 }