]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19710 add missing dependency between cyclonedx and zip on sonar-application
authorSteve Marion <steve.marion@sonarsource.com>
Wed, 28 Aug 2024 11:10:23 +0000 (13:10 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 28 Aug 2024 20:02:45 +0000 (20:02 +0000)
sonar-application/build.gradle

index 544c2e3fc3d6cadd2cd4cfb2d1c61d167ef4fea4..8ca63715f7095688f1c6379e3b6ad36eaa8fec45 100644 (file)
@@ -336,15 +336,18 @@ task zip(type: Zip, dependsOn: [configurations.compileClasspath]) {
 }
 
 // Check the size of the archive
-zip.doLast {
-  def minLength = 340000000
-  def maxLength = 748000000
-
-  def length = archiveFile.get().asFile.length()
-  if (length < minLength)
-    throw new GradleException("${archiveFileName.get()} size ($length) too small. Min is $minLength")
-  if (length > maxLength)
-    throw new GradleException("${destinationDirectory.get()}/${archiveFileName.get()} size ($length) too large. Max is $maxLength")
+zip {
+  mustRunAfter cyclonedxBom
+  doLast {
+    def minLength = 340000000
+    def maxLength = 748000000
+
+    def length = archiveFile.get().asFile.length()
+    if (length < minLength)
+      throw new GradleException("${archiveFileName.get()} size ($length) too small. Min is $minLength")
+    if (length > maxLength)
+      throw new GradleException("${destinationDirectory.get()}/${archiveFileName.get()} size ($length) too large. Max is $maxLength")
+  }
 }
 assemble.dependsOn zip