Returns the Ant project, initializing it if necessary. @return the Ant project
()
| 77 | * @return the Ant project |
| 78 | */ |
| 79 | protected Project getProject() { |
| 80 | |
| 81 | if (project != null) { |
| 82 | return project; |
| 83 | } |
| 84 | |
| 85 | // Initializing project |
| 86 | project = new Project(); |
| 87 | logger = new JasperAntLogger(); |
| 88 | logger.setOutputPrintStream(System.out); |
| 89 | logger.setErrorPrintStream(System.err); |
| 90 | logger.setMessageOutputLevel(Project.MSG_INFO); |
| 91 | project.addBuildListener(logger); |
| 92 | if (System.getProperty(Constants.CATALINA_HOME_PROP) != null) { |
| 93 | project.setBasedir(System.getProperty(Constants.CATALINA_HOME_PROP)); |
| 94 | } |
| 95 | |
| 96 | if (options.getCompiler() != null) { |
| 97 | if (log.isTraceEnabled()) { |
| 98 | log.trace("Compiler " + options.getCompiler()); |
| 99 | } |
| 100 | project.setProperty("build.compiler", options.getCompiler()); |
| 101 | } |
| 102 | project.init(); |
| 103 | return project; |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Ant logger that captures compilation output for reporting. |
no test coverage detected