Ignore:
Timestamp:
2008-06-11T15:25:31+12:00 (16 years ago)
Author:
oranfry
Message:

first bit of work on lirk2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release-kits/lirk2/ant-scripts/create-distribution.xml

    r14982 r15956  
    99-->
    1010
    11 <project name="lirk3-create-distribution" default="create-distribution">
     11<project name="lirk2-create-distribution" default="create-distribution">
    1212
    1313
    1414    <target name="create-distribution">
    15         <!-- create distribution -->
    16         <addressedcall target="export-greenstone3" />
    17         <addressedcall target="dist-set-version-number-property" />
    18         <addressedcall target="create-distributions-1" />
    19         <addressedcall target="create-distributions-2" />
    20         <addressedcall target="create-distributions-3" />
    21         <addressedcall target="copy-over-build-xml" />
    22         <addressedcall target="insert-user-manual"/>
    23         <addressedcall target="insert-compiled-binaries"/>
    24     </target>
    25 
    26 
    27 
    28     <!--
    29 
    30         second level targets
    31 
    32     -->
    33    
    34     <target name="export-greenstone3">
    35         <if><bool><istrue value="${execute}"/></bool>
    36             <mkdir dir="distribution"/>
    37             <delete dir="distribution/greenstone3"/>
    38             <svn>
    39                 <export srcurl="${svn.root}/greenstone3/${branch.path}" destPath="distribution/greenstone3"/>
    40             </svn>
     15        <if><bool><istrue value="${execute}" /></bool>
     16            <addressedcall target="export-gsdl-gli-indexers" />
     17            <addressedcall target="dist-set-version" />
     18            <addressedcall target="compile-gli" />
     19            <addressedcall target="create-gli-client-zip" />
     20            <addressedcall target="tweak-files" />
    4121        </if>
    4222    </target>
    4323
    44     <target name="dist-set-version-number-property">
     24    <target name="export-gsdl-gli-indexers">
    4525        <if><bool><istrue value="${execute}"/></bool>
    46             <rsr file="distribution/greenstone3/resources/java/global.properties.in" pattern="(.*)@gsdl3version@(.*)" replacement="$1${version}$2" />
     26
     27            <mkdir dir="distribution"/>
     28            <delete dir="distribution/gsdl"/>
     29            <svn>
     30                <export srcurl="${svn.root}/gsdl/${branch.path}"        destPath="distribution/gsdl"/>
     31            </svn>
     32
     33            <svn>
     34                <export srcurl="${svn.root}/gli/${branch.path}"         destPath="distribution/gsdl/gli"/>
     35            </svn>
     36
     37            <svn>
     38                <export srcurl="${svn.root}/indexers/${branch.path}"    destPath="distribution/gsdl/indexers"/>
     39            </svn>
     40
    4741        </if>
    4842    </target>
    4943
    50     <target name="create-distributions-1">
     44    <target name="dist-set-version">
    5145        <if><bool><istrue value="${execute}"/></bool>
    52             <ant antfile="${lirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-1" inheritAll="false">
    53                 <property name="app.version" value="${version}"/>
    54                 <property name="branch.path" value="${branch.path}"/>
    55             </ant>
     46
     47            <echo level="info">Setting version in src/lib/gsdlconf.h</echo>
     48            <rsr file="${basedir}/gsdl/src/lib/gsdlconf.h" pattern="(#define GSDL_VERSION) &quot;.*&quot;" replacement="$1 &quot;${version}&quot;" />
     49
     50            <echo level="info">Setting version in Install.sh</echo>
     51            <rsr file="${basedir}/gsdl/Install.sh" pattern="(echo &quot;Version: ).*(&quot; .*)" replacement="$1${version}$2" />
     52
     53            <echo level="info">Setting version in etc/VERSION</echo>
     54            <rsr file="${basedir}/gsdl/etc/VERSION" pattern="(gsdl version: ).*" replacement="$1${version}" />
     55
    5656        </if>
    5757    </target>
    5858
    59     <target name="create-distributions-2">
     59    <target name="compile-gli">
    6060        <if><bool><istrue value="${execute}"/></bool>
    61             <ant antfile="${lirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-2"  inheritAll="false">
    62                 <property name="app.version" value="${version}"/>
    63                 <property name="branch.path" value="${branch.path}"/>
    64             </ant>
     61
     62            <echo>Compiling gli...</echo>
     63            <exec dir="${basedir}/distribution/gsdl/gli" executable="${basedir}/distribution/gsdl/gli/makegli.sh"/>
     64
     65            <echo>Creating jar...</echo>
     66            <exec dir="${basedir}/distribution/gsdl/gli" executable="${basedir}/distribution/gsdl/gli/makejar.sh"/>
     67
     68            <echo>Cleaning up intermediate files...</echo>
     69            <delete dir="${basedir}/distribution/gsdl/gli/jar"/>
     70            <delete dir="${basedir}/distribution/gsdl/gli/classes/org"/>
     71
     72            <echo>Putting gli server jar in a better place</echo>
     73            <exec dir="${basedir}/distribution/gsdl" executable="mv" failonerror="true">
     74                <arg line="gli/GLIServer.jar bin/java" />
     75            </exec>
     76
    6577        </if>
    6678    </target>
    6779
    68     <target name="create-distributions-3">
     80    <target name="create-gli-client-zip">
    6981        <if><bool><istrue value="${execute}"/></bool>
    70             <ant antfile="${lirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-3"  inheritall="false">
    71                 <property name="app.version" value="${version}"/>
    72                 <property name="branch.path" value="${branch.path}"/>
    73             </ant>
    74         </if>
    75     </target>
     82            <!--
     83            # take a copy of GLI directory
     84            &util::cp_r(&util::filename_cat($tmpdir, "gsdl", "gli"), $tmpdir);
    7685
    77     <target name="copy-over-build-xml">
    78         <if><bool><istrue value="${execute}"/></bool>
    79             <move file="distribution/greenstone3/modified-build.xml" tofile="distribution/greenstone3/build.xml"/>
    80         </if>
    81     </target>
     86            my $client_dirname = "gli-client-" . $version_num;
     87            rename ("gli", $client_dirname);
     88            chdir(&util::filename_cat($tmpdir, $client_dirname));
    8289
    83     <target name="insert-user-manual">
    84         <if><bool><istrue value="${execute}"/></bool>
    85             <copy file="greenstone3/gsdl-manuals/manuals/build/en/pdf/User_en.pdf" tofile="distribution/greenstone3/docs/manual/gs2_user_en.pdf"/>
    86         </if>
    87     </target>
    8890
    89     <target name="insert-compiled-binaries">
    90         <if><bool><istrue value="${execute}"/></bool>
     91            # delete unnecessary stuff
     92            `rm -rf clean.* document.* gems.* gli*.sh gli*.bat make*.sh make*.bat lib src`;
     93            # make sure permissions are ok
     94            `chmod a+x client-gli.sh client-gli.bat`;
     95            chdir($tmpdir);
    9196
    92             <delete dir="distribution/greenstone3/lib/jni"/>
    93             <exec executable="cp"><arg line="-r greenstone3/lib/jni distribution/greenstone3/lib"/></exec>
    94 
    95             <delete dir="distribution/greenstone3/gs2build/bin/linux"/>
    96             <exec executable="cp"><arg line="-r greenstone3/gs2build/bin/linux distribution/greenstone3/gs2build/bin"/></exec>
    97 
    98             <delete dir="distribution/greenstone3/gs2build/bin/java"/>
    99             <exec executable="cp"><arg line="-r greenstone3/gs2build/bin/java distribution/greenstone3/gs2build/bin"/></exec>
     97            # zip up the client
     98            &zip($client_dirname, $client_dirname, $tmpdir, 1);
     99            -->
    100100        </if>
    101101    </target>
    102102
    103103
     104    <target name="tweak-files">
     105        <if><bool><istrue value="${execute}"/></bool>
     106
     107            <echo level="info">Changing Install.sh to web release</echo>
     108            <rsr file="${basedir}/distribution/gsdl/Install.sh" pattern="^(iscdrom=).*" replacement="$1&quot;no&quot;" />
     109
     110        </if>
     111    </target>
     112
     113   
     114
    104115
    105116
Note: See TracChangeset for help on using the changeset viewer.