ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laconia Data Systems" <webmas...@laconiadatasystems.com>
Subject Re: Suppressing DOS window when calling Ant from Java
Date Tue, 16 Nov 2004 01:06:34 GMT
start /B
Dont ask me how I know that-
Martin-
----- Original Message ----- 
From: "Sharad Jain" <s.jain@gtisoft.com>
To: <user@ant.apache.org>
Sent: Monday, November 15, 2004 6:00 PM
Subject: Suppressing DOS window when calling Ant from Java


> I am trying to embed Ant into my application.
> The following code gives me what I need.
> 
> executeAnt(String antfile, String target, PrintStream myOut, PrintStream 
> myErr, int logLevel)
> {
>         ProjectHelper helper = ProjectHelper.getProjectHelper();
>         Project project = new Project();
>         project.init();
> 
>         logger.setMessageOutputLevel(logLevel);
>         logger.setOutputPrintStream(myOut);
>         logger.setErrorPrintStream(myErr);
>         DefaultLogger logger = new DefaultLogger();
> //        CommonsLoggingListener logger = new CommonsLoggingListener();
>         project.addBuildListener(logger);
>         
>         helper.parse(project, new File(antfile));
>         project.executeTarget(target);
> }
> 
> I am able to get it working with proper logging etc.
> However, I have one annoyance that I cant get rid of.
> When I run this code on Windows machine, a command-windows flashes
> when project.executeTarget() gets called. I believe, this is because of 
> some kind
> of System.out / System.err binding that happens inside createLogger() of 
> Main.java ...
> 
> I know most IDE(s) (Eclipse/JBuilder) have AntRunner which are modified 
> version of
> Ant-Main.java and they are able to suppress DOS-window.
> I dont know how ?
> Any directions will be appreciated.
> Thanks,
> -sharad
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

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


Mime
View raw message