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

michi at wyona.com michi at wyona.com
Tue Apr 21 09:52:31 CEST 2009


Author: michi
Date: 2009-04-21 09:52:30 +0200 (Tue, 21 Apr 2009)
New Revision: 42446

Modified:
   public/yanel/trunk/src/build/targets/resources.xml
Log:
prepare realms and resource-types configs such that it can be re-used more easily

Modified: public/yanel/trunk/src/build/targets/resources.xml
===================================================================
--- public/yanel/trunk/src/build/targets/resources.xml	2009-04-20 17:16:28 UTC (rev 42445)
+++ public/yanel/trunk/src/build/targets/resources.xml	2009-04-21 07:52:30 UTC (rev 42446)
@@ -35,6 +35,9 @@
       <classpath refid="classpath.taskdef.merge-resource-types-configs"/>
     </taskdef>
 
+    <antcall target="prepare-realms-config"/>
+    <antcall target="prepare-global-resource-types-config"/>
+
     <merge-resource-types-configs defaultrealmsconfigdir="${yanel.source.home}/conf/" localrealmsconfigdir="${local.config.home}/"/>
 
     <condition property="local.resource-types.config.exists">
@@ -48,6 +51,40 @@
     </replace>
   </target>
 
+  <target name="prepare-global-resource-types-config">
+    <if> <!-- See ant-contrib lib: http://ant-contrib.sourceforge.net/tasks/tasks/if.html -->
+      <available file="${local.config.home}/local.resource-types.xml" type="file"/>
+      <then>
+        <echo>INFO: Local resource-types file exists: ${local.config.home}/local.resource-types.xml</echo>
+        <copy file="${local.config.home}/local.resource-types.xml" tofile="${classes.dir}/resource-types.xml"/>
+      </then>
+      <else>
+        <echo>Local resource-types file does NOT exists</echo>
+        <copy file="${yanel.source.home}/conf/resource-types.xml" tofile="${classes.dir}/resource-types.xml"/>
+      </else>
+    </if>
+    <replace file="${classes.dir}/resource-types.xml" value="${yanel.source.home.forward.slashes}">
+      <replacetoken>@YANEL_SRC_DIR@</replacetoken>
+    </replace>
+  </target>
+
+  <target name="prepare-realms-config">
+    <if>
+      <available file="${local.config.home}/local.realms.xml" type="file"/>
+      <then>
+        <echo>INFO: Local realms file exists: ${local.config.home}/local.realms.xml</echo>
+        <copy file="${local.config.home}/local.realms.xml" tofile="${classes.dir}/realms.xml"/>
+      </then>
+      <else>
+        <echo>Local realms file does NOT exists</echo>
+        <copy file="${yanel.source.home}/conf/realms.xml" tofile="${classes.dir}/realms.xml"/>
+      </else>
+    </if>
+    <replace file="${classes.dir}/realms.xml" value="${yanel.source.home.forward.slashes}/src/realms">
+      <replacetoken>@REALMS_DIR@</replacetoken>
+    </replace>
+  </target>
+
   <target name="generate-resources-build-from-default" description="Generate resources build from default config" depends="init" unless="local.resource-types.config.exists">
     <xslt in="${yanel.source.home}/conf/resource-types.xml" out="../../build/build-resource-types.xml" style="yanel2resources.xsl" force="false">
       <param name="servlet.context.prefix" expression="${servlet.context.prefix}"/>



More information about the Yanel-commits mailing list