Changeset 1542


Ignore:
Timestamp:
11/17/20 16:27:50 (3 years ago)
Author:
davidb
Message:

Change in how the Expeditee.jar file is formed to avoid the extremely expensive fileIO that zipfileset triggers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r1535 r1542  
    2626        <property name="expeditee.server.port" value="3000"/>
    2727
    28         <union id="portable.includes.exp">
     28        <!--
     29            The following approach turned out to be terribly slow as the number of
     30            jar files incluced increase.  This is because the 'zipfileset' task functions
     31            by using a separate file IO pass for each file extraced.  For more details
     32            see:
     33           
     34              https://bz.apache.org/bugzilla/show_bug.cgi?id=43144
     35           
     36            which also highlights how the unzip task can be used to write a faster alternative,
     37            which (imprinted to the same 'exludes' pattern specified here) is used in
     38            the 'mergejars' target below
     39        -->
     40       
     41        <union id="reallyslowIO.portable.includes.exp">
    2942                <zipfileset excludes="META-INF/*.SF" src="releases/jars/junit.jar"/>
    3043                <zipfileset excludes="META-INF/*.SF" src="releases/jars/activation.jar"/>
     
    5770                </fileset>
    5871        </path>
    59        
     72
    6073        <path id="classpath.jfx">
    61                 <!-- Check this points to an existing file, if you can't find the jar just compile with build-nojfx -->
    62                 <pathelement location="${java.home}/lib/jfxrt.jar"/>
     74          <!-- Check this points to an existing file, if you can't find the jar just compile with build-nojfx -->
     75          <pathelement location="${java.home}/lib/jfxrt.jar"/>
     76        </path>
     77
     78
     79        <path id="portable.includes.exp">
     80          <fileset dir="${dist.dir.exp}/unjarred">
     81          </fileset>
    6382        </path>
    6483
     
    155174                </jar>
    156175        </target>
    157         <target depends="build" name="jar"> <!-- self-contained, portable jar -->
     176        <target depends="build" name="reallyslowIO.jar"> <!-- self-contained, portable jar -->
    158177                <jar destfile="${dist.dir.exp}/${dist.filename.exp}" filesetmanifest="mergewithoutmain">
    159178                        <manifest>
     
    164183                                <exclude name="src/**"/>
    165184                        </fileset>
     185                        <resources refid="reallyslowIO.portable.includes.exp" />   
     186                </jar>
     187        </target>
     188
     189       
     190        <target name="mergejars">
     191          <unzip dest="${dist.dir.exp}/unjarred">
     192            <patternset>
     193              <exclude name="META-INF/*.SF"/>
     194            </patternset>
     195            <!-- fileset to include ... -->
     196            <path refid="classpath.exp"/>
     197          </unzip>
     198        </target>
     199
     200
     201        <target depends="build,mergejars" name="jar"> <!-- self-contained, portable jar -->
     202                <jar destfile="${dist.dir.exp}/${dist.filename.exp}" filesetmanifest="mergewithoutmain">
     203                        <manifest>
     204                                <attribute name="Main-Class" value="org.apollo.ApolloSystem"/>
     205                                <attribute name="Class-Path" value="."/>
     206                        </manifest>
     207                        <fileset dir="${build.dir.exp}">
     208                                <exclude name="src/**"/>
     209                        </fileset>
    166210                        <resources refid="portable.includes.exp" />
    167211                </jar>
    168         </target>
     212                <delete dir="${dist.dir.exp}/unjarred" quiet="true"/>
     213        </target>
     214
     215
    169216        <target depends="jar" name="inst">
    170217                <mkdir dir="${inst.dir.exp}" />
Note: See TracChangeset for help on using the changeset viewer.