[Yanel-commits] rev 47027 - public/yanel/trunk/src/build/targets

guillaume at wyona.com guillaume at wyona.com
Tue Jan 12 10:53:10 CET 2010


Author: guillaume
Date: 2010-01-12 10:53:08 +0100 (Tue, 12 Jan 2010)
New Revision: 47027

Modified:
   public/yanel/trunk/src/build/targets/create-new-resource-type.xml
Log:
Small refactoring: one can now easily define in which directory new resource-types get created
 using the 'new-resource-types.home' Ant location property, e.g.:
 `build new-resource-type -Dnew-resource-types.home=/home/guillaume/yanel-RTs`


Modified: public/yanel/trunk/src/build/targets/create-new-resource-type.xml
===================================================================
--- public/yanel/trunk/src/build/targets/create-new-resource-type.xml	2010-01-11 19:20:33 UTC (rev 47026)
+++ public/yanel/trunk/src/build/targets/create-new-resource-type.xml	2010-01-12 09:53:08 UTC (rev 47027)
@@ -4,6 +4,8 @@
   <taskdef resource="net/sf/antcontrib/antlib.xml"/>
   <description>Create new resource-type</description>
 
+  <property name="new-resource-types.home" location="${yanel.source.home}/src/contributions/resources"/>
+
   <target name="new-resource-type" description="Create a new resource-type" depends="init">
     <echo>Create new resource-type from scratch ${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template</echo>
 
@@ -25,50 +27,50 @@
     <property name="new.resource.test.java.class.fs.path.full" value="${new.resource.java.class.fs.path}/${new.resource.java.class.name}Test.java"/>
     <property name="new.resource.webtest.java.class.fs.path.full" value="${new.resource.java.class.fs.path}/${new.resource.java.class.name}WebTest.java"/>
     
-    <property name="new.resource.java.class.location" location="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/java/${new.resource.java.class.fs.path.full}"/>
-    <property name="new.resource.test.java.class.location" location="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/test/junit/${new.resource.test.java.class.fs.path.full}"/>
-    <property name="new.resource.webtest.java.class.location" location="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/test/htmlunit/${new.resource.webtest.java.class.fs.path.full}"/>
+    <property name="new.resource.java.class.location" location="${new-resource-types.home}/${new.resource.name}/src/java/${new.resource.java.class.fs.path.full}"/>
+    <property name="new.resource.test.java.class.location" location="${new-resource-types.home}/${new.resource.name}/src/test/junit/${new.resource.test.java.class.fs.path.full}"/>
+    <property name="new.resource.webtest.java.class.location" location="${new-resource-types.home}/${new.resource.name}/src/test/htmlunit/${new.resource.webtest.java.class.fs.path.full}"/>
     <property name="new.resource.java.class" value="${new.resource.java.class.package}.${new.resource.java.class.name}"/>
 
-    <copy todir="${yanel.source.home}/src/contributions/resources/${new.resource.name}">
+    <copy todir="${new-resource-types.home}/${new.resource.name}">
       <fileset dir="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template" excludes="build/**,src/java/**,src/test/**,interfaces/**,src/build/dependencies**,examples/**"/>
     </copy>
 
     <!-- Patch resource.xml -->
-    <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/resource.xml" value="${new.resource.name}">
+    <replace file="${new-resource-types.home}/${new.resource.name}/resource.xml" value="${new.resource.name}">
       <replacetoken>from-scratch</replacetoken>
     </replace>
-    <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/resource.xml" value="${new.resource.namespace}">
+    <replace file="${new-resource-types.home}/${new.resource.name}/resource.xml" value="${new.resource.namespace}">
       <replacetoken>http://foo.bar/yanel/resource/1.0</replacetoken>
     </replace>
-    <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/resource.xml" value="${new.resource.description}">
+    <replace file="${new-resource-types.home}/${new.resource.name}/resource.xml" value="${new.resource.description}">
       <replacetoken>From Scratch Resource Template</replacetoken>
     </replace>
-    <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/resource.xml" value="${new.resource.java.class}">
+    <replace file="${new-resource-types.home}/${new.resource.name}/resource.xml" value="${new.resource.java.class}">
       <replacetoken>bar.foo.yanel.impl.resources.FromScratchResource</replacetoken>
     </replace>
 
     <!-- Patch doc/index.html -->
-    <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/yanel-htdocs/doc/index.html" value="${new.resource.name}">
+    <replace file="${new-resource-types.home}/${new.resource.name}/yanel-htdocs/doc/index.html" value="${new.resource.name}">
       <replacetoken>from-scratch</replacetoken>
     </replace>
-    <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/yanel-htdocs/doc/index.html" value="${new.resource.namespace}">
+    <replace file="${new-resource-types.home}/${new.resource.name}/yanel-htdocs/doc/index.html" value="${new.resource.namespace}">
       <replacetoken>http://foo.bar/yanel/resource/1.0</replacetoken>
     </replace>
-    <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/yanel-htdocs/doc/index.html" value="${new.resource.description}">
+    <replace file="${new-resource-types.home}/${new.resource.name}/yanel-htdocs/doc/index.html" value="${new.resource.description}">
       <replacetoken>From Scratch Resource Template</replacetoken>
     </replace>
-    <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/yanel-htdocs/doc/index.html" value="${new.resource.java.class}">
+    <replace file="${new-resource-types.home}/${new.resource.name}/yanel-htdocs/doc/index.html" value="${new.resource.java.class}">
       <replacetoken>bar.foo.yanel.impl.resources.FromScratchResource</replacetoken>
     </replace>
 
     <!-- Patch build.properties -->
-    <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/build/build.properties" value="${new.resource.name}">
+    <replace file="${new-resource-types.home}/${new.resource.name}/src/build/build.properties" value="${new.resource.name}">
       <replacetoken>from-scratch</replacetoken>
     </replace>
 
     <!-- Patch build.xml -->
-    <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/build.xml" value="${new.resource.name}">
+    <replace file="${new-resource-types.home}/${new.resource.name}/build.xml" value="${new.resource.name}">
       <replacetoken>from-scratch</replacetoken>
     </replace>
 
@@ -82,11 +84,11 @@
         <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/java/bar/foo/yanel/impl/resources/FromScratchResource-empty.java" tofile="${new.resource.java.class.location}"/>
         <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/test/junit/bar/foo/yanel/impl/resources/FromScratchResourceTest.java" tofile="${new.resource.test.java.class.location}"/>
         <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/test/htmlunit/bar/foo/yanel/impl/resources/FromScratchResourceWebTest.java" tofile="${new.resource.webtest.java.class.location}"/>
-        <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/build/dependencies-with-javax.xml" tofile="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/build/dependencies.xml"/>
+        <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/build/dependencies-with-javax.xml" tofile="${new-resource-types.home}/${new.resource.name}/src/build/dependencies.xml"/>
         <replace file="${new.resource.java.class.location}" value="${new.resource.java.class.name}">
           <replacetoken>FromScratchResource</replacetoken>
         </replace>
-        <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/build/dependencies.xml" value="${new.resource.name}">
+        <replace file="${new-resource-types.home}/${new.resource.name}/src/build/dependencies.xml" value="${new.resource.name}">
           <replacetoken>FromScratchResource</replacetoken>
         </replace>
         <replace file="${new.resource.test.java.class.location}" value="${new.resource.java.class.name}">
@@ -185,14 +187,14 @@
 
         <echo>Creating resource based on template ${new.resource.java.example.implement}</echo>
         <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/examples/${new.resource.java.example.implement}/FromScratchResource.java" tofile="${new.resource.java.class.location}"/>
-        <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/examples/${new.resource.java.example.implement}/dependencies.xml" tofile="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/build/dependencies.xml"/>
+        <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/examples/${new.resource.java.example.implement}/dependencies.xml" tofile="${new-resource-types.home}/${new.resource.name}/src/build/dependencies.xml"/>
         <replace file="${new.resource.java.class.location}" value="${new.resource.java.class.name}">
           <replacetoken>FromScratchResource</replacetoken>
         </replace>
         <replace file="${new.resource.java.class.location}" value="${new.resource.java.class.package}">
           <replacetoken>bar.foo.yanel.impl.resources</replacetoken>
         </replace>
-        <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/build/dependencies.xml" value="${new.resource.name}">
+        <replace file="${new-resource-types.home}/${new.resource.name}/src/build/dependencies.xml" value="${new.resource.name}">
           <replacetoken>FromScratchResource</replacetoken>
         </replace>
       </then>
@@ -202,14 +204,14 @@
       <then>
         <echo message="Based on template xml" />
         <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/java/bar/foo/yanel/impl/resources/FromScratchResource-xml.java" tofile="${new.resource.java.class.location}"/>
-        <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/build/dependencies-with-yanel-impl.xml" tofile="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/build/dependencies.xml" overwrite="true"/>
+        <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/build/dependencies-with-yanel-impl.xml" tofile="${new-resource-types.home}/${new.resource.name}/src/build/dependencies.xml" overwrite="true"/>
         <replace file="${new.resource.java.class.location}" value="${new.resource.java.class.name}">
           <replacetoken>FromScratchResource</replacetoken>
         </replace>
         <replace file="${new.resource.java.class.location}" value="${new.resource.java.class.package}">
           <replacetoken>bar.foo.yanel.impl.resources</replacetoken>
         </replace>
-        <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/build/dependencies.xml" value="${new.resource.name}">
+        <replace file="${new-resource-types.home}/${new.resource.name}/src/build/dependencies.xml" value="${new.resource.name}">
           <replacetoken>FromScratchResource</replacetoken>
         </replace>
       </then>
@@ -219,20 +221,20 @@
       <then>
         <echo message="Based on template usecase" />
         <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/java/bar/foo/yanel/impl/resources/FromScratchResource-usecase.java" tofile="${new.resource.java.class.location}"/>
-        <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/build/dependencies-with-yanel-impl.xml" tofile="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/build/dependencies.xml" overwrite="true"/>
+        <copy file="${yanel.source.home}/src/build/targets/create-new-resource-type/from-scratch-resource-template/src/build/dependencies-with-yanel-impl.xml" tofile="${new-resource-types.home}/${new.resource.name}/src/build/dependencies.xml" overwrite="true"/>
         <replace file="${new.resource.java.class.location}" value="${new.resource.java.class.name}">
           <replacetoken>FromScratchResource</replacetoken>
         </replace>
         <replace file="${new.resource.java.class.location}" value="${new.resource.java.class.package}">
           <replacetoken>bar.foo.yanel.impl.resources</replacetoken>
         </replace>
-        <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/src/build/dependencies.xml" value="${new.resource.name}">
+        <replace file="${new-resource-types.home}/${new.resource.name}/src/build/dependencies.xml" value="${new.resource.name}">
           <replacetoken>FromScratchResource</replacetoken>
         </replace>        
       </then>
     </if>
 
     <!-- Help user to find out what he can do next -->
-    <echo>New resource type "${new.resource.name}" is now created!  Please note that to build it you can either keep using the integrated build system or directly use Eclipse: for details, please run `build -f ${yanel.source.home}/src/contributions/resources/${new.resource.name}/build.xml -p`.</echo>
+    <echo>New resource type "${new.resource.name}" is now created!  Please note that to build it you can either keep using the integrated build system or directly use Eclipse: for details, please run `build -f ${new-resource-types.home}/${new.resource.name}/build.xml -p`.</echo>
   </target>
 </project>



More information about the Yanel-commits mailing list