camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r647533 - in /activemq/camel/trunk/examples: camel-example-docs/build.xml camel-example-osgi/build.xml camel-example-spring-xquery/build.xml camel-example-spring/build.xml common_build.xml
Date Sun, 13 Apr 2008 07:07:19 GMT
Author: davsclaus
Date: Sun Apr 13 00:07:18 2008
New Revision: 647533

URL: http://svn.apache.org/viewvc?rev=647533&view=rev
Log:
CAMEL-46: Ant files to run the examples. Thanks to Peter Jones for the great patches.

Modified:
    activemq/camel/trunk/examples/camel-example-docs/build.xml
    activemq/camel/trunk/examples/camel-example-osgi/build.xml
    activemq/camel/trunk/examples/camel-example-spring-xquery/build.xml
    activemq/camel/trunk/examples/camel-example-spring/build.xml
    activemq/camel/trunk/examples/common_build.xml

Modified: activemq/camel/trunk/examples/camel-example-docs/build.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-docs/build.xml?rev=647533&r1=647532&r2=647533&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-docs/build.xml (original)
+++ activemq/camel/trunk/examples/camel-example-docs/build.xml Sun Apr 13 00:07:18 2008
@@ -17,7 +17,7 @@
   limitations under the License.
 -->
 
-<project name="camel-example-docs" default="run" basedir=".">
+<project name="camel-example-docs" default="camel.dot" basedir=".">
 
   <import file="../common_build.xml"/>
 
@@ -33,13 +33,9 @@
         <arg value="-duration"/>
         <arg value="2s"/>
         <arg value="-o"/>
-        <arg value="${build.dir}/site/cameldoc"/>
+        <arg value="${cameldoc.dir}"/>
       </arguments>
     </camelrun>
-    <generatedot dotFileDir="${build.dir}/site/cameldoc/main" outputType="svg"/>
-    <generatedot dotFileDir="${build.dir}/site/cameldoc/main" outputType="cmapx"/>
-    <generatedot dotFileDir="${build.dir}/site/cameldoc/otherRoutes" outputType="svg"/>
-    <generatedot dotFileDir="${build.dir}/site/cameldoc/otherRoutes" outputType="cmapx"/>
   </target>
 
 </project>

Modified: activemq/camel/trunk/examples/camel-example-osgi/build.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-osgi/build.xml?rev=647533&r1=647532&r2=647533&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-osgi/build.xml (original)
+++ activemq/camel/trunk/examples/camel-example-osgi/build.xml Sun Apr 13 00:07:18 2008
@@ -33,7 +33,7 @@
         <arg value="-duration"/>
         <arg value="8s"/>
         <arg value="-o"/>
-        <arg value="${build.dir}/site/cameldoc"/>
+        <arg value="${cameldoc.dir}"/>
       </arguments>
     </camelrun>
   </target>

Modified: activemq/camel/trunk/examples/camel-example-spring-xquery/build.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-xquery/build.xml?rev=647533&r1=647532&r2=647533&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-spring-xquery/build.xml (original)
+++ activemq/camel/trunk/examples/camel-example-spring-xquery/build.xml Sun Apr 13 00:07:18
2008
@@ -46,7 +46,7 @@
         <arg value="-duration"/>
         <arg value="2s"/>
         <arg value="-o"/>
-        <arg value="${build.dir}/site/cameldoc"/>
+        <arg value="${cameldoc.dir}"/>
       </arguments>
     </camelrun>
   </target>

Modified: activemq/camel/trunk/examples/camel-example-spring/build.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring/build.xml?rev=647533&r1=647532&r2=647533&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-spring/build.xml (original)
+++ activemq/camel/trunk/examples/camel-example-spring/build.xml Sun Apr 13 00:07:18 2008
@@ -40,7 +40,7 @@
         <arg value="-duration"/>
         <arg value="2s"/>
         <arg value="-o"/>
-        <arg value="${build.dir}/site/cameldoc"/>
+        <arg value="${cameldoc.dir}"/>
       </arguments>
     </camelrun>
   </target>

Modified: activemq/camel/trunk/examples/common_build.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/examples/common_build.xml?rev=647533&r1=647532&r2=647533&view=diff
==============================================================================
--- activemq/camel/trunk/examples/common_build.xml (original)
+++ activemq/camel/trunk/examples/common_build.xml Sun Apr 13 00:07:18 2008
@@ -23,6 +23,7 @@
   <property name="build.dir" location="${basedir}/target"/>
   <property name="build.classes.dir" location="${build.dir}/classes"/>
   <property name="build.test.classes.dir" location="${build.dir}/test-classes"/>
+  <property name="cameldoc.dir" location="${build.dir}/site/cameldoc"/> 
   
   <property name="build.src.dir" location="${basedir}/src/main/java"/>
   <property name="build.test.dir" location="${basedir}/src/test/java"/>
@@ -156,41 +157,43 @@
         <arguments/> 
         <sysproperty key="java.util.logging.config.file" value="${build.classes.dir}/logging.properties"/>
       </java>
+  
+      <condition property="has.cameldoc">
+        <available file="${cameldoc.dir}"/>
+      </condition>
     </sequential>
   </macrodef>
   
-  <condition property="shell.command" value="cmd.exe">
-    <os family="windows"/>
-  </condition>
-  <property name="shell.command" value="/bin/bash"/>
   <condition property="shell.suffix" value=".exe">
     <os family="windows"/>
   </condition>
   <property name="shell.suffix" value=""/>
-  <condition property="shell.arg" value="/c">
-    <os family="windows"/>
-  </condition>
-  <property name="shell.arg" value="-c"/>
-  <!-- Define shell.file because dot on windows doesn't seem to
-       like the wildcard "*.dot". -->
-  <condition property="shell.file" value="routes.dot">
-    <os family="windows"/>
-  </condition>
-  <property name="shell.file" value="*.dot"/>
   
   <!-- This macro assumes the dot executable is on your path. -->
-  <macrodef name="generatedot">
-    <attribute name="dotFileDir"/>
-    <attribute name="dotFile" default="${shell.file}"/>
+  <macrodef name="cameldot">
+    <attribute name="dotFileDir" default="${cameldoc.dir}"/>
     <attribute name="outputType" default="svg"/>
     <sequential>
-      <exec executable="${shell.command}">
-        <arg value="${shell.arg}"/>
-        <arg value="dot${shell.suffix} -T @{outputType} -O @{dotFileDir}/@{dotFile}"/>
-      </exec>
+      <apply executable="dot${shell.suffix}">
+        <arg value="-T@{outputType}"/>
+        <arg value="-O"/>
+        <fileset dir="@{dotFileDir}">
+          <patternset>
+            <include name="**/*.dot"/>
+          </patternset>
+        </fileset>
+      </apply>
     </sequential>
   </macrodef>
-
+  
+  <target name="camel.dot" depends="run" if="has.cameldoc" 
+    description="Output visualization">
+    <cameldot outputType="svg"/>
+    <!--
+    <cameldot outputType="cmapx"/>
+    -->
+  </target>
+  
   <target name="clean">
     <delete dir="${build.test.classes.dir}"/>
     <delete dir="${build.classes.dir}"/>



Mime
View raw message