svn commit: r1856197 - /ofbiz/ofbiz-framework/trunk/build.gradle

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

svn commit: r1856197 - /ofbiz/ofbiz-framework/trunk/build.gradle

mthl
Author: mthl
Date: Mon Mar 25 14:21:35 2019
New Revision: 1856197

URL: http://svn.apache.org/viewvc?rev=1856197&view=rev
Log:
Improved: Rewrite ‘getJarManifestClasspathForCurrentOs’ (OFBIZ-10872)

Simplify the code logic and rename it ‘getJarClasspath’.

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

Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1856197&r1=1856196&r2=1856197&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Mon Mar 25 14:21:35 2019
@@ -290,7 +290,7 @@ sourceSets {
 jar.manifest.attributes(
     'Implementation-Title': project.name,
     'Main-Class': application.mainClassName,
-    'Class-Path': getJarManifestClasspathForCurrentOs()
+    'Class-Path': getJarClasspath()
 )
 
 // Eclipse plugin settings
@@ -1044,19 +1044,11 @@ def generateFileFromTemplate(templateFil
     }
 }
 
-def getJarManifestClasspathForCurrentOs() {
-    def osClassPath = ''
-    if (os.contains('windows')) {
-        configurations.runtimeClasspath.each { cpEntry ->
-            osClassPath += '\\' + cpEntry.toString() + ' '
-        }
-    } else {
-        osClassPath = configurations.runtimeClasspath.collect { "$it" }.join(' ')
-    }
-    return osClassPath
+def getJarClasspath() {
+    def mapper = os.contains('windows') ? { '\\' + "$it" } : { "$it" }
+    configurations.runtimeClasspath.collect(mapper).join(' ')
 }
 
-
 def subprojectExists(fullyQualifiedProject) {
     subprojects.stream()
         .anyMatch { it.path == fullyQualifiedProject.toString() }