]> source.dussan.org Git - sonarqube.git/commitdiff
Compatibility of start.sh with incremental build of zip
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 28 Mar 2018 17:50:43 +0000 (19:50 +0200)
committerSonarTech <sonartech@sonarsource.com>
Wed, 28 Mar 2018 18:20:59 +0000 (20:20 +0200)
sonar-application/build.gradle

index 7affae56cdf9143c6f064274792124c4e4373bef..6971735c8e39cbb913fa32aa19cdc7d9d13d1674 100644 (file)
@@ -132,9 +132,22 @@ zip.doLast {
   if (length > maxLength)
     throw new GradleException("$distsDir/$archiveName size ($length) too large. Max is $maxLength")
 }
-
 assemble.dependsOn zip
 
+// the script start.sh unzips distribution into $buildDir/distributions.
+// This directory should be deleted when the zip is changed.
+task cleanLocalUnzippedDir(dependsOn: zip) {
+  def unzippedDir = file("$buildDir/distributions/sonarqube-$version")
+  inputs.files(file("$buildDir/distributions/sonar-application-${version}.zip"))
+  outputs.upToDateWhen { true }
+
+  doLast {
+    println("delete directory ${unzippedDir}")
+    project.delete(unzippedDir)
+  }
+}
+assemble.dependsOn cleanLocalUnzippedDir
+
 artifactoryPublish.skip = false
 
 publishing {