[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform] Re: Multiple classpath options?
|
Joe Zulli wrote:
Essentially, I'm looking for a creative way to solve this problem,
preferrably while writing as little code as possible. One thought (don't
know how feasible this is) is to write some plugin that modifies the
schema of the .classpath so that if both a dependent project and a jar
are specified (and somehow linked together) the dependent project will
be used if and only if it exists in the workspace.
Since 3.2M5a you can specify that a classpath entry is optional using IClasspathAttribute#OPTIONAL.
E.g.
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(IClasspathAttribute.OPTIONAL, "true");
IClasspathEntry projectEntry = JavaCore.newProjectEntry(new Path("/P"), null/*no access rules*/, false/*don't combine access rule*/, new IClasspathAttribute[] {attribute}, false/*not exported*/);
Or if you prefer to modify the .classpath file directly:
<classpathentry kind="src" path="/P">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
However while testing this, I discovered that the Java builder will still complain for optional projects.
This is going to be fixed for next integration build.
Jerome