You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pp...@apache.org on 2023/04/21 09:10:13 UTC

[camel-quarkus] 03/03: Avoid stale resources from previous builds and older branches in grouped modules

This is an automated email from the ASF dual-hosted git repository.

ppalaga pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit dc5c8c5b2fc8ab7168e248628c7e956aaa057e4e
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Thu Apr 20 02:01:45 2023 +0200

    Avoid stale resources from previous builds and older branches in grouped
    modules
---
 tooling/scripts/group-tests.groovy | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/tooling/scripts/group-tests.groovy b/tooling/scripts/group-tests.groovy
index 509dc07744..565e1df4bd 100644
--- a/tooling/scripts/group-tests.groovy
+++ b/tooling/scripts/group-tests.groovy
@@ -43,6 +43,15 @@ final Set<String> commaConcatenatePropertyNames = ["quarkus.native.resources.inc
 final Map<String, ResourceConcatenator> mergedFiles = new HashMap<>()
 concatRelPaths.each {relPath -> mergedFiles.put(relPath, new ResourceConcatenator(commaConcatenatePropertyNames)) }
 
+def srcDestMap = [
+    'src/main/java': destinationModuleDir.resolve('src/main/java'),
+    'src/test/java': destinationModuleDir.resolve('src/test/java'),
+    'src/main/resources': destinationModuleDir.resolve('src/main/resources'),
+    'src/test/resources': destinationModuleDir.resolve('src/test/resources')
+]
+
+srcDestMap.forEach { src, dest -> new AntBuilder().delete(dir: dest)}
+
 Files.list(sourceDir)
     .filter(p -> !fileExcludes.contains(p.getFileName().toString()))
     .filter { p -> Files.exists(p.resolve('pom.xml')) }
@@ -51,10 +60,7 @@ Files.list(sourceDir)
         mergedFiles.each { relPath, cat ->
             cat.append(p.resolve(relPath))
         }
-        copyResources(p.resolve('src/main/java'), destinationModuleDir.resolve('src/main/java'))
-        copyResources(p.resolve('src/test/java'), destinationModuleDir.resolve('src/test/java'))
-        copyResources(p.resolve('src/main/resources'), destinationModuleDir.resolve('src/main/resources'))
-        copyResources(p.resolve('src/test/resources'), destinationModuleDir.resolve('src/test/resources'))
+        srcDestMap.forEach { src, dest -> copyResources(p.resolve(src), dest) }
     }
 
 String scriptDir = new File(getClass().protectionDomain.codeSource.location.path).parent