Title: RE: relative paths
 
----- Original Message -----
Cc: jde
Sent: Monday, August 13, 2001 3:07 PM
Subject: RE: relative paths

We have a large system composed by frameworks and client/server applications; these individual projects share many library and output directories, hence the need for deep directory structures.

The point is that the contents of the environment variables must be changed to reflect the directory/drive mapping of the current project. Just re-evaluating the environment variable is necessary but not sufficient; a new value must be calculated (based on the project path) and assigned to the variable *before* the variable is evaluated by JDE. This is where the defadvice is helpful; it allows me to do just that.

Here is a scenario:
1) working on project A, PRJ_ROOT variable set to A:/my_proj
2) change to a file in project B
3) project is loaded, triggering defadvice (before load), which changes the contents of PRJ_ROOT to B:/my_proj
4) environment variables are evaluated to set the jde variables, leading to the desired B:/my_proj/lib/... paths.

Is there a different way to do that without using defadvice? This approach also gives you the flexibility to change any other environment variable on a per project basis, like the name of a log output file, or a temporary drive or machine name. Things like that can't be solved by relative paths.

Use jde-entering-java-buffer-hook. Functions on this hook get invoked every time you open or activate a Java buffer. See jde-reload-project-file for how to detect if the new buffer corresponds to a different project.
 
- Paul

Reply via email to