svn commit: r1862045 - in /ofbiz/ofbiz-framework/trunk: framework/webtools/groovyScripts/entity/XmlDsDump.groovy gradle/check-gradle-version.ps1

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

svn commit: r1862045 - in /ofbiz/ofbiz-framework/trunk: framework/webtools/groovyScripts/entity/XmlDsDump.groovy gradle/check-gradle-version.ps1

jleroux@apache.org
Author: jleroux
Date: Tue Jun 25 09:36:03 2019
New Revision: 1862045

URL: http://svn.apache.org/viewvc?rev=1862045&view=rev
Log:
Fixed: Allow to create single file if both directory and filename is
provided by user
(OFBIZ-11124)

In framework/webtools XML Data Export I reported an issue, Jayansh fixed it:

If user provided file name and output directory in that case the entity xml
files are generated at both locations, i.e. at root we have test.xml and in user
provided output directory we have multiple files with [entityname].xml.

The expected change would be if user provided both output directory and filename
then file should be created in given directory with given filename.

Thanks: Jayansh Shinde for the fix

Added:
    ofbiz/ofbiz-framework/trunk/gradle/check-gradle-version.ps1
Modified:
    ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/XmlDsDump.groovy

Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/XmlDsDump.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/XmlDsDump.groovy?rev=1862045&r1=1862044&r2=1862045&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/XmlDsDump.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/framework/webtools/groovyScripts/entity/XmlDsDump.groovy Tue Jun 25 09:36:03 2019
@@ -187,6 +187,9 @@ if (passedEntityNames) {
     
         // single file
         if (filename && numberOfEntities) {
+            if (outpath && !(filename.contains("/") && filename.contains("\\"))) {
+                filename = outpath + File.separator + filename;
+            }
             writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename), "UTF-8")))
             writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
             writer.println("<entity-engine-xml>")
@@ -236,7 +239,7 @@ if (passedEntityNames) {
         results = []
         fileNumber = 1
         context.results = results
-        if (outpath) {
+        if (outpath && !filename) {
             outdir = new File(outpath)
             if (!outdir.exists()) {
                 outdir.mkdir()

Added: ofbiz/ofbiz-framework/trunk/gradle/check-gradle-version.ps1
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/gradle/check-gradle-version.ps1?rev=1862045&view=auto
==============================================================================
--- ofbiz/ofbiz-framework/trunk/gradle/check-gradle-version.ps1 (added)
+++ ofbiz/ofbiz-framework/trunk/gradle/check-gradle-version.ps1 Tue Jun 25 09:36:03 2019
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+echo "******************************************************"
+
+Start-Process -NoNewWindow "C:\projectsASF\ofbiz\gradlew.bat" -ArgumentList "wrapper --gradle-version=5.0 --distribution-type=bin"
\ No newline at end of file