changeset 61:0fe9ada37b0a

USASR-505: script to retrieve spring agent and add to run.jvmargs
author smith@nwoca.org
date Mon, 08 Aug 2011 14:56:33 -0400
parents 5bf585a38400
children 880f230dd947
files spring-ltw-ant.xml
diffstat 1 files changed, 50 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/spring-ltw-ant.xml	Mon Aug 08 14:56:33 2011 -0400
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="spring-ltw-ant"  basedir="." 
+    xmlns:ivy="antlib:fr.jayasoft.ivy.ant"
+    xmlns:ssdt="http://www.ssdt-ohio.org/ant/common"
+    xmlns:ssdtant="antlib:org.ssdt_ohio.tools.ant">
+
+
+    <ssdtant:add-dependency target="-pre-test-run" depends="-spring-ltw-init"/>
+    <ssdtant:add-dependency target="-pre-test-run-single" depends="-spring-ltw-init"/>
+    <ssdtant:add-dependency target="run-single" depends="-spring-ltw-init"/>
+    <ssdtant:add-dependency target="run-test-with-main" depends="-spring-ltw-init"/>
+    <ssdtant:add-dependency target="idea.prepare.test.run" depends="-spring-ltw-init"/>
+
+    <target name="-spring-ltw-init" depends="init,-spring-ltw-retrieve" unless="spring.ltw.disabled"> 
+      
+        <var name="runmain.jvmargs.spring" value="${runmain.jvmargs}"/>
+        <var name="runmain.jvmargs" value="${spring.agent.arg} ${runmain.jvmargs.spring}"/>  
+        <var name="runmain.jvmargs.spring" unset="true"/>
+        
+        <var name="run.jvmargs.spring" value="${run.jvmargs}"/>
+        <var name="run.jvmargs" value="${spring.agent.arg} ${run.jvmargs.spring}"/>  
+        <var name="run.jvmargs.spring" unset="true"/>
+        <echo message="enabled spring java agent: ${spring.agent.arg}"/>
+            
+    </target>
+    
+    <target name="-spring-ltw-retrieve" unless="spring.ltw.disabled">
+        <property name="spring.agent.org" value="org.springframework"/>
+        <property name="spring.agent.module" value="org.springframework.instrument"/>
+        <property name="spring.agent.revision" value="3.0.5.RELEASE"/>
+        <ivy:resolve resolveId="springagentid"
+                     organisation="${spring.agent.org}"
+                     module="${spring.agent.module}"
+                     revision="${spring.agent.revision}"
+                     type="jar"
+                     inline="true"
+                     keep="true"
+                     log="quiet"/>
+        <ivy:retrieve
+            resolveid="springagentid"
+            pattern="${basedir}/${build.dir}/${lib.dir}/spring-agent.[ext]"
+            type="jar"
+            log="quiet"/>
+            
+        <property name="spring.agent.arg" value="-javaagent:${build.dir}/${lib.dir}/spring-agent.jar"/>
+    </target>
+
+    
+
+</project>