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 2004/07/30 18:37:37 UTC

svn commit: rev 30998 - forrest/trunk/scratchpad/eclipsePlugin/src/org/apache/forrest/eclipse/actions

Author: rgardler
Date: Fri Jul 30 09:37:37 2004
New Revision: 30998

Modified:
   forrest/trunk/scratchpad/eclipsePlugin/src/org/apache/forrest/eclipse/actions/StartForrest.java
Log:
Use new directory structure

Modified: forrest/trunk/scratchpad/eclipsePlugin/src/org/apache/forrest/eclipse/actions/StartForrest.java
==============================================================================
--- forrest/trunk/scratchpad/eclipsePlugin/src/org/apache/forrest/eclipse/actions/StartForrest.java	(original)
+++ forrest/trunk/scratchpad/eclipsePlugin/src/org/apache/forrest/eclipse/actions/StartForrest.java	Fri Jul 30 09:37:37 2004
@@ -85,7 +85,7 @@
 		String fhome = ForrestPlugin.getDefault().getPluginPreferences()
 				.getString(ForrestPreferences.FORREST_HOME);
 
-		// TODO: Working diretory should not be a property it should be whatever directory project Forrest is currently working with
+		// TODO: Working diretory should not be a property it should be whatever project directory Eclipse is currently working with
 		String wdir = ForrestPlugin.getDefault().getPluginPreferences()
 				.getString(ForrestPreferences.WORKING_DIR);
 		
@@ -154,14 +154,18 @@
 			// specify classpath
 			List classpath = new ArrayList();
 
-			String sPath = fhome + File.separator + "lib";
+			String parent = ".." + File.separator;
+			
+			String sPath = fhome + File.separator + parent + parent + "lib";
 			File searchDir = new File(sPath);
-			File jettyDir = new File(fhome + File.separator + "tools"
+			File forrestBuildDir = new File(fhome + File.separator + parent + parent + "build");
+			File jettyDir = new File(fhome + File.separator + parent + parent + "tools"
 					+ File.separator + "jetty");
 
 			try {
 				//FIXME: check that the search directory exists, if it doesn't eclipse throws an unhandled loop exception
 				List allfiles = Utilities.getFileListing(searchDir);
+				allfiles.addAll(Utilities.getFileListing(forrestBuildDir));
 				allfiles.addAll(Utilities.getFileListing(jettyDir));
 				Iterator filesListing = allfiles.iterator();
 				String thisFile;
@@ -191,10 +195,10 @@
 			workingCopy.setAttribute(ATTR_DEFAULT_CLASSPATH, false);
 
 			// specify working diretory
-			File workingDir = workingDirectory.append("build").append("webapp")
-					.toFile();
-			workingCopy.setAttribute(ATTR_WORKING_DIRECTORY, workingDir
-					.getAbsolutePath());
+			workingCopy.setAttribute(ATTR_WORKING_DIRECTORY, wdir);
+			
+			workingCopy.setAttribute(ATTR_VM_ARGUMENTS, "-Dproject.home=\"" + wdir.toString() + "\"");
+			workingCopy.setAttribute(ATTR_VM_ARGUMENTS, "-Dforrest.home=\"" + fhome.toString() + "\"");
 
 			ILaunchConfiguration configuration = workingCopy.doSave();
 			IProgressMonitor monitor = new NullProgressMonitor();
@@ -207,6 +211,7 @@
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
+		
 	}
 
 	/**