BR, this is very helpful! It worked for me in both places! But just one question on it: it assumes org.eclipse.pde.internal.core.JDTCompilerAdapter is available as long as org.eclipse.core.launcher.Main is available. I am not familiar with eclipse at all, is there a dependency among the two?
gratefully, Bianca -----Original Message----- From: Jan Søgaard [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 11:29 AM To: Ant Users List Subject: RE: How to tell if a Ant build script is running in Eclipse? Hi. I am not using Eclipse directly, but I am using Websphere Studio Application Developer. I got the smae problem, byt I found a way around it. By setting the following in a init target, I am abel to run Ant both inside and outside WSAD: <!-- eclipse stuff --> <available classname="org.eclipse.core.launcher.Main" property="build.compiler" value="org.eclipse.pde.internal.core.JDTCompilerAdapter" classpath="${java.class.path}"/> BR Jan -----Original Message----- From: Jiang, Bianca [mailto:[EMAIL PROTECTED]] Sent: 19. februar 2002 17:17 To: 'Ant Users List' Subject: RE: How to tell if a Ant build script is running in Eclipse? <Err... as I recal, anything in the *.internal.* packages are considered off limits. There are *no* guarantees about API stability or even class existence in the future. Unless they've changed things significantly since I was working on Eclipse. Is there a less brittle way of getting at that adapter?> Any answers to Glenn's question there? Bianca -----Original Message----- From: Glenn A. McAllister [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 16, 2002 10:50 PM To: Ant Users List Subject: Re: How to tell if a Ant build script is running in Eclipse? On Sun, 17 Feb 2002, dIon Gillard wrote: > Jiang, Bianca wrote: > > >I had this compiler problem when running Ant in Eclipse. Then found > >the workaround of adding one property to the build file to make it work: > ><property name="build.compiler" > >value="org.eclipse.pde.internal.core.JDTCompilerAdapter"/> > > > >But it's only helps if the script is generic and can > >work the same both in and out Eclipse. So anybody > >knows if there is a way to check if the build script > >is running inside Eclipse or not so that can set the > >property conditionally? > > > I posted a few ant targets to do exactly that on the eclipse newsgroups > a few months ago. Bottom line, use a target to set a property based on > whether the class org.eclipse.pde.internal.core.JDTCompilerAdapter > exists (check_wsad target). Use that property on the 'if' of the target > that sets build.compiler, as above (set_compiler target). Make init > dependent on the set_compiler target. > > Err... as I recal, anything in the *.internal.* packages are considered off limits. There are *no* guarantees about API stability or even class existence in the future. Unless they've changed things significantly since I was working on Eclipse. Is there a less brittle way of getting at that adapter? Glenn McAllister SOMA Networks, Inc. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>