| Summary: | Make project classpath avaliable as variable | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | arne anka <eclipse-bugs> |
| Component: | Core | Assignee: | JDT Core Triaged <jdt-core-triaged> |
| Status: | RESOLVED WORKSFORME | QA Contact: | Jay Arthanareeswaran <jarthana> |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | amj87.iitr |
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
arne anka
Please feel free to contribute "trivial" enhancements yourself! Patches are always welcome. The Java build classpath (which is not always the same as the runtime classpath) is available through APIs such as JavaProject.getClasspath(); I am not sure what you mean by "as a variable" - surely you don't mean an environment variable, since there would have to be a different one for every project. Can you be more specific about exactly where and how you think the functionality should be exposed? Thanks! Jay, please follow up. Thanks! my past attempts to improve eclipse weren't successful. i don't fully understand the ideas behind many concepts and eclipse is rather complex.
to make the issue more clear:
i got several projects which eventually are build via ant buil files.
eg
<task name="build">
...
<path id="build.classpath">
<pathelement path="${build.classesdir}" />
<pathelement path="../foo/bar.jar />
<pathelement path="../bar/foo.jar />
...
</path>
...
<javac ...>
<classpath refid="build.classpath" />
</javac>
</task>
these path-element is basically a duplicate of the <classpath>-element in .classpath of the project.
if the classpath of the project is changed within eclipse (Properties->Java build Path) it has to be changed in the build.xml as well to be synchron.
it would be much easier if eclipse's ant plugin (or whatever part integrates ant) would expose the project's classpath to be used in the build.xml, something like
<task name="build">
...
<javac ...>
<classpath refid="eclipse.project.classpath" />
</javac>
</task>
eclipse exposes project specific information to ant anyway, why not the classpath -- be it as a variable or a dedicated task? (and not to speak of eclipse's "Variable Classpath Entries" which aren't available to ant at all)
in case somebody stumbles over this.
the fix is:
- preferences -> ant -> runtime -> properties
- add property project_classpath with value ${project_classpath} (which is an eclipse variable)
- new property project_classpath can be used in ANT build file
<path id="build.classpath">
<pathelement path="${build.classesdir}" />
<pathelement path="${project_classpath}" />
...
<path>
you can do the same with any eclipse variable (project_loc or workspace_loc may be helpful)
|