ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koegel, Michael" <Michael.Koe...@partner.commerzbank.com>
Subject Setting Properties for Scripts
Date Wed, 13 Feb 2002 11:50:08 GMT
Hello,

I'm doing some jacl-Scripts in my build.xml for deployment. 
I want to check if the AppServer is running. If not I need to start it and
remember that I did.
Then a test-target is run. After that the stop-Target needs to stop the
AppServer if it was started earlier.
How can I transfer this information from one target to another?
The only way I found is via System Properties like shown below.
Isn't there an easier way to do this?

<project name="Test JACL" default="env_test" basedir=".">

    <target name="env_test" depends="set_env, get_env">
	    <property environment="env"/>
    </target>

    <target name="set_env">
	<property environment="env"/>
	<script language="jacl"> <![CDATA[
		package require java
		puts [java::call java.lang.System setProperty "foo" "bar"]
	]]> </script>
    </target>

    <target name="get_env">
	<property environment="env"/>
	<property name="foo" value="bar"/>
	<script language="jacl"> <![CDATA[
		package require java
		puts [java::call java.lang.System getProperty "foo"]
	]]> </script>
    </target>
</project>

Kind Regards,
 Michael Kögel


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message