ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harkness, David" <DHarkn...@sonypictures.com>
Subject RE: Using the same targets across multiple platforms
Date Thu, 31 Jul 2003 01:26:03 GMT
Ant-contrib and Antelope both have <if> tasks that do what you want.
There have been several message regarding these external projects today
and yesterday.

However, another option would be to create a properties file for each OS
that sets the name of your shell/batch scripts. Then use the built-in
${os.name} property:

  <property file="build-${os.name}.properties"/>

This would simplify your build script I think.

David Harkness
Sony Pictures Digital Networks
(310) 482-4756


-----Original Message-----
From: Parnell, Giles (AU - Sydney)
[mailto:g.parnell@eclipsegroup.com.au] 
Sent: Wednesday, July 30, 2003 5:26 PM
To: 'user@ant.apache.org'
Subject: Using the same targets across multiple platforms


Hi there Guys

I am writing a build script using Ant1.5.2 for a jboss deployment. The
script needs to work across multiple platforms -ie: windows and solaris.
My problem is that in either environment I need to call different jboss
shell scripts -ie: run.bat or run.sh.

I don't want to have to write different targets for each environment as
it'll make the build script harder to maintain and far to long. I wanted
to use the ant 'if' statement but it appears to only apply to a target,
and what I really want is to be able to apply the if to specific exec
statements
- ie:

<target name="debugjboss" >		
	<!-- Only do if SOLARIS -->
	<exec dir="${bin}" executable="${bin}/run.sh">
		<arg line="-c ${projectName}"/>
		<env key="JAVA_OPTS" value="-remote debugging props/>
	</exec>

	<!-- Only do if WINDOWS -->
	<exec dir="${bin}" executable="${bin}/run.bat">
		<arg line="-c ${projectName}"/>
		<env key="JAVA_OPTS" value="-remote debugging props/>
	</exec>
</target>

This design essentially needs to be in place for all my targets. Does
anyone know a way of doing what I've described above, or a better way of
doing this? Any help muchly appreciated.

Regards
Giles

"...the opportunities that are proffered by corporate websites, web
advertising and email are too great to ignore", according to the
Australian Financial Review's 2003 Marketing Survey.

Eclipse can help you use new media to engage your customers. To find out
how, please contact Jamie Verco on 9322 5181 or 0408 202 203.


Giles Parnell |    ECLIPSEGROUP   |   02 9322 5124   |   Mobile 0403
768656

Level 9, 190 George Street, Sydney, NSW 2000, Fax: 02 9322 5121

> The Eclipse Group is a wholly owned subsidiary of Deloitte Touche 
> Tohmatsu
> 
www.eclipsegroup.com.au

This email and any files transmitted with it are confidential and
intended solely 
for the use of the individual or entity to whom they are addressed. 
If you are not the intended recipient of this email, you must not
disseminate, 
copy or otherwise use this information. If you have received this email
in error, please notify Eclipse Group immediately.







***********Confidentiality/Limited Liability Statement***************

This message contains privileged and confidential information intended
only for the use of the addressee named above.  If you are not the 
intended recipient of this message, you must not disseminate, copy or 
take any action in reliance on it.  If you have received this message 
in error, please notify Deloitte Touche Tohmatsu immediately.  Any 
views expressed in this message are those of the individual sender, 
except where the sender specifically states them to be the views of 
Deloitte.

The liability of Deloitte Touche Tohmatsu, is limited by, and to the 
extent of, the Accountants' Scheme under the Professional Standards 
Act 1994 (NSW).

The sender cannot guarantee that this email or any attachment to it 
is free of computer viruses or other conditions which may damage or
interfere with data, hardware or software with which it might be used.
It is sent on the strict condition that the user carries out and relies
on its own procedures for ensuring that its use will not interfere with
the recipients systems and the recipient assumes all risk of use and
absolves the sender of all responsibility for any consequence of its
use.


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


Mime
View raw message