Skip to main content



      Home
Home » Archived » Buckminster » Exclude test classes from jar file
Exclude test classes from jar file [message #758788] Thu, 24 November 2011 09:51 Go to next message
Eclipse UserFriend
Given a plug-in which consists of two source folders "src" and "test". How do I exclude the test classes from ending up in the generated jar file?

I tried to achieve that via excludes in "build.properties" but without success. Any hints?
Re: Exclude test classes from jar file [message #758793 is a reply to message #758788] Thu, 24 November 2011 10:09 Go to previous messageGo to next message
Eclipse UserFriend
Your starting point is the problem. We don't put our source and test code in the same plugin. Instead, for each plugin we have a separate test fragment (http://rcpquickstart.com/2007/06/20/unit-testing-plug-ins-with-fragments/).

Our feature projects (for the products we build) do NOT include the test fragments, which means test code does not get included in the built product. However, each host plugin has a buckminster.cspex which lists the test fragment as a dependency - note however that it's NOT listed in the manifest as a plugin dependency. This ensures that that when a developer checks out (materializes) a plugin, they also get the associated test fragment.

Hope that helps
Matthew
Re: Exclude test classes from jar file [message #758864 is a reply to message #758793] Thu, 24 November 2011 14:53 Go to previous messageGo to next message
Eclipse UserFriend
Another thought on test plug-in organization. We have test plug-ins also as fragments but we have a test feature that complements each non-test feature, and the test feature provides the test plug-in fragments. Our 'site' feature which contains the cquery and rmap includes the top level application feature and the top level test feature. Thus, when you materialize with the cquery, you get the plug-ins and the test fragments.

Also you can set the eclipse preferences to display missing plug-ins from a feature as errors, so as a developer, you know if you are missing any test plug-ins.

Alan
Re: Exclude test classes from jar file [message #758914 is a reply to message #758864] Fri, 25 November 2011 03:53 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for sharing your set-up Alan. That's quite a neat way of doing it.
Matthew
Re: Exclude test classes from jar file [message #758941 is a reply to message #758914] Fri, 25 November 2011 06:06 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the responses.

Yes, I was also thinking about using test fragments. And it seems when using Buckminster this is the proper way.
The only side-effect that I don't like is that the number of projects grow.

Bernhard
Re: Exclude test classes from jar file [message #758975 is a reply to message #758941] Fri, 25 November 2011 07:45 Go to previous message
Eclipse UserFriend
On 2011-11-25 12:06, Bernhard Lutzmann wrote:
> Thanks for the responses.
>
> Yes, I was also thinking about using test fragments. And it seems when using Buckminster this is the proper way.
> The only side-effect that I don't like is that the number of projects grow.
>
I would consider that a good sign. ;-)

- thomas
Previous Topic:How can I materialize both: target platform and source code into workspace in one go?
Next Topic:"The resource is a duplicate ... and was not copied to the output folder"
Goto Forum:
  


Current Time: Sat Jul 12 12:40:06 EDT 2025

Powered by FUDForum. Page generated in 0.07722 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top