Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Cannot compile project using classes from a fragment

it's probably easier to use a build.properties entry

jars.extra.classpath=platform:/plugin/[YOUR_FRAGMENT_ID]

to the bundle which uses the API provided by your fragment.

AFAIK PDE has a MANIFEST header "Eclipse-ExtensibleAPI" for this:
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fbundle_manifest.html

but you need to add it to the host which is not possible in this case I assume (and it won't help for tycho).

Also see related https://bugs.eclipse.org/bugs/show_bug.cgi?id=353116 

Regards,
Jan

-----Original Message-----
From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of motes motes
Sent: Sonntag, 7. August 2011 22:19
To: Tycho user list
Subject: [tycho-user] Cannot compile project using classes from a fragment

I have created a parent project with some submodules:

http://download1322.mediafire.com/tz8ipgfqnimg/7e3i2z9vf55vb7b/my.zip

One of the submodules is a fragment that has org.eclipse.jface as
host. I have added a class MyTableViewerEditor to the package:

org.eclipse.jface.viewers

in the fragment and exported the package on the runtime tab.

In a plugin submodule I need to use the class MyTableViewerEditor. But
since its not possible to have a dependency on a fragment I have
added:

 	<classpathentry combineaccessrules="false" kind="src"
path="/my.fragment.jface"/>

to the .classpath in the bundle project. This works fine in the
eclipse IDE, but when I build it with tycho the type
MyTableViewerEditor cannot be found when the plugin is compiled:

[ERROR] C:\workspace_tycho_examples\my\my.plugin\src\my\plugin\Activator.java
(at line 3):[-1,-1]
[ERROR] import org.eclipse.jface.viewers.MyTableViewerEditor;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import org.eclipse.jface.viewers.MyTableViewerEditor
cannot be resolved

One possible workaround is to do the following:

1) Add the fragment to a feature and build a p2 site.
2) Add the p2 site to the target definition for the original project
and then build the project.

When doing the above the tycho build succeeds but maybe there is a
simpler way to build the project in one step (instead of having to
introduce a prebuild phase that creates the p2 site).

Any suggestions?
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top