You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by rg...@apache.org on 2005/01/19 00:22:54 UTC

svn commit: r125564 - /forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/ForrestJob.java

Author: rgardler
Date: Tue Jan 18 15:22:53 2005
New Revision: 125564

URL: http://svn.apache.org/viewcvs?view=rev&rev=125564
Log:
improve logging
Modified:
   forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/ForrestJob.java

Modified: forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/ForrestJob.java
Url: http://svn.apache.org/viewcvs/forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/ForrestJob.java?view=diff&rev=125564&p1=forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/ForrestJob.java&r1=125563&p2=forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/ForrestJob.java&r2=125564
==============================================================================
--- forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/ForrestJob.java	(original)
+++ forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/ForrestJob.java	Tue Jan 18 15:22:53 2005
@@ -1,9 +1,3 @@
-/*
- * Created on 13-Dec-2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
 package org.apache.forrest.eclipse.job;
 
 import java.io.File;
@@ -20,19 +14,19 @@
 import org.apache.forrest.eclipse.preference.ForrestPreferences;
 import org.apache.log4j.Logger;
 import org.apache.log4j.xml.DOMConfigurator;
+import org.apache.tools.ant.Project;
 import org.eclipse.ant.core.AntRunner;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
+import org.osgi.framework.Bundle;
 
 /**
- * @author Ross Gardler
- * 
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
+ * An abstract Forrest job that provides utility methods for handling Eclipse based Forrest Jobs. 
  */
 public abstract class ForrestJob extends Job {
 	private static final String CONCURRENT_ANT_BUILDS = "Concurrent Ant builds are possible if you specify to build in a separate JRE.";
@@ -49,20 +43,21 @@
 	public static final int EXCEPTION_VALIDATION = 1010;
 
 	public static final int EXCEPTION_ANT_RUNNING = 1020;
-
+	
 	protected String workingDir;
 
 	/**
-	 * @param name
+	 * Create a new Forrest Job.
+	 * @param name of the job
 	 */
 	public ForrestJob(String name) {
 		super(name);
 
 		ForrestPlugin plugin = ForrestPlugin.getDefault();
 		URL urlPluginDir = plugin.getBundle().getEntry("/");
-		// FIXME: Make this path relative to the project 
-		String strLog4jConf = "D:\\projects\\burrokeet\\forrestplugin\\conf\\log4j.xml";
-		DOMConfigurator.configure(strLog4jConf);
+		Bundle bundle = Platform.getBundle(ForrestPlugin.ID);
+		URL log4jConf = Platform.find(bundle, new Path("conf/log4j.xml"));
+		DOMConfigurator.configure(log4jConf);
 	}
 
 	/**
@@ -90,6 +85,7 @@
 			AntRunner runner = new AntRunner();
 			runner.setCustomClasspath(getAntClasspath());
 			runner.addBuildListener(AntBuildListener.class.getName());
+			runner.setMessageOutputLevel(Project.MSG_INFO);
 			try {
 				runner.setBuildFileLocation(antFile);
 				runner.setArguments(cmdString);