I'll try this out. Thanks.
On Fri, 2002-03-22 at 16:10, Craig Minton wrote:
> Try calling Ant build by using the Project class:
>
> String buildXmlFile = "build.xml";
> File dir = new File( "E:/myproject" );
>
> Project pj = new Project( );
> pj.init( );
> // Add the default listener
>
> // Check the createLogger() method in Main.java
> pj.addBuildListener( createLogger( ) );
>
>
> try
> {
> File file = FileUtils.newFileUtils( ).resolveFile( dir,
> buildXmlFile );
> buildXmlFile = file.getAbsolutePath();
>
> pj.setBaseDir( dir );
> pj.setUserProperty( "basedir" , dir.getAbsolutePath( ) );
>
> // Set properties, if needed
> pj.setProperty( "user", user );
>
> // Add your build listeners, if needed
> pj.addBuildListener( new MyBuildListener( ) );
>
>
> File bldFile = new File ( buildXmlFile );
> pj.setUserProperty( "ant.file" , buildXmlFile );
> ProjectHelper.configureProject( pj, bldFile );
> }
> catch ( BuildException be )
> {
> be.printStackTrace( );
> }
> pj.executeTarget( buildTarget );
>
>
> -Craig
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, March 22, 2002 9:13 AM
> Subject: Ant Exiting?
>
>
> > If I use Ant in another Java application and call it via the 'start'
> > method on
> > Main, if the build fails the JVM is closed, i.e. so is the calling
> > application.
> >
> > Is there any way to call Ant without having System.exit called to
> > signify the end of execution.
> >
> > -John K
> >
> >
> > --
> > 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]>