Changeset 1645
- Timestamp:
- 06/23/08 14:25:51 (3 months ago)
- Files:
-
- trunk/build/stubbles/build.xml (modified) (3 diffs)
- trunk/src/main/php/org/stubbles/phing/tasks/stubGenerateRewriteRulesTask.php (modified) (5 diffs)
- trunk/src/main/resources/phing/build-project.xml (added)
- trunk/src/main/resources/phing/build-stubbles.xml (modified) (4 diffs)
- trunk/src/main/resources/phing/build.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build/stubbles/build.xml
r1638 r1645 55 55 <include name="cache"/> 56 56 <include name="config/**"/> 57 <include name="docroot /**"/>57 <include name="docroot"/> 58 58 <include name="log"/> 59 59 <include name="pages/**"/> … … 76 76 <mkdir dir="${build.src.dir}/src/main/php" /> 77 77 <mkdir dir="${build.src.dir}/src/main/resources" /> 78 <mkdir dir="${build.src.dir}/src/main/resources/build" /> 78 79 <mkdir dir="${build.src.dir}/src/test/php" /> 79 80 <mkdir dir="${build.src.dir}/src/test/resources" /> … … 97 98 </fileset> 98 99 </copy> 100 <copy file="${stubbles.base.dir}/projects/dist/docroot/.htaccess" tofile="${build.src.dir}/src/main/resources/build/.htaccess-dist" overwrite="true"/> 99 101 <copy file="${stubbles.base.dir}/src/main/resources/phing/build.xml" tofile="${build.src.dir}/build-dist.xml" /> 100 102 <copy file="${stubbles.base.dir}/src/main/resources/phing/build-stubbles.xml" tofile="${build.src.dir}/build-stubbles.xml" /> 101 <copy file="${stubbles.base.dir}/src/main/resources/phing/processors.xsl" tofile="${build.src.dir}/setup/processors.xsl" /> 103 <copy file="${stubbles.base.dir}/src/main/resources/phing/build-project.xml" tofile="${build.src.dir}/build-project.xml" /> 104 <copy file="${stubbles.base.dir}/src/main/resources/phing/processors.xsl" tofile="${build.src.dir}/src/main/resources/build/processors.xsl" /> 102 105 <copy file="${stubbles.base.dir}/src/main/resources/phing/stubbles.sh" tofile="${build.src.dir}/stubbles.sh"> 103 106 <filterchain> trunk/src/main/php/org/stubbles/phing/tasks/stubGenerateRewriteRulesTask.php
r1153 r1645 19 19 * source file 20 20 * 21 * @var string21 * @var string 22 22 */ 23 protected $ src;23 protected $htaccessSource; 24 24 /** 25 * target file25 * destination directory 26 26 * 27 * @var string27 * @var string 28 28 */ 29 protected $dest ;29 protected $destinationDir; 30 30 /** 31 31 * gets htaccess lines appendend 32 32 * 33 * @var string33 * @var string 34 34 */ 35 35 protected $htaccess; … … 37 37 * commaseperated list of processors 38 38 * 39 * @var string39 * @var string 40 40 */ 41 41 protected $selectedProcessors; 42 42 43 43 /** 44 44 * constructor … … 46 46 public function init() 47 47 { 48 $this->src = 'docroot/.htaccess-dist'; 49 $this->dest = 'docroot/.htaccess'; 48 // intentionally empty 50 49 } 51 50 52 51 /** 53 52 * setter for build process 54 53 * 55 * @param string$procs54 * @param string $procs 56 55 */ 57 56 public function setSelectedProcessors($procs) … … 59 58 $this->selectedProcessors = $procs; 60 59 } 61 60 61 /** 62 * sets source file for .htaccess 63 * 64 * @param string $htaccessSource 65 */ 66 public function setHtaccessSource($htaccessSource) 67 { 68 $this->htaccessSource = $htaccessSource; 69 } 70 71 /** 72 * sets destination directory 73 * 74 * @param string $destinationDir 75 */ 76 public function setDestinationDir($destinationDir) 77 { 78 $this->destinationDir = $destinationDir; 79 } 80 62 81 /** 63 82 * construct .htaccess and write content 64 83 * 65 * @param array<string s> $processors84 * @param array<string> $selectedProcs 66 85 */ 67 86 public function writeHtacess($selectedProcs) 68 87 { 69 $lines = file($this->src); 70 88 $lines = file($this->htaccessSource); 71 89 foreach ($lines as $line) { 72 if (preg_match('/^RewriteRule.*/', $line)) {90 if (preg_match('/^RewriteRule.*/', $line)) { 73 91 foreach ($selectedProcs as $selProc) { 74 $this->htaccess .= preg_match('/^RewriteRule '.$selProc.'.*/', $line) ? $line: '';92 $this->htaccess .= (preg_match('/^RewriteRule ' . $selProc . '.*/', $line) ? ($line) : ('')); 75 93 } 76 94 } else { … … 79 97 } 80 98 81 file_put_contents($this->dest , $this->htaccess);99 file_put_contents($this->destinationDir . '/.htaccess', $this->htaccess); 82 100 } 83 101 84 102 /** 85 103 * implement main method of phing Task trunk/src/main/resources/phing/build-stubbles.xml
r1641 r1645 1 1 <?xml version="1.0"?> 2 2 <project name="Stubbles" basedir="." default="main"> 3 <property name="stubbles.lib.path" value="${project.basedir}/lib" /> 4 <property name="stubbles.projects.path" value="${project.basedir}/projects" /> 5 <property name="stubbles.src.path" value="${project.basedir}/src/main" /> 6 <property name="phing.task.dir" value="${project.basedir}/src/main/php/org/stubbles/phing/tasks" /> 7 <taskDef name="stubInitConfig" classname="stubInitConfigTask" classpath="${phing.task.dir}" /> 8 <taskDef name="stubInitClassLoader" classname="stubInitClassLoaderTask" classpath="${phing.task.dir}" /> 9 <taskDef name="stubGenerateJsonRpcProxies" classname="stubGenerateJsonRpcProxiesTask" classpath="${phing.task.dir}" /> 3 <property name="stubbles.lib.path" value="${project.basedir}/lib"/> 4 <property name="stubbles.projects.path" value="${project.basedir}/projects"/> 5 <property name="stubbles.src.path" value="${project.basedir}/src/main"/> 6 <property name="stubbles.project.path" value="${stubbles.projects.path}/${stubbles.project}"/> 7 <property name="phing.task.dir" value="${project.basedir}/src/main/php/org/stubbles/phing/tasks"/> 8 <taskDef name="stubInitConfig" classname="stubInitConfigTask" classpath="${phing.task.dir}"/> 9 <taskDef name="stubInitClassLoader" classname="stubInitClassLoaderTask" classpath="${phing.task.dir}"/> 10 <taskDef name="stubGenerateJsonRpcProxies" classname="stubGenerateJsonRpcProxiesTask" classpath="${phing.task.dir}"/> 10 11 11 12 <target name="main" depends="prepare-folders, generate-clients" description="Executes all targets."> … … 47 48 48 49 <target name="projectcheck" unless="stubbles.project"> 49 <echo message="====================================================="/> 50 <echo message="Version not specified. You must enter a version. In"/> 51 <echo message="the future you can add this to build.properties or"/> 52 <echo message="enter it on the command line: "/> 53 <echo message=" "/> 54 <echo message="-stubbles.project=example"/> 55 <echo message="====================================================="/> 56 <input propertyname="stubbles.project" promptChar=":">stubbles.project</input> 50 <input propertyname="stubbles.project" promptChar=":">Please enter the name of the project</input> 57 51 </target> 58 52 … … 75 69 76 70 <target name="clean-examples" description="Removes all example related stuff."> 77 <delete dir="${stubbles.src.path}/php/org/stubbles/examples" includeemptydirs="true" verbose="true" failonerror="true" />71 <delete dir="${stubbles.src.path}/php/org/stubbles/examples" includeemptydirs="true" verbose="true" failonerror="true"/> 78 72 <delete dir="${stubbles.projects.path}/examples" includeemptydirs="true" verbose="true" failonerror="true"/> 79 73 </target> … … 155 149 </then> 156 150 <else> 157 <echo>No json-rpc-service.ini configuration file available .</echo>151 <echo>No json-rpc-service.ini configuration file available for project ${stubbles.project}.</echo> 158 152 <echo>Skipping JSON-RPC client generation.</echo> 159 153 </else> trunk/src/main/resources/phing/build.xml
r1641 r1645 6 6 --> 7 7 <target name="main" description="Build project."> 8 <property file="build.properties" />8 <property file="build.properties"/> 9 9 <phing phingfile="build-stubbles.xml" target="main"/> 10 </target> 11 12 <target name="setup-project" description="Create a new project within installation."> 13 <phing phingfile="build-project.xml" target="setup-project"/> 14 </target> 15 16 <target name="generate-clients" description="Generates JSON-RPC clients for all projects."> 17 <phing phingfile="build-project.xml" target="generate-clients"/> 10 18 </target> 11 19
