Changeset 592

Show
Ignore:
Timestamp:
04/20/07 22:56:08 (1 year ago)
Author:
schst
Message:

Improved build system: run "phing -f build-stubbles.xml setup-project" in a release to copy all needed files and automatically generate build.properties based on user input

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/stubbles/build.xml

    r570 r592  
    4747    <copy file="${project.basedir}/../../config/xml/processors.xml" tofile="${build.src.dir}/config/xml/processors-dist.xml" /> 
    4848    <copy file="${project.basedir}/../../config/xml/rdbms.xml" tofile="${build.src.dir}/config/xml/rdbms-dist.xml" /> 
    49     <copy file="${project.basedir}/../../config/xml/json-rpc-service.xml" tofile="${build.src.dir}/config/xml/json-rpc-service-dist.xml" /> 
     49    <copy file="${project.basedir}/../../config/xml/json-rpc-service-dist.xml" tofile="${build.src.dir}/config/xml/json-rpc-service-dist.xml" /> 
    5050 
    5151    <mkdir dir="${build.src.dir}/config/xml/pages" /> 
     
    6868    <copy file="${project.basedir}/../../src/main/resources/phing/build.xml" tofile="${build.src.dir}/build-dist.xml" /> 
    6969    <copy file="${project.basedir}/../../src/main/resources/phing/build-stubbles.xml" tofile="${build.src.dir}/build-stubbles.xml" /> 
    70     <copy file="${project.basedir}/../../src/main/resources/phing/build.properties-dist" tofile="${build.src.dir}/build.properties-dist" /> 
    7170 
    7271    <mkdir dir="${build.src.dir}/log" /> 
  • trunk/src/main/resources/phing/build-stubbles.xml

    r591 r592  
    1313    Setup a project from a new build 
    1414  --> 
    15   <target name="setup-project" description="Creates a working project environment from a fresh build."> 
     15  <target name="setup-project" 
     16          depends="copy-dist-files, init-stubbles, cache-permission-check, setup-json-rpc" 
     17          description="Creates a working project environment from a fresh build."> 
     18  </target> 
     19 
     20  <!-- 
     21    Setup a project from a new build 
     22  --> 
     23  <target name="copy-dist-files" description="Copies basic configuration files."> 
    1624    <echo>----------------------------------</echo> 
    17     <echo>| Setting up project             |</echo> 
     25    <echo>| Setting up build system        |</echo> 
    1826    <echo>----------------------------------</echo> 
    19     <move file="${project.basedir}/build.properties-dist" tofile="${project.basedir}/build.properties" overwrite="false"/> 
     27    <touch file="${project.basedir}/build.properties"/> 
    2028    <move file="${project.basedir}/build-dist.xml" tofile="${project.basedir}/build.xml" overwrite="false"/> 
    2129    <move file="${project.basedir}/config/php/config-dist.php" tofile="${project.basedir}/config/php/config.php" overwrite="false"/> 
     30  </target> 
     31 
     32  <!-- Set the cache permission property --> 
     33  <target name="cache-permission-check" unless="cache.permissions" description="Checks, whether cache permissions have been specified"> 
     34    <echo>----------------------------------</echo> 
     35    <echo>| Preparing cache                |</echo> 
     36    <echo>----------------------------------</echo> 
     37    <input propertyname="cache.permissions" promptChar=":">Please supply permissions for cache folders</input> 
     38    <append destFile="build.properties" text="cache.permissions=${cache.permissions}${line.separator}"/> 
     39  </target> 
     40 
     41  <!-- Set the JSON-RPC properties --> 
     42  <target name="setup-json-rpc" unless="jsonrpc.clients.dir" description="Basic setup for JSON-RPC functionality"> 
     43    <input propertyname="jsonrpc.enabled" promptChar="?">Do you want to enable JSON-RPC functionality? (Y/N)</input> 
     44    <if> 
     45      <equals arg1="${jsonrpc.enabled}" arg2="Y"/> 
     46      <then> 
     47        <echo>----------------------------------</echo> 
     48        <echo>| Setting up JSON-RPC package    |</echo> 
     49        <echo>----------------------------------</echo> 
     50        <input propertyname="jsonrpc.clients.dir" promptChar=":">Please supply the directory for generated clients</input> 
     51        <input propertyname="jsonrpc.service.url" promptChar=":">Please supply the service URL for generated clients</input> 
     52 
     53        <append destFile="build.properties" text="jsonrpc.clients.dir=${jsonrpc.clients.dir}${line.separator}"/> 
     54        <move file="${stubbles.config.path}/xml/json-rpc-service-dist.xml" tofile="${stubbles.config.path}/xml/json-rpc-service.xml" overwrite="true"> 
     55          <filterchain> 
     56            <expandproperties /> 
     57          </filterchain> 
     58        </move> 
     59      </then> 
     60      <else> 
     61        <echo>JSON-RPC initialization skipped.</echo> 
     62      </else> 
     63    </if> 
    2264  </target> 
    2365 
     
    2567    Cleanup dist-files 
    2668  --> 
    27   <target name="clean-dist" description="Removes left-over dist-files from the build."> 
     69  <target name="clean-dist" depends="init-stubbles" description="Removes left-over dist-files from the build."> 
    2870    <echo>----------------------------------</echo> 
    2971    <echo>| Removing dist files            |</echo> 
    3072    <echo>----------------------------------</echo> 
    31     <delete file="${project.basedir}/build.properties-dist"/> 
    32     <delete file="${project.basedir}/build-dist.xml"/> 
    33     <delete file="${project.basedir}/config/php/config-dist.php"/> 
     73    <echo>After removing the dist files, you will not be able to execute "setup-project" anymore.</echo> 
     74    <input propertyname="cleanup.dist.confirm" promptChar="?">Are you sure, you want to cleanup all dist files? (Y/N)</input> 
     75    <if> 
     76      <equals arg1="${cleanup.dist.confirm}" arg2="Y"/> 
     77      <then> 
     78        <delete file="${project.basedir}/build-dist.xml"/> 
     79        <delete file="${project.basedir}/config/php/config-dist.php"/> 
     80        <delete> 
     81          <fileset dir="${stubbles.config.path}"> 
     82            <include name="**/*-dist.xml"/> 
     83          </fileset> 
     84        </delete> 
     85      </then> 
     86      <else> 
     87        <echo>No dist files have been deleted.</echo> 
     88      </else> 
     89    </if> 
     90  </target> 
     91 
     92  <!-- 
     93    Cleanup basic configuration options 
     94  --> 
     95  <target name="clean-config" depends="init-stubbles" description="Removes the configuration added during setup."> 
     96    <echo>----------------------------------</echo> 
     97    <echo>| Removing configuration files   |</echo> 
     98    <echo>----------------------------------</echo> 
     99    <delete file="${project.basedir}/build.properties"/> 
    34100  </target> 
    35101 
  • trunk/src/main/resources/phing/build.xml

    r591 r592  
    2525 
    2626  <!-- 
     27    Cleanup basic configuration options 
     28  --> 
     29  <target name="clean-config" description="Removes the configuration added during setup."> 
     30    <phing phingfile="build-stubbles.xml" target="clean-config"/> 
     31  </target> 
     32 
     33  <!-- 
    2734    This target is only used once. 
    2835    It can be used to copy dist config files to the correct