You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/09/19 19:22:21 UTC

svn commit: r1626278 - in /ofbiz/trunk: build.xml tools/patch.exe tools/todos.exe

Author: jleroux
Date: Fri Sep 19 17:22:21 2014
New Revision: 1626278

URL: http://svn.apache.org/r1626278
Log:
Commit for "Integrate ant build-dev target in build target" https://issues.apache.org/jira/browse/OFBIZ-5779

This completes the build-dev Ant target which was not yet called by the main build target, it's now done. This commit adds the todos.exe and patch.exe commands in the tools directory for patch to work on Windows w/o having to have it installed and in the path. todos.exe should not be needed in most cases, but better be safe than sorry.

It's a long time this was itching me. The main reason I did not do it already is I did not find an easy way to patch on Windows in Ant.

The documentation at https://cwiki.apache.org/confluence/display/OFBIZ/Addressing+Custom+Requirements+In+OFBiz has been updated

Added:
    ofbiz/trunk/tools/patch.exe   (with props)
    ofbiz/trunk/tools/todos.exe   (with props)
Modified:
    ofbiz/trunk/build.xml

Modified: ofbiz/trunk/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/build.xml?rev=1626278&r1=1626277&r2=1626278&view=diff
==============================================================================
--- ofbiz/trunk/build.xml (original)
+++ ofbiz/trunk/build.xml Fri Sep 19 17:22:21 2014
@@ -262,27 +262,46 @@ under the License.
     <!-- ================================================================== -->
     <!-- Apply patches where needed                                         -->
     <!-- ================================================================== -->
+  
+  
 
     <target name="build-dev" 
-        description="Patch and build all sources in a dev environment. This includes patching OFBiz using patches in runtime/patches. On Windows you need to have patch.exe in the path and patch files must all be in dos format (CR+LF)">
+        description="Patch sources in a dev environment if patch files are present in runtime/patches.>
         <!-- patch task can't handle a fileset => create a global patch -->
-        <concat destfile="${basedir}/runtime/patches/dev.patch" encoding="UTF-8" outputencoding="UTF-8">            
-            <fileset dir="${basedir}/runtime/patches" casesensitive="no">
-                <exclude name="dev.patch"/> <!-- exclude the patch itself in case it's still there -->
-                <include name="*.patch"/>
-            </fileset>
+        <concat destfile="${basedir}/runtime/patches/dev.patch" encoding="UTF-8" outputencoding="UTF-8">
+          <fileset dir="${basedir}/runtime/patches" casesensitive="no">
+            <exclude name="dev.patch"/> <!-- exclude the patch itself in case it's still there -->
+            <include name="*.patch"/>
+          </fileset>
         </concat>
+        <condition property="isWindows">
+          <os family="windows"/>
+        </condition>
         <if>
-            <resourceexists>
-                <file file="${basedir}/runtime/patches/dev.patch"/>
-            </resourceexists>            
-            <then>                          
+          <available file="${basedir}/runtime/patches/dev.patch"/>
+          <then>
+            <if>
+              <isset property="isWindows"/>
+              <then>
+                <echo message="Windows todos"/>
+                <exec executable="${basedir}/tools/todos.exe" dir="${basedir}/runtime/patches/">
+                  <arg value="${basedir}/runtime/patches/dev.patch"/>
+                </exec>
+                <echo message="Windows patch"/>
+                <exec executable="${basedir}/tools/patch.exe" dir="${basedir}">
+                  <arg value="-p0"/>
+                  <arg value="-i${basedir}\runtime\patches\dev.patch"/>
+                </exec>
+              </then>
+              <else>
                 <patch strip="0" patchfile="${basedir}/runtime/patches/dev.patch" dir="${basedir}"/>
-                <delete>
-                    <fileset dir="${basedir}/runtime/patches" includes="dev.patch"/>
-                </delete>
-            </then>                                  
-        </if>        
+              </else>
+            </if>
+          </then>
+          <delete>
+            <fileset dir="${basedir}/runtime/patches" includes="dev.patch"/>
+          </delete>
+        </if>
     </target>
     
     <target name="build-test" 
@@ -325,6 +344,8 @@ under the License.
     <target name="build" depends="ofbiz-init">
         <echo message="[build] ========== Start Building (Compile) =========="/>
 
+        <antcall target="build-dev"/>
+
         <antcall target="build-framework"/>
         <antcall target="build-applications"/>
         <antcall target="build-specialpurpose"/>

Added: ofbiz/trunk/tools/patch.exe
URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/patch.exe?rev=1626278&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ofbiz/trunk/tools/patch.exe
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ofbiz/trunk/tools/todos.exe
URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/todos.exe?rev=1626278&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ofbiz/trunk/tools/todos.exe
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Re: svn commit: r1626278 - in /ofbiz/trunk: build.xml tools/patch.exe tools/todos.exe

Posted by Jacopo Cappellato <ja...@gmail.com>.
On Sep 19, 2014, at 7:22 PM, jleroux@apache.org wrote:

> Added:
>    ofbiz/trunk/tools/patch.exe   (with props)
>    ofbiz/trunk/tools/todos.exe   (with props)

Jacques,

I am sorry but it is not acceptable to commit executables files in the trunk. Please revert this commit and let's find a better way of achieving your goals (in another thread I have suggested a possible solution).

Jacopo