View | Details | Raw Unified | Return to bug 35237
Collapse All | Expand All

(-)antadapter/org/eclipse/jdt/core/JDTCompilerAdapter.java (-3 / +9 lines)
Lines 41-47 Link Here
41
 * @since 2.0
41
 * @since 2.0
42
 */
42
 */
43
public class JDTCompilerAdapter extends DefaultCompilerAdapter {
43
public class JDTCompilerAdapter extends DefaultCompilerAdapter {
44
	private static String compilerClass = "org.eclipse.jdt.internal.compiler.batch.Main"; //$NON-NLS-1$
44
	private static String compilerClass = "org.eclipse.jdt.internal.compiler.batch.Main"; String logFileName;
45
	//$NON-NLS-1$
45
	/**
46
	/**
46
	 * Performs a compile using the JDT batch compiler 
47
	 * Performs a compile using the JDT batch compiler 
47
	 */
48
	 */
Lines 55-61 Link Here
55
			Object batchCompilerInstance = batchCompilerConstructor.newInstance(new Object[] {new PrintWriter(System.out), new PrintWriter(System.err), new Boolean(true)});
56
			Object batchCompilerInstance = batchCompilerConstructor.newInstance(new Object[] {new PrintWriter(System.out), new PrintWriter(System.err), new Boolean(true)});
56
			Method compile = c.getMethod("compile", new Class[] {String[].class}); //$NON-NLS-1$
57
			Method compile = c.getMethod("compile", new Class[] {String[].class}); //$NON-NLS-1$
57
			Object result = compile.invoke(batchCompilerInstance, new Object[] { cmd.getArguments()});
58
			Object result = compile.invoke(batchCompilerInstance, new Object[] { cmd.getArguments()});
58
			return ((Boolean) result).booleanValue();
59
			final boolean resultValue = ((Boolean) result).booleanValue();
60
			if (!resultValue && verbose) {
61
				System.out.println(Util.bind("ant.jdtadapter.error.compilationFailed", this.logFileName));
62
			}
63
			return resultValue;
59
		} catch (ClassNotFoundException cnfe) {
64
		} catch (ClassNotFoundException cnfe) {
60
			throw new BuildException(Util.bind("ant.jdtadapter.error.missingJDTCompiler")); //$NON-NLS-1$
65
			throw new BuildException(Util.bind("ant.jdtadapter.error.missingJDTCompiler")); //$NON-NLS-1$
61
		} catch (Exception ex) {
66
		} catch (Exception ex) {
Lines 232-238 Link Here
232
			 * extra option allowed by the Eclipse compiler
237
			 * extra option allowed by the Eclipse compiler
233
			 */
238
			 */
234
			cmd.createArgument().setValue("-log"); //$NON-NLS-1$
239
			cmd.createArgument().setValue("-log"); //$NON-NLS-1$
235
			cmd.createArgument().setValue(destDir.getAbsolutePath() + ".log"); //$NON-NLS-1$
240
			logFileName = destDir.getAbsolutePath() + ".log";
241
			cmd.createArgument().setValue(logFileName); //$NON-NLS-1$
236
		}
242
		}
237
243
238
		/*
244
		/*
(-)model/org/eclipse/jdt/internal/core/messages.properties (+1 lines)
Lines 229-231 Link Here
229
ant.jdtadapter.error.missingJRELIB = Cannot bind the JRE_LIB variable. To solve this problem, you can either set the JRE_LIB variable or use the bootclasspath parameter in your ant javac task
229
ant.jdtadapter.error.missingJRELIB = Cannot bind the JRE_LIB variable. To solve this problem, you can either set the JRE_LIB variable or use the bootclasspath parameter in your ant javac task
230
ant.jdtadapter.error.ignoringMemoryInitialSize= Since fork is false, ignoring memoryInitialSize setting
230
ant.jdtadapter.error.ignoringMemoryInitialSize= Since fork is false, ignoring memoryInitialSize setting
231
ant.jdtadapter.error.ignoringMemoryMaximumSize= Since fork is false, ignoring memoryMaximumSize setting
231
ant.jdtadapter.error.ignoringMemoryMaximumSize= Since fork is false, ignoring memoryMaximumSize setting
232
ant.jdtadapter.error.compilationFailed = Compilation failed. Compiler errors are available in {0}

Return to bug 35237