Ignore:
Timestamp:
2010-01-27T08:59:34+13:00 (14 years ago)
Author:
oranfry
Message:

tidied up the source code release-kits

Location:
main/trunk/release-kits/kits/sork3/ant-scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/release-kits/kits/sork3/ant-scripts/build.xml

    r21648 r21650  
    2020    <!-- IMPORT OTHER ANT SCRIPTS -->
    2121    <import file="${rk.home}/shared/core/ant-scripts/shared.xml"/>
    22     <import file="${rk.home}/shared/core/ant-scripts/operations-on-gli.xml"/>
    2322    <import file="${rk.home}/shared/greenstone3/ant-scripts/greenstone3-shared.xml"/>
    24 
    25     <!-- helper constant -->
    26     <property name="dist.dirname" value="Greenstone-${version}-source-distribution"/>
    2723
    2824    <!-- THE MAIN TARGET -->
    2925    <target name="sork3" depends="init">
    30         <antcall target="export-greenstone3"><param name="dest" value="distributions/${dist.dirname}"/></antcall>
    31         <antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="${basedir}/distributions/${dist.dirname}"/></antcall>
    32         <ant dir="distributions/${dist.dirname}" target="prepare">
     26
     27        <!-- store the name of the distribution -->
     28        <property name="dist.name" value="Greenstone-${version}-source-distribution"/>
     29
     30        <!-- export the greenstone3 base code -->
     31        <exec executable="svn"><arg value="export"/><arg value="${svn.root}/main/${branch.path}/greenstone3"/><arg value="distributions/${dist.name}"/></exec>
     32
     33        <!-- set version numbers -->
     34        <antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="${basedir}/distributions/${dist.name}"/></antcall>
     35
     36        <!-- run ant prepare -->
     37        <ant dir="distributions/${dist.name}" target="prepare">
    3338            <property name="properties.accepted" value="true"/>
    3439            <property name="app.version" value="${version}"/>
    3540        </ant>
    36         <antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/distributions/${dist.dirname}/gli"/></antcall>
    37         <antcall target="insert-winbin"/>
    38         <antcall target="insert-ant"/>
    39         <antcall target="insert-windows-perl"><param name="todir" value="${basedir}/distributions/${dist.dirname}/gs2build/bin/windows"/></antcall>
    40         <antcall target="tweak-files"/>
    41         <ant dir="distributions/${dist.dirname}">
     41
     42        <!-- set gli version numbers -->
     43        <antcall target="gli-set-version-numbers"><param name="glibasedir" value="${basedir}/distributions/${dist.name}/gli"/></antcall>
     44
     45        <!-- insert windows binaries -->
     46        <delete dir="distributions/${dist.name}/gs2build/bin/windows"/>
     47        <exec executable="svn"><arg value="export"/><arg value="${svn.root}/main/${branch.path}/binaries/windows/bin"/><arg value="distributions/${dist.name}/gs2build/bin/windows"/></exec>
     48        <delete dir="distributions/${dist.name}/gs2build/bin/windows/imagemagick"/>
     49        <delete dir="distributions/${dist.name}/gs2build/bin/windows/ghostscript"/>
     50
     51        <!-- insert windows perl -->
     52        <unzip src="${rk.home}/shared/windows/perl.zip" dest="distributions/${dist.name}/gs2build/bin/windows"/>
     53
     54        <!-- clean up -->
     55        <delete file="distributions/${dist.name}/gs2build/bin/linux/mgquery_old" />
     56        <delete file="distributions/${dist.name}/build.properties.in"/>
     57        <delete><fileset dir="distributions/${dist.name}/packages" includes="**/*.zip,**/*.tar.gz"/></delete>
     58
     59        <!-- run greenstone3's own targets for fixing execute permissions -->
     60        <ant dir="distributions/${dist.name}">
    4261            <target name="fix-execute-permissions"/>
    4362            <target name="fix-execute-permissions-source"/>
    4463        </ant>
    45         <antcall target="create-archives"/>
    46         <ant dir="." antfile="${sork3.home}/ant-scripts/create-sourcecode-component.xml" target="create-sourcecode-component"/>
     64
     65        <!-- create the archives -->
     66        <mkdir dir="products"/>
     67        <delete file="products/${dist.name}.zip"/>
     68        <zip destfile="products/${dist.name}.zip"  basedir="distributions" includes="${dist.name}/**/*"/>
     69        <exec dir="distributions" executable="tar">
     70            <arg line="-czf ../products/${dist.name}.tar.gz ${dist.name}"/>
     71        </exec>
     72
     73        <!-- create the sourcecode component -->
     74        <ant dir="." antfile="${rk.home}/kits/${rk.name}/ant-scripts/create-sourcecode-component.xml" target="create-sourcecode-component"/>
    4775    </target>
    4876
    49     <target name="properties">
    50         <echo>Required Properties:</echo>
    51         <echo>version             the version string for the release</echo>
    52         <echo/>
    53 
    54         <echo>Optional Properties:</echo>
    55         <echo>branch.path         the branch of gsdl to make a release of. Eg: tags/2.81. Default: trunk.</echo>
    56         <echo>branch.revision     the revision of gsdl to make a release of. Eg: 18273. Default: HEAD.</echo>
    57         <echo/>
    58     </target>
    59 
    60 
    61     <target name="tweak-files">
    62         <delete file="distributions/${dist.dirname}/gs2build/bin/linux/mgquery_old" />
    63         <delete file="distributions/${dist.dirname}/build.properties.in"/>
    64         <delete><fileset dir="distributions/${dist.dirname}/packages" includes="**/*.zip,**/*.tar.gz"/></delete>
    65     </target>
    66 
    67     <target name="insert-ant">
    68         <copy todir="distributions/${dist.dirname}/packages/ant">
    69             <fileset dir="${rk.home}/core/ant"/>
    70         </copy>
    71     </target>
    72 
    73     <target name="insert-winbin">
    74         <delete dir="distributions/${dist.dirname}/gs2build/bin/windows"/>
    75         <exec executable="svn">
    76             <arg value="export"/>
    77             <arg value="${svn.root}/main/${branch.path}/binaries/windows/bin"/>
    78             <arg value="distributions/${dist.dirname}/gs2build/bin/windows"/>
    79         </exec>
    80         <delete dir="distributions/${dist.dirname}/gs2build/bin/windows/imagemagick"/>
    81         <delete dir="distributions/${dist.dirname}/gs2build/bin/windows/ghostscript"/>
    82     </target>
    83 
    84     <target name="create-archives">
    85         <mkdir dir="products"/>
    86         <delete file="products/${dist.dirname}.zip"/>
    87         <zip destfile="products/${dist.dirname}.zip"  basedir="distributions" includes="${dist.dirname}/**/*"/>
    88         <exec dir="distributions" executable="tar">
    89             <arg line="-czf ../products/${dist.dirname}.tar.gz ${dist.dirname}"/>
    90         </exec>
    91     </target>
    92 
    93     <target name="create-sourcecode">
    94         <!-- create a directory for the sourcecode -->
    95         <mkdir dir="distributions/source-component/gs2build"/>
    96 
    97         <!-- copy the files in -->
    98         <exec dir="distributions/${dist.dirname}" executable="cp">
    99             <arg value="-r"/>
    100 
    101             <!-- the bulk sourcecode -->
    102             <arg value="gs2build/build-src"/>
    103             <arg value="gs2build/common-src"/>
    104 
    105             <!-- destination -->
    106             <arg value="../source-component/gs2build"/>
    107 
    108         </exec>
    109        
    110         <!-- copy the files in -->
    111         <exec dir="distributions/${dist.dirname}" executable="cp">
    112             <arg value="-r"/>
    113 
    114             <!-- the bulk sourcecode -->
    115             <arg value="src"/>
    116 
    117             <!-- destination -->
    118             <arg value="../source-component"/>
    119 
    120         </exec>
    121 
    122         <!-- unzip some packages -->
    123         <unzip src="distributions/source-component/gs2build/common-src/indexers/packages/windows/iconv/iconv.zip" dest="distributions/source-component/gs2build/common-src/indexers/packages/windows/iconv"/>
    124         <delete file="distributions/source-component/gs2build/common-src/indexers/packages/windows/iconv/iconv.zip"/>
    125        
    126         <unzip src="distributions/source-component/gs2build/common-src/packages/windows/crypt/crypt.zip" dest="distributions/source-component/gs2build/common-src/packages/windows/crypt"/>
    127         <delete file="distributions/source-component/gs2build/common-src/packages/windows/crypt/crypt.zip"/>
    128        
    129         <unzip src="distributions/source-component/gs2build/common-src/packages/windows/expat/expat.zip" dest="distributions/source-component/gs2build/common-src/packages/windows/expat"/>
    130         <delete file="distributions/source-component/gs2build/common-src/packages/windows/expat/expat.zip"/>
    131        
    132         <unzip src="distributions/source-component/gs2build/common-src/packages/windows/stlport/stlport.zip" dest="distributions/source-component/gs2build/common-src/packages/windows/stlport"/>
    133         <delete file="distributions/source-component/gs2build/common-src/packages/windows/stlport/stlport.zip"/>
    134 
    135         <exec executable="tar" dir="distributions/source-component/gs2build/common-src/packages/sqlite"><arg value="-xzf"/><arg value="sqlite-amalgamation-3.5.9.tar.gz"/></exec>
    136         <delete file="distributions/source-component/gs2build/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz"/>
    137 
    138         <exec executable="tar" dir="distributions/source-component/gs2build/common-src/packages/expat"><arg value="-xzf"/><arg value="expat-1.95.8.tar.gz"/></exec>
    139         <delete file="distributions/source-component/gs2build/common-src/packages/sqlite/sqlite-amalgamation-3.5.9.tar.gz"/>
    140 
    141         <!-- archive it -->
    142         <delete file="products/Greenstone-${version}-source-component.zip"/>
    143         <zip destfile="products/Greenstone-${version}-source-component.zip" basedir="distributions/source-component" includes="**/*"/>
    144         <exec dir="distributions/source-component" executable="bash">
    145             <arg value="-c"/>
    146             <arg value="tar -czf ../../products/Greenstone-${version}-source-component.tar.gz *"/>
    147         </exec>
    148     </target>
     77    <target name="properties" depends="core-properties"/>
    14978
    15079</project>
  • main/trunk/release-kits/kits/sork3/ant-scripts/create-sourcecode-component.xml

    r20533 r21650  
    11<?xml version="1.0" encoding="utf-8" ?>
    22<!-- this is in a separate file because <import> can only load files that exist before build starts. This separate project is exeuted using <ant> AFTER greenstone3 has been checked out, to allow us to import the source-fileset.xml file -->
    3 <project name="create-sourcecode-component" default="csc">
    4     <echo>basedir: ${basedir}</echo>
     3<project name="create-sourcecode-component">
    54
    6     <import file="${basedir}/distributions/${dist.dirname}/resources/xml/components.xml"/>
    7     <import file="${basedir}/distributions/${dist.dirname}/resources/xml/executables.xml"/>
     5    <import file="distributions/${dist.name}/resources/xml/components.xml"/>
     6    <import file="distributions/${dist.name}/resources/xml/executables.xml"/>
    87
    98    <target name="create-sourcecode-component">
    109
    1110        <copy todir="distributions/source-component">
    12             <fileset dir="distributions/${dist.dirname}">
     11            <fileset dir="distributions/${dist.name}">
    1312                <patternset refid="greenstone3.source.component"/>
    1413            </fileset>
Note: See TracChangeset for help on using the changeset viewer.