svn commit: r1833949 - in /ofbiz/ofbiz-framework/trunk: build.gradle settings.gradle

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

svn commit: r1833949 - in /ofbiz/ofbiz-framework/trunk: build.gradle settings.gradle

jleroux@apache.org
Author: jleroux
Date: Wed Jun 20 20:36:59 2018
New Revision: 1833949

URL: http://svn.apache.org/viewvc?rev=1833949&view=rev
Log:
Improved: Don't guess the system file separator
(OFBIZ-10428)

The JVM already knows the file separator of the current system when running
Gradle so use that value instead of guessing from the operating system property.

Thanks: Mathieu Lirzin

Modified:
    ofbiz/ofbiz-framework/trunk/build.gradle
    ofbiz/ofbiz-framework/trunk/settings.gradle

Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1833949&r1=1833948&r2=1833949&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Wed Jun 20 20:36:59 2018
@@ -265,16 +265,16 @@ eclipse.classpath.file.whenMerged { clas
      * in the .classpath file which are generated automatically
      * due to the settings in the sourceSets block
      */
-    def osDirSeparator = os.contains('windows') ? '\\' : '/'
+    def fileSep = System.getProperty("file.separator")
 
     iterateOverActiveComponents { component ->
-        def componentName = component.toString() - rootDir.toString() - osDirSeparator
+        def componentName = component.toString() - rootDir.toString() - fileSep
         def eclipseEntry = os.contains('windows') ? componentName.replaceAll("\\\\", "/") : componentName
 
         classpath.entries.removeAll { entry ->
             // remove any "src" entries in .classpath of the form /componentName
             entry.kind == 'src' &&
-            entry.path ==~ '.*/+(' + componentName.tokenize(osDirSeparator).last() + ')$' ||
+            entry.path ==~ '.*/+(' + componentName.tokenize(fileSep).last() + ')$' ||
             entry.path ==~ /(\/+framework)$/ ||
             entry.path ==~ /(\/+applications)$/ ||
             entry.path ==~ /(\/+plugins)$/ ||

Modified: ofbiz/ofbiz-framework/trunk/settings.gradle
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/settings.gradle?rev=1833949&r1=1833948&r2=1833949&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/settings.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/settings.gradle Wed Jun 20 20:36:59 2018
@@ -20,9 +20,9 @@
 apply from: 'common.gradle'
 rootProject.name = 'ofbiz'
 
+def fileSep = System.getProperty("file.separator")
+
 iterateOverActiveComponents { File component ->
-    def osName = System.getProperty('os.name').toLowerCase()
-    def osDirSeparator = osName.contains('windows') ? "\\\\" : "/"
     def subProject = (component.toString() - rootDir)
-    include subProject.replaceAll(osDirSeparator, ':')
+    include subProject.replaceAll(fileSep, ':')
 }