Changeset 1061

Show
Ignore:
Timestamp:
11/22/07 18:13:27 (9 months ago)
Author:
richi
Message:

added processor setup to stubbles build system

Files:

Legend:

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

    r953 r1061  
    9494    <copy file="${project.basedir}/../../src/main/resources/phing/build.xml" tofile="${build.src.dir}/build-dist.xml" /> 
    9595    <copy file="${project.basedir}/../../src/main/resources/phing/build-stubbles.xml" tofile="${build.src.dir}/build-stubbles.xml" /> 
     96    <copy file="${project.basedir}/../../src/main/resources/phing/processors.xsl" tofile="${build.src.dir}/setup/processors.xsl" /> 
    9697    <copy file="${project.basedir}/../../src/main/resources/phing/stubbles.sh" tofile="${build.src.dir}/stubbles.sh"> 
    9798      <filterchain> 
  • trunk/src/main/resources/phing/build-stubbles.xml

    r1002 r1061  
    22<project name="Stubbles" basedir="." default="main"> 
    33  <property name="processors.default.file" value="config/xml/processors.xml" /> 
     4  <property name="processors.dist.file" value="config/xml/processors-dist.xml" /> 
     5  <property name="processors.all" value="xml,page,jsonrpc" /> 
    46  <taskDef name="stubInit" classname="stubInitTask" classpath="${project.basedir}/src/main/php/info/phing/tasks" /> 
    57  <taskDef name="stubGenerateJsonRpcProxies" classname="stubGenerateJsonRpcProxiesTask" classpath="${project.basedir}/src/main/php/info/phing/tasks" /> 
    6  
     8   
    79  <!-- 
    810    The main target 
     
    1517  --> 
    1618  <target name="setup-project" 
    17           depends="copy-dist-files, init-stubbles, cache-permission-check, setup-json-rpc, setup-logging, setup-website
     19          depends="copy-dist-files, init-stubbles, cache-permission-check, setup-json-rpc, setup-logging, setup-website, setup-processors
    1820          description="Creates a working project environment from a fresh build."> 
    1921    <echo>Your project ${project.new.name} has been set up correctly</echo> 
     
    7577    </if> 
    7678  </target> 
    77  
     79   
    7880  <!-- Set up all processors to be used --> 
    79   <target name="setup-processors" description="Setup processor configuration"> 
    80     <input propertyname="processors.xml" promptChar="?" defaultValue="Y">Do you want to enable XML/XSL processor? (Y/N)</input> 
    81     <if> 
    82       <or> 
    83         <equals arg1="${processors.xml}" arg2="Y"/> 
    84         <equals arg1="${processors.xml}" arg2="y"/> 
    85       </or> 
    86       <then> 
    87         <echo level="warning">Please do not forget to add the required pre- and postinterceptors for the XML/XSL processor.</echo> 
    88         <input propertyname="processors.default.select" promptChar="?" defaultValue="Y">Do you want to use this as the default one? (Y/N)</input> 
    89         <if> 
    90           <or> 
    91             <equals arg1="${processors.default.select}" arg2="Y"/> 
    92             <equals arg1="${processors.default.select}" arg2="y"/> 
    93           </or> 
    94           <then> 
    95             <property name="processors.default.value" value="xml" /> 
    96           </then> 
    97         </if> 
    98       </then> 
    99     </if> 
    100     <input propertyname="processors.memphis" promptChar="?" defaultValue="N">Do you want to enable Memphis processor? (Y/N)</input> 
    101     <if> 
    102       <and> 
    103         <or> 
    104           <equals arg1="${processors.memphis}" arg2="Y"/> 
    105           <equals arg1="${processors.memphis}" arg2="y"/> 
    106         </or> 
    107         <not> 
    108           <isset property="processors.default.value"/> 
    109         </not> 
    110       </and> 
    111       <then> 
    112         <input propertyname="processors.default.select" promptChar="?" defaultValue="Y">Do you want to use this as the default one? (Y/N)</input> 
    113         <if> 
    114           <or> 
    115             <equals arg1="${processors.default.select}" arg2="Y"/> 
    116             <equals arg1="${processors.default.select}" arg2="y"/> 
    117           </or> 
    118           <then> 
    119             <property name="processors.default.value" value="memphis" /> 
    120           </then> 
    121         </if> 
    122       </then> 
    123     </if> 
    124     <input propertyname="processors.rte" promptChar="?" defaultValue="N">Do you want to enable RTE processor? (Y/N)</input> 
    125     <if> 
    126       <and> 
    127         <or> 
    128           <equals arg1="${processors.rte}" arg2="Y"/> 
    129           <equals arg1="${processors.rte}" arg2="y"/> 
    130         </or> 
    131         <not> 
    132           <isset property="processors.default.value"/> 
    133         </not> 
    134       </and> 
    135       <then> 
    136         <input propertyname="processors.default.select" promptChar="?" defaultValue="Y">Do you want to use this as the default one? (Y/N)</input> 
    137         <if> 
    138           <or> 
    139             <equals arg1="${processors.default.select}" arg2="Y"/> 
    140             <equals arg1="${processors.default.select}" arg2="y"/> 
    141           </or> 
    142           <then> 
    143             <property name="processors.default.value" value="rte" /> 
    144           </then> 
    145         </if> 
    146       </then> 
    147     </if> 
    148     <append destFile="${processors.default.file}" text="&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&gt; 
    149 &lt;xj:configuration 
    150     xmlns:xj=&quot;http://xjconf.net/XJConf&quot; 
    151     xmlns=&quot;http://stubbles.net/websites&quot;&gt; 
    152   &lt;defaultResolver default=&quot;${processors.default.value}&quot;&gt;"/> 
    153     <if> 
    154       <or> 
    155         <equals arg1="${processors.xml}" arg2="Y"/> 
    156         <equals arg1="${processors.xml}" arg2="y"/> 
    157       </or> 
    158       <then> 
    159         <append destFile="${processors.default.file}" text="&lt;processor name=&quot;xml&quot; type=&quot;net.stubbles.websites.xml.stubXMLProcessor&quot; interceptorDescriptor=&quot;interceptors&quot; /&gt;"/> 
    160       </then> 
    161     </if> 
    162     <if> 
    163       <or> 
    164         <equals arg1="${processors.memphis}" arg2="Y"/> 
    165         <equals arg1="${processors.memphis}" arg2="y"/> 
    166       </or> 
    167       <then> 
    168         <append destFile="${processors.default.file}" text="&lt;processor name=&quot;memphis&quot; type=&quot;net.stubbles.websites.memphis.stubMemphisProcessor&quot; interceptorDescriptor=&quot;interceptors&quot; /&gt;"/> 
    169       </then> 
    170     </if> 
    171     <if> 
    172       <or> 
    173         <equals arg1="${processors.rte}" arg2="Y"/> 
    174         <equals arg1="${processors.rte}" arg2="y"/> 
    175       </or> 
    176       <then> 
    177         <append destFile="${processors.default.file}" text="&lt;processor name=&quot;rte&quot; type=&quot;net.stubbles.websites.rasmus.stubRasmusProcessor&quot; interceptorDescriptor=&quot;interceptors&quot; /&gt;"/> 
    178       </then> 
    179     </if> 
    180     <if> 
    181       <or> 
    182         <equals arg1="${jsonrpc.enabled}" arg2="Y"/> 
    183         <equals arg1="${jsonrpc.enabled}" arg2="y"/> 
    184       </or> 
    185       <then> 
    186         <append destFile="${processors.default.file}" text="&lt;processor name=&quot;jsonrpc&quot; type=&quot;net.stubbles.service.jsonrpc.stubJsonRpcProcessor&quot; interceptorDescriptor=&quot;interceptors&quot; /&gt;"/> 
    187       </then> 
    188     </if> 
    189     <append destFile="${processors.default.file}" text="&lt;/defaultResolver&gt; 
    190 &lt;/xj:configuration&gt;"/> 
    191     <if> 
    192       <not> 
    193         <isset property="processors.default.value"/> 
    194       </not> 
    195       <then> 
    196         <echo level="warning">Warning: No default processor selected. Please edit config/xml/processors.xml to select the correct default processor or re-run phing setup-processors</echo> 
    197       </then> 
    198     </if> 
     81  <target name="setup-processors"> 
     82     <echo>------------------------</echo> 
     83    <echo>| Setting up processors |</echo> 
     84    <echo>------------------------</echo> 
     85    <echo>Please choose which of the processors you'd like to have.</echo> 
     86    <echo>Just comma seperate them (e.g. bla,bla,bla).</echo> 
     87    <input propertyname="processors.choosen" promptChar=":" defaultValue="${processors.all}">choose processors</input> 
     88    <input propertyname="processors.default" promptChar=":" validArgs="${processors.choosen}">choose default processor</input> 
     89    <xslt file="${processors.dist.file}" tofile="${processors.default.file}" style="setup/processors.xsl" overwrite="true"> 
     90        <param name="choosenProcs" expression="${processors.choosen}" /> 
     91        <param name="defaultProc" expression="${processors.default}" /> 
     92    </xslt> 
    19993  </target> 
    20094