Is it possible to call Ant or NSIS scripts from Java code?

后端 未结 4 1350
旧时难觅i
旧时难觅i 2020-11-29 09:15

Is it possible to call Ant or NSIS scripts programmatically from Java code at runtime? If so, how?

4条回答
  •  清歌不尽
    2020-11-29 09:21

    Too expand on Nivas' answer - his solution is correct, you are not seeing output from your program because you haven't attached any loggers to your project.

    DefaultLogger consoleLogger = new DefaultLogger();
    consoleLogger.setErrorPrintStream(System.err);
    consoleLogger.setOutputPrintStream(System.out);
    consoleLogger.setMessageOutputLevel(Project.MSG_INFO);
    p.addBuildListener(consoleLogger);
    

    This is just basic setup, theres alot more you can do with the Ant Java API.

提交回复
热议问题