ICEfaces
  1. ICEfaces
  2. ICE-9300

Modify Ant builds to allow for 2.1 and 2.2 versions of JSF

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 4.0.BETA, 4.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Any
    • Assignee Priority:
      P2
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial, Compatibility/Configuration
    • Workaround Exists:
      Yes
    • Workaround Description:
      Newer versions of the libraries can always be manually switched in to the current directory

      Description

      Need to modify the current build structure to support building with JSF 2.1 or 2.2. This should include Mojarra but may expand to include MyFaces as well.

        Activity

        Hide
        Deryk Sinotte added a comment - - edited

        I modified a number of build files as well as adjust the structure of the lib/ directory. The aim is to support building against both JSF 2.1 and 2.2 using either Mojarra or MyFaces. The directory structure has changed from:

        • icefaces/lib/mojarra
        • icefaces/lib/myfaces

        to:

        • icefaces/lib/mojarra/2.1
        • icefaces/lib/mojarra/2.2
        • icefaces/lib/myfaces/2.1
        • icefaces/lib/myfaces/2.2
        • icefaces/lib/myfaces/common

        NOTE The MyFaces 2.2 libraries are very early release versions and may not be ready for general use or testing yet.

        You control the implementation and the version using properties. The default is still to build with Mojarra 2.1. The web-profile target should always exclude JSF but the servlet-profile will include JSF depending on which properties are set. The MyFaces property remains the same. A new jsf22 property has been added. Here are the various combinations:

        #Mojarra 2.1 included
        ant clean servlet-profile
        
        #MyFaces 2.1 included
        ant -Dmyfaces="true" clean servlet-profile
        
        #Mojarra 2.2 included
        ant -Djsf22="true" clean servlet-profile
        
        #MyFaces 2.2 included
        ant -Dmyfaces="true" -Djsf22="true" clean servlet-profile
        

        NOTE To support all this, I had to adjust the various build files so that the logic also considered the version directory. I think I managed to changed all the build files in the trunk but if build files in other areas (e.g. QA) that are relying on the old structure, will need to be updated. To help with that, here's a diff of the changes made to samples/build/common.xml. It highlights how the new version directories and MyFaces common directory are handled.

        Index: samples/build/common.xml
        ===================================================================
        --- samples/build/common.xml	(revision 37380)
        +++ samples/build/common.xml	(revision )
        @@ -29,6 +29,7 @@
             <property name="lib.dir" location="${icefaces.base.dir}/lib"/>
             <property name="mojarra.lib.dir" location="${lib.dir}/mojarra"/>
             <property name="myfaces.lib.dir" location="${lib.dir}/myfaces"/>
        +    <property name="myfaces.common.dir" value="${myfaces.lib.dir}/common" />
             <property name="lib.ace.dir" location="${lib.dir}/ace"/>
             <property name="lib.ace.dir.includes" value=""/>
             <property name="lib.compat.dir" location="${lib.dir}/compat"/>
        @@ -60,10 +61,18 @@
             <property name="icefaces-compat.lib.name" value="icefaces-compat" />
         
             <!-- Check which JSF implementation to use and set the appropriate sub-directory  -->
        -    <condition property="jsf.lib.dir" value="${myfaces.lib.dir}" else="${mojarra.lib.dir}">
        +    <condition property="jsf.impl.dir" value="${myfaces.lib.dir}" else="${mojarra.lib.dir}">
                 <isset property="myfaces"/>
             </condition>
         
        +    <!-- Check which JSF version to use and set the appropriate sub-directory  -->
        +    <condition property="jsf.ver.dir" value="2.2" else="2.1">
        +        <isset property="jsf22"/>
        +    </condition>
        +
        +    <property name="jsf.lib.dir" value="${jsf.impl.dir}/${jsf.ver.dir}" />
        +    <echo message="JSF lib dir: ${jsf.lib.dir}"/>
        +
             <patternset id="lib.compile">
                 <include name="*.jar"/>
             </patternset>
        @@ -93,6 +102,10 @@
                 <exclude name="*.jar" unless="jsf"/>
             </patternset>
         
        +    <patternset id="lib.myfaces.common">
        +        <exclude name="*.jar" unless="myfaces"/>
        +    </patternset>
        +
             <patternset id="lib.distribute.ace" includes="itext-2.1.7.jar poi-3.7.jar ${lib.distribute.ace.includes}">
                 <exclude name="*.jar"                   unless="ace"/>
             </patternset>
        @@ -153,6 +166,9 @@
                         <fileset dir="${jsf.lib.dir}">
                             <patternset refid="lib.compile"/>
                         </fileset>
        +                <fileset dir="${myfaces.common.dir}">
        +                    <patternset refid="lib.myfaces.common"/>
        +                </fileset>
                         <fileset dir="${lib.dir}" >
                             <patternset refid="lib.compile"/>
                         </fileset>
        @@ -174,6 +190,14 @@
             </target>
         
             <target name="war.basic" depends="compile">
        +
        +        <condition property="myfaces.common.include" value="true">
        +            <and>
        +                <isset property="myfaces"/>
        +                <isset property="jsf"/>
        +            </and>
        +        </condition>
        +
                 <war basedir="${web.dir}"
                      destfile="${dist.dir}/${ant.project.name}.war" 
                      webxml="${web.dir}/WEB-INF/web.xml">
        @@ -195,6 +219,10 @@
                     </lib>
                     <lib dir="${jsf.lib.dir}" erroronmissingdir="false">
                         <patternset refid="lib.distribute.jsf"/>
        +            </lib>
        +
        +            <lib dir="${myfaces.common.dir}" erroronmissingdir="false">
        +                <exclude name="*.jar" unless="myfaces.common.include"/>
                     </lib>
         
                     <!-- Add the icefaces-ee-ext.jar only if it exists.  There are
        
        
        Show
        Deryk Sinotte added a comment - - edited I modified a number of build files as well as adjust the structure of the lib/ directory. The aim is to support building against both JSF 2.1 and 2.2 using either Mojarra or MyFaces. The directory structure has changed from: icefaces/lib/mojarra icefaces/lib/myfaces to: icefaces/lib/mojarra/2.1 icefaces/lib/mojarra/2.2 icefaces/lib/myfaces/2.1 icefaces/lib/myfaces/2.2 icefaces/lib/myfaces/common NOTE The MyFaces 2.2 libraries are very early release versions and may not be ready for general use or testing yet. You control the implementation and the version using properties. The default is still to build with Mojarra 2.1. The web-profile target should always exclude JSF but the servlet-profile will include JSF depending on which properties are set. The MyFaces property remains the same. A new jsf22 property has been added. Here are the various combinations: #Mojarra 2.1 included ant clean servlet-profile #MyFaces 2.1 included ant -Dmyfaces="true" clean servlet-profile #Mojarra 2.2 included ant -Djsf22="true" clean servlet-profile #MyFaces 2.2 included ant -Dmyfaces="true" -Djsf22="true" clean servlet-profile NOTE To support all this, I had to adjust the various build files so that the logic also considered the version directory. I think I managed to changed all the build files in the trunk but if build files in other areas (e.g. QA) that are relying on the old structure, will need to be updated. To help with that, here's a diff of the changes made to samples/build/common.xml. It highlights how the new version directories and MyFaces common directory are handled. Index: samples/build/common.xml =================================================================== --- samples/build/common.xml (revision 37380) +++ samples/build/common.xml (revision ) @@ -29,6 +29,7 @@ <property name="lib.dir" location="${icefaces.base.dir}/lib"/> <property name="mojarra.lib.dir" location="${lib.dir}/mojarra"/> <property name="myfaces.lib.dir" location="${lib.dir}/myfaces"/> + <property name="myfaces.common.dir" value="${myfaces.lib.dir}/common" /> <property name="lib.ace.dir" location="${lib.dir}/ace"/> <property name="lib.ace.dir.includes" value=""/> <property name="lib.compat.dir" location="${lib.dir}/compat"/> @@ -60,10 +61,18 @@ <property name="icefaces-compat.lib.name" value="icefaces-compat" /> <!-- Check which JSF implementation to use and set the appropriate sub-directory --> - <condition property="jsf.lib.dir" value="${myfaces.lib.dir}" else="${mojarra.lib.dir}"> + <condition property="jsf.impl.dir" value="${myfaces.lib.dir}" else="${mojarra.lib.dir}"> <isset property="myfaces"/> </condition> + <!-- Check which JSF version to use and set the appropriate sub-directory --> + <condition property="jsf.ver.dir" value="2.2" else="2.1"> + <isset property="jsf22"/> + </condition> + + <property name="jsf.lib.dir" value="${jsf.impl.dir}/${jsf.ver.dir}" /> + <echo message="JSF lib dir: ${jsf.lib.dir}"/> + <patternset id="lib.compile"> <include name="*.jar"/> </patternset> @@ -93,6 +102,10 @@ <exclude name="*.jar" unless="jsf"/> </patternset> + <patternset id="lib.myfaces.common"> + <exclude name="*.jar" unless="myfaces"/> + </patternset> + <patternset id="lib.distribute.ace" includes="itext-2.1.7.jar poi-3.7.jar ${lib.distribute.ace.includes}"> <exclude name="*.jar" unless="ace"/> </patternset> @@ -153,6 +166,9 @@ <fileset dir="${jsf.lib.dir}"> <patternset refid="lib.compile"/> </fileset> + <fileset dir="${myfaces.common.dir}"> + <patternset refid="lib.myfaces.common"/> + </fileset> <fileset dir="${lib.dir}" > <patternset refid="lib.compile"/> </fileset> @@ -174,6 +190,14 @@ </target> <target name="war.basic" depends="compile"> + + <condition property="myfaces.common.include" value="true"> + <and> + <isset property="myfaces"/> + <isset property="jsf"/> + </and> + </condition> + <war basedir="${web.dir}" destfile="${dist.dir}/${ant.project.name}.war" webxml="${web.dir}/WEB-INF/web.xml"> @@ -195,6 +219,10 @@ </lib> <lib dir="${jsf.lib.dir}" erroronmissingdir="false"> <patternset refid="lib.distribute.jsf"/> + </lib> + + <lib dir="${myfaces.common.dir}" erroronmissingdir="false"> + <exclude name="*.jar" unless="myfaces.common.include"/> </lib> <!-- Add the icefaces-ee-ext.jar only if it exists. There are
        Hide
        Mark Collette added a comment -

        We should probably address the tutorials as well. They ant build file for them doesn't really support deciding between Mojarra and MyFaces, nor for 2.1 versus 2.2, they just allowed Mojarra 2.1, so I've tweaked that to work with the new folders and file name convention.

        icefaces3 trunk
        Subversion 37398

        Show
        Mark Collette added a comment - We should probably address the tutorials as well. They ant build file for them doesn't really support deciding between Mojarra and MyFaces, nor for 2.1 versus 2.2, they just allowed Mojarra 2.1, so I've tweaked that to work with the new folders and file name convention. icefaces3 trunk Subversion 37398
        Hide
        Deryk Sinotte added a comment -

        I modified the tutorials/common.xml build file so it should now respect the "myfaces" and "jsf22" properties as well. Ran a quick test running all combinations against file-callback-tutorial and they were all fine. Resolving as fixed.

        Show
        Deryk Sinotte added a comment - I modified the tutorials/common.xml build file so it should now respect the "myfaces" and "jsf22" properties as well. Ran a quick test running all combinations against file-callback-tutorial and they were all fine. Resolving as fixed.
        Hide
        Deryk Sinotte added a comment -

        Updated a number of the build files in the EE trunk to reflect the new locations of the JSF libraries.

        Show
        Deryk Sinotte added a comment - Updated a number of the build files in the EE trunk to reflect the new locations of the JSF libraries.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: