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

jleroux 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 8f5a44cce3 Fixed: We have build problems in branches with plugins 
(OFBIZ-11284)
8f5a44cce3 is described below

commit 8f5a44cce31f5eed2abd0297477bfbc1b3c8afa0
Author: Jacques Le Roux <jacques.le.r...@les7arts.com>
AuthorDate: Mon Feb 13 18:21:57 2023 +0100

    Fixed: We have build problems in branches with plugins (OFBIZ-11284)
    
    Fixes using Subversion over Github in build.gradle to avoid hard coded 
branches
    and rather uses the real current branch
    
    While at it, replaces curled double and single quotes by straight ones
---
 build.gradle | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/build.gradle b/build.gradle
index 9c41c8c53b..acfe90ed28 100644
--- a/build.gradle
+++ b/build.gradle
@@ -142,6 +142,10 @@ tasks.withType(JavaCompile) {
     if (!project.hasProperty('skipNpmInstall')) finalizedBy 'npmInstall'
 }
 
+def getCurrentGitBranch() {
+    return "git branch --show-current".execute().text.trim()
+}
+
 // defines the footer files for git info
 def File gitFooterFile = file("${rootDir}/runtime/GitInfo.ftl")
 
@@ -369,10 +373,10 @@ jar.manifest.attributes(
 
 // Checks OFBiz Java coding conventions.
 checkstyle {
-    // Defining a maximum number of “tolerated” errors ensures that
+    // Defining a maximum number of "tolerated" errors ensures that
     // this number cannot increase in the future. It corresponds to
     // the sum of errors found last time it was changed after using the
-    // ‘checkstyle’ tool present in the framework and in the official
+    // 'checkstyle' tool present in the framework and in the official
     // plugins.
     tasks.checkstyleMain.maxErrors = 0
     // Currently there are no errors so we can show new one when they appear
@@ -965,7 +969,8 @@ task pullPluginSource(group: ofbizPlugin, description: 
'Download and install a p
     if (project.hasProperty('pluginId')) {
         // GitHub SVN feature 
https://docs.github.com/en/github/importing-your-projects-to-github/working-with-subversion-on-github/support-for-subversion-clients
         task pullPluginFromSvn(type: SvnCheckout) {
-            svnUrl = 
"https://github.com/apache/ofbiz-plugins/trunk/${pluginId}";
+            def currentBranch = getCurrentGitBranch()
+            svnUrl = "https://github.com/apache/ofbiz-plugins/"; + 
currentBranch + "/${pluginId}"
             workspaceDir = "${pluginsDir}/${pluginId}"
         }
         dependsOn pullPluginFromSvn
@@ -983,7 +988,8 @@ task pullAllPluginsSource(group: ofbizPlugin,
     }
     task pullPluginsFromSvn(type: SvnCheckout, dependsOn: deleteBeforePulling) 
{
         // GitHub SVN feature 
https://docs.github.com/en/github/importing-your-projects-to-github/working-with-subversion-on-github/support-for-subversion-clients
-        svnUrl = "https://github.com/apache/ofbiz-plugins/trunk";
+        def currentBranch = getCurrentGitBranch()
+        svnUrl = "https://github.com/apache/ofbiz-plugins/"; + currentBranch
         workspaceDir = "${pluginsDir}"
     }
     dependsOn pullPluginsFromSvn

Reply via email to