[ofbiz-framework] branch trunk updated: Added a SourceSet for groovyScript files specifying the classpath that should be used for compilation.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Added a SourceSet for groovyScript files specifying the classpath that should be used for compilation.

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

danwatford pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new da2ab82  Added a SourceSet for groovyScript files specifying the classpath that should be used for compilation.
da2ab82 is described below

commit da2ab82b111f8bc25c5b7335fa192350de4cc775
Author: Daniel Watford <[hidden email]>
AuthorDate: Sun Jan 24 15:44:11 2021 +0000

    Added a SourceSet for groovyScript files specifying the classpath that should be used for compilation.
   
    (OFBIZ-12149)
   
    This helps IDEs navigate to the scripts' dependencies, making it easier
    to spot issues during development.
   
    However we don't want gradle to attempt to compile groovyScripts,
    therefore the compileGroovyScriptsGroovy task is disabled.
---
 build.gradle | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/build.gradle b/build.gradle
index 56a1dc2..b8e725e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -281,6 +281,20 @@ sourceSets {
             srcDirs = getDirectoryInActiveComponentsIfExists('src/test/resources')
         }
     }
+
+    groovyScripts {
+        groovy {
+            srcDirs += getDirectoryInActiveComponentsIfExists('groovyScripts')
+            compileClasspath += sourceSets.main.compileClasspath
+            compileClasspath += sourceSets.main.output
+        }
+    }
+}
+
+tasks.named('compileGroovyScriptsGroovy') {
+    // We don't want to build groovyScripts as they should be considered as standalone elements executed in
+    // isolation by ofbiz. Building them will result in numerous error due to duplicated classes.
+    enabled = false
 }
 
 jar.manifest.attributes(