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; }
@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(); }
/** * @param downloadsDir * @return */ private File getSonarBaseDir() { File downloadsDir = Environment.getDownloadsDir(); return new File(downloadsDir, "sonar-" + version); }