Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Selective Compiling, is this possible?

Mikhail,

Actually, BundleA and BundleB contain only interfaces. No implementation classes. BundleB's interfaces extends the SpringData PagingAndSortingRepository interfaces and abstracts classes. Spring Data generates Implementation classes behind the scenes so I do not have to write them.

BundleA's interfaces only contain the methods that the tests need. This way they can be Mocked up a little easier. I was having trouble with Mockito and the SpringData stuff playing nicely together.

I think the scenario you mentioned above would be nice ( and I may be able to "re-architect" it in some manner ), but I am a little perplexed as to how it decides which bundle to compile with and If I have any control over that.

Thanks,
Neil




On Mon, Mar 31, 2014 at 12:18 PM, Mikhail Kalkov <mikhail.kalkov@xxxxxxxxxxxxxx> wrote:
Hi,

Do I understand correctly that you have two bundles expose the same package, which contains both java interface and implementation classes? This would explain why you want to control bundle selection at compile time. However, wouldn't it be better to move interface classes to a separate BundleD, and make both BundleA and BundleB provide implementation of interfaces from BundleD? Then there is no interface duplication and an appropriate implementation can be automatically selected at runtime.

Kind regards,
Mikhail Kalkov

Eclipse Developer | Purple Scout AB | www.purplescout.com
Kyrkogatan 20-22, SE-41110 Gothenburg, Sweden


On Mon, Mar 31, 2014 at 5:43 PM, Neil Corbet <neil.corbet@xxxxxxxxx> wrote:
Hello All,

I have a scenario where I need to make sure one bundle compiles against another.

Here is my scenario:

BundleA exposes package my.company.org.dao.  This bundle uses spring to create mock objects against interfaces in said package. These mock objects are exposed as services that a UnitTest bundle ( eclipse-test-plugin) uses strictly for unit testing a service implementation bundle.

BundleB exposes the same package my.company.org.dao. But these interfaces extend spring data PagingAndSortingRepository, which the mocking framework does not like.

BundleC imports package my.company.org.dao. I need this one to compile against BundleB and not BundleA.

When I built my product and installed it, I kept getting an error when using one of my services that a method was not found. It seems it was compiling BundleC against BundleA's dao package and not the ones in BundleB extending the spring data interfaces. BundleA is not in the feature that defines my product.

Is there a way to use the maven tycho compiler plugin to  compile against BundleB and not BundleA?

Thanks,

Neil

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



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



Back to the top