<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Modular Mind &#187; Builds</title>
	<atom:link href="http://www.modumind.com/category/builds/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.modumind.com</link>
	<description>Eclipse RCP and OSGi training - online or onsite</description>
	<lastBuildDate>Thu, 18 Feb 2010 19:07:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Updated PDE Build and Test Example</title>
		<link>http://www.modumind.com/2008/08/04/updated-pde-build-and-test-example/</link>
		<comments>http://www.modumind.com/2008/08/04/updated-pde-build-and-test-example/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 22:31:04 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Builds]]></category>
		<category><![CDATA[Rich Client Platform]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/?p=100</guid>
		<description><![CDATA[I&#8217;ve just spent some time updating my example showing how to set up PDE Build and the Eclipse Testing Framework. I&#8217;ve generally cleaned things up and I&#8217;m now creating the test environment in the correct way.
As a special bonus, I&#8217;ve also thrown in coverage analysis using EMMA. And before people ask, yes I have tried [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just spent some time updating my example showing how to set up PDE Build and the <a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/testframework.html?view=co">Eclipse Testing Framework</a>. I&#8217;ve generally cleaned things up and I&#8217;m now <a href="http://rcpquickstart.com/2008/08/01/creating-a-test-environment-for-the-eclipse-testing-framework/">creating the test environment in the correct way</a>.</p>
<p>As a special bonus, I&#8217;ve also thrown in coverage analysis using <a href="http://emma.sourceforge.net/">EMMA</a>. And before people ask, yes I have tried to use <a href="http://www.atlassian.com/software/clover/">Clover</a> with PDE Build, but have had little luck due to Clover&#8217;s dependence on a specialized Java complier. If anyone has gotten this to work, I&#8217;d love to hear about it.</p>
<p>And finally, I had to change this example to use a test plug-in instead of a test fragment. For some reason when running Eclipse 3.4 (maybe related to p2?), the ETF is not finding tests in fragments. If anyone has any ideas here as well, please let me know.</p>
<p>You can download the new example <a href="http://idisk.mac.com/pjpaulin-public/rcpquickstart/pdebuild-and-test-example.zip">here</a>.</p>
<p><em>NOTE: I&#8217;ve discovered that the EMMA instrumentation task fails if you&#8217;re running the script inside of Eclipse and you have spaces in your workspace path. Avoid spaces in your path and you should be good to go.</em></p>
<p><em>Update &#8211; October 6, 2009: The sample projects have now been updated to work with Eclipse 3.5.1</em></p>
<a href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a> <a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F08%2F04%2Fupdated-pde-build-and-test-example%2F&amp;linkname=Updated%20PDE%20Build%20and%20Test%20Example">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2008/08/04/updated-pde-build-and-test-example/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>Running Unit Tests for RCP and OSGi Applications</title>
		<link>http://www.modumind.com/2008/06/12/running-unit-tests-for-rcp-and-osgi-applications/</link>
		<comments>http://www.modumind.com/2008/06/12/running-unit-tests-for-rcp-and-osgi-applications/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 22:11:49 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Builds]]></category>
		<category><![CDATA[Rich Client Platform]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/?p=71</guid>
		<description><![CDATA[Eclipse provides great tools for testing RCP and OSGi applications using JUnit, but there a few areas that are problematic.

It&#8217;s not easy to run all the tests in a set of plug-ins. The test launcher allows you to run all the tests in a single project, but RCP and OSGi developers are usually working with [...]]]></description>
			<content:encoded><![CDATA[<p>Eclipse provides great tools for testing RCP and OSGi applications using JUnit, but there a few areas that are problematic.</p>
<ul>
<li>It&#8217;s not easy to run all the tests in a set of plug-ins. The test launcher allows you to run all the tests in a single project, but RCP and OSGi developers are usually working with a large set of test plug-ins. Sure it&#8217;s possible to create test suites, but keeping suites up-to-date is a real pain.</li>
<li>It&#8217;s not easy to use test fragments. To find out why you&#8217;d want to use test fragments instead of test plug-ins, check out my previous post on <a href="http://rcpquickstart.wordpress.com/2007/06/20/unit-testing-plug-ins-with-fragments/">Testing Plug-ins with Fragments</a>. The problem is that even the standard suite-based solution does not work with fragments. There are workarounds, but they&#8217;re not very pretty.</li>
<li>It&#8217;s not easy to run all of your tests during an automated build using the <a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/testframework.html?view=co">Eclipse Testing Framework</a>. This is related to the first point above, and again you can use suites to handle this. </li>
</ul>
<div>So to sum things up, I want to run sets of tests across multiple plug-ins or fragments and I don&#8217;t want to use suites. My solutions has been to create a simple bundle test collection plug-in that harvests unit tests based on a set of filters. To use the plug-in, you need to do the following:</div>
<div>
<ol>
<li><a href="http://idisk.mac.com/pjpaulin-public/rcpquickstart/bundletestcollector.zip">Download</a> the bundle test collector which is licensed under the standard <a href="http://www.eclipse.org/org/documents/epl-v10.html">EPL</a>. The archive contains the test collector plug-in and also an example plug-in showing proper usage.</li>
<li>Add the <code>com.rcpquickstart.bundletestcollector</code> plug-in to your workspace.</li>
<li>Create a plug-in that will contain a suite or set of suites that will load tests based on filters. The tests making up the suites will be generated dynamically, so you won&#8217;t need to maintain them. This plug-in will need to depend on the <code>com.rcpquickstart.bundletestcollector</code> and junit plug-ins, but that&#8217;s it.</li>
<li>In your suite, add the following method:
<pre class="brush: css">	public static Test suite() {
		BundleTestCollector testCollector = new BundleTestCollector();

		TestSuite suite = new TestSuite(&quot;All Tests&quot;);

		/*
		 * assemble as many collections as you like based on bundle, package and
		 * classname filters
		 */
		testCollector.collectTests(suite, &quot;com.mycompany.&quot;, &quot;com.mycompany.mypackage.&quot;,
				&quot;*Test&quot;);

		return suite;

	}</pre>
</li>
</ol>
</div>
<p> </p>
<p>You can then run the test suite both inside of the Eclipse IDE and using the Eclipse Testing Framework. I should note that this works only for JUnit 3.x tests. JUnit 4 describes suites using annotations which makes it (as far as I can tell) impossible to dynamically generate a suite at runtime. If anyone has a solution to this, I&#8217;d love to hear it. </p>
<p>As always, comments and fixes are much appreciated.</p>
<a href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a> <a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.modumind.com%2F2008%2F06%2F12%2Frunning-unit-tests-for-rcp-and-osgi-applications%2F&amp;linkname=Running%20Unit%20Tests%20for%20RCP%20and%20OSGi%20Applications">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2008/06/12/running-unit-tests-for-rcp-and-osgi-applications/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Running Automated Tests with PDE Build</title>
		<link>http://www.modumind.com/2007/08/06/running-automated-tests-with-pde-build/</link>
		<comments>http://www.modumind.com/2007/08/06/running-automated-tests-with-pde-build/#comments</comments>
		<pubDate>Mon, 06 Aug 2007 20:25:02 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Builds]]></category>
		<category><![CDATA[Rich Client Platform]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/08/06/running-automated-tests-with-pde-build/</guid>
		<description><![CDATA[In a previous post, I provided a set of projects that you could use to get a sample build running quickly. The idea was that getting your first build running is half the battle. From that point on, you can make small, incremental changes to accomplish what you like.
A common request I&#8217;ve received, though, is [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://rcpquickstart.wordpress.com/2007/06/06/getting-started-with-pde-build/">previous post</a>, I provided a set of projects that you could use to get a sample build running quickly. The idea was that getting your first build running is half the battle. From that point on, you can make small, incremental changes to accomplish what you like.</p>
<p>A common request I&#8217;ve received, though, is to provide a similar sample build that includes the running of JUnits using the <a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/testframework.html?view=co">Eclipse Test Framework</a>. Well  here it is! Just <a href="http://idisk.mac.com/pjpaulin-public/rcpquickstart/pdebuild-and-test-example.zip">download</a> and import the sample projects, and follow the directions in the included <code>readme.txt</code> file.</p>
<p><em>Note: If you want to run this sample build using Eclipse 3.2, you&#8217;ll need to work around a PDE Build <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=152577">defect</a>. For instructions on how to do this, check out the &#8220;Problems parsing feature file in a product build&#8221; section on the <a href="http://wiki.eclipse.org/index.php/PDEBuild">PDE Build wiki page</a>.</em></p>
<a href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a> <a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F08%2F06%2Frunning-automated-tests-with-pde-build%2F&amp;linkname=Running%20Automated%20Tests%20with%20PDE%20Build">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2007/08/06/running-automated-tests-with-pde-build/feed/</wfw:commentRss>
		<slash:comments>59</slash:comments>
		</item>
		<item>
		<title>RCP Obfuscation and File Sizes</title>
		<link>http://www.modumind.com/2007/07/13/obfuscation-and-file-sizes/</link>
		<comments>http://www.modumind.com/2007/07/13/obfuscation-and-file-sizes/#comments</comments>
		<pubDate>Fri, 13 Jul 2007 18:50:10 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Builds]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/07/13/obfuscation-and-file-sizes/</guid>
		<description><![CDATA[In response to my last post on obfuscation, Jeff McAffer asked if I had seen any space savings in the obfuscated code. Well l thought it would be an interesting exercise to run the numbers, and the results were surprising.
What follows is the list of plug-ins being obfuscated in my Market Contours application. A total [...]]]></description>
			<content:encoded><![CDATA[<p>In response to my <a href="http://rcpquickstart.wordpress.com/2007/06/22/obfuscating-an-rcp-application/">last post on obfuscation</a>, <a href="http://dev.eclipse.org/blogs/jeff">Jeff McAffer</a> asked if I had seen any space savings in the obfuscated code. Well l thought it would be an interesting exercise to run the numbers, and the results were surprising.</p>
<p>What follows is the list of plug-ins being obfuscated in my <a href="http://www.marketcontours.com">Market Contours</a> application. A total of 809 classes are obfuscated in one way or another (some have exclusions that protect class and method names). The obfuscation was done with <a href="http://www.zelix.com">Zelix KlassMaster</a> and line numbers were not scambled (scrambling line numbers can increase file sizes). So here are the numbers:</p>
<pre>
Plug-in							Before	After	Diff	% Diff</pre>
<pre>com.marketcontours.cache_1.0.0.200707122146.jar		5,103	5,679	576	11.29%
com.marketcontours.client_1.0.0.200707122146.jar	98,565	98,751	186	0.19%
com.marketcontours.context_1.0.0.200707122146.jar	102,159	93,646	-8,513	-8.33%
com.marketcontours.core_1.0.0.200707122146.jar		22,559	23,949	1,390	6.16%
com.marketcontours.data.text_1.0.0.200707122146.jar	18,404	20,097	1,693	9.20%
com.marketcontours.data.web_1.0.0.200707122146.jar	13,323	14,401	1,078	8.09%
com.marketcontours.data_1.0.0.200707122146.jar		26,926	28,042	1,116	4.14%
com.marketcontours.evaluation_1.0.0.200707122146.jar	176,009	180,630	4,621	2.63%
com.marketcontours.future_1.0.0.200707122146.jar	18,391	17,849	-542	-2.95%
com.marketcontours.resource_1.0.0.200707122146.jar	132,675	138,066	5,391	4.06%
com.marketcontours.result_1.0.0.200707122146.jar	28,213	27,802	-411	-1.46%
com.marketcontours.runtime_1.0.0.200707122146.jar	56,840	52,486	-4,354	-7.66%
com.marketcontours.stock_1.0.0.200707122146.jar		12,468	12,069	-399	-3.20%
com.marketcontours.ui.builder_1.0.0.200707122146.jar	98,212	95,134	-3,078	-3.13%
com.marketcontours.ui.chart_1.0.0.200707122146.jar	12,835	14,392	1,557	12.13%
com.marketcontours.ui.data.text_1.0.0.200707122146.jar	8,594	8,526	-68	-0.79%
com.marketcontours.ui.data.web_1.0.0.200707122146.jar	2,375	2,399	24	1.01%
com.marketcontours.ui.data_1.0.0.200707122146.jar	33,472	31,890	-1,582	-4.73%
com.marketcontours.ui.result_1.0.0.200707122146.jar	63,844	64,452	608	0.95%
com.marketcontours.ui.runtime_1.0.0.200707122146.jar	7,537	8,285	748	9.92%
com.marketcontours.ui.series_1.0.0.200707122146.jar	67,262	62,512	-4,750	-7.06%
com.marketcontours.ui.tradeshape_1.0.0.200707122146.jar	20,757	19,691	-1,066	-5.14%
com.marketcontours.ui_1.0.0.200707122146.jar		196,728	200,764	4,036	2.05%

Total change: 	-1,739	-0.14%</pre>
<p>The results show that this obfuscation resulted in little if any space savings, with some jars actually increasing in size. One reason for this is that there is a good deal of inter-plugin API which causes many package names to be excluded from obfuscation. This type of API is pretty typical of RCP applications, so it&#8217;s likely that they&#8217;re generally not going to shrink much during obfuscation. And then when you add the Eclipse plug-ins and a JRE to your distribution, the small size decrease will appear even smaller.</p>
<p>So in short, there are good reasons for obfuscating an RCP application, but decreasing the size of your distribution isn&#8217;t one of them.</p>
<a href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a> <a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F07%2F13%2Fobfuscation-and-file-sizes%2F&amp;linkname=RCP%20Obfuscation%20and%20File%20Sizes">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2007/07/13/obfuscation-and-file-sizes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Obfuscating an RCP Application</title>
		<link>http://www.modumind.com/2007/06/22/obfuscating-an-rcp-application/</link>
		<comments>http://www.modumind.com/2007/06/22/obfuscating-an-rcp-application/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 15:15:55 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Builds]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Rich Client Platform]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/22/obfuscating-an-rcp-application/</guid>
		<description><![CDATA[In this article I&#8217;m going to take you on a tour of the process I use to build a large-scale RCP application. Obfuscating an RCP application can seem like a big challenge, but it&#8217;s really not so bad.
 

Selecting an obfuscator
The first challenge is selecting the right tool for the job. The most important feature of [...]]]></description>
			<content:encoded><![CDATA[<p>In this article I&#8217;m going to take you on a tour of the process I use to build a large-scale RCP application. Obfuscating an RCP application can seem like a big challenge, but it&#8217;s really not so bad.</p>
<p> </p>
<p><span id="more-37"></span></p>
<h3>Selecting an obfuscator</h3>
<p>The first challenge is selecting the right tool for the job. The most important feature of an RCP application obfuscator (assuming it does a good job at obfuscating!) is that it can obfuscate multiple jars at the same time. Some tools expect you to obfuscate one jar at a time, and unless your RCP application contains only one jar, these tools will not work.</p>
<p>In my case, I chose a tool called <a href="http://www.zelix.com">Zelix Klassmaster</a>. This obfuscator handles multiple jars, and also integrates nicely into a build process managed by Ant scripts. The process I describe is based on Klassmaster. I&#8217;ve also heard that the open-source obfuscator <a href="http://proguard.sourceforge.net/">ProGuard</a> can handle multiple jars at the same time, but I haven&#8217;t tried this tool myself. If anyone manages to get a similar process working with ProGuard, I&#8217;d appreciate it if you&#8217;d let me know.</p>
<h3>The big picture</h3>
<p>The big picture for an obfuscation process includes all of the jars that are distributed with your application. These jars can then be divided into two categories: those that will be obfuscated and those that will not.</p>
<ul>
<li><em>Obfuscated</em> &#8211; Jars that make up your own proprietary plugins</li>
<li><em>Non-Obfuscated</em> &#8211; All third-party plugins and libraries, including the RCP plugins. This category may also include your own plugins that cannot be obfuscated for one reason or another.</li>
</ul>
<p>Zelix Klassmaster operates on these two sets of jars, loading them all into memory at the same time and then obfuscating only those in the first category.</p>
<h3>The build process</h3>
<p>An obfuscation process begins after an RCP product has been exported either by the Product Export Wizard or by an automated build process. The exported application is then obfuscated using an Ant script and a related Zelix script. The Ant script controls the process, and it has three functions:</p>
<ol>
<li>Create lists of jars and other parameters which are then substituted into the Zelix script.</li>
<li>Execute the <em>obfuscate</em> Ant task provided by the Zelix obfuscator.</li>
<li>Replace the original plugin jars with the new obfuscated jars.</li>
</ol>
<p>In the obfuscate Ant task, Zelix loads all of the plugin jars into memory and then obfuscates those in the list to be obfuscated. These jars are placed into a new folder (in my case a folder called &#8220;obfuscated&#8221;). These jars are then merged back into the plugin directory of the application.</p>
<p>Of course, if your plugins are not exported as jars, then this process will be a little more involved. Another good argument for migrating to the new packaging structure.</p>
<h3>Excluding package names &#8211; choosing a naming convention</h3>
<p>Exclusions are one of the trickiest part of obfuscating any application, and in particular an RCP application. A good general rule of thumb is that <em>any</em> class referenced in an extension or extension point should be excluded. This doesn&#8217;t mean that the code in the class won&#8217;t be obfuscated, but that <em>both the package and class names</em> associated with the class need to be excluded. I&#8217;ll deal with class names in a bit, but first I&#8217;d like to address the issue of package exclusion.</p>
<p>The important thing about package exclusion is that when you exclude a package name that is deep in your package hierarchy, you are <em>required</em> to exclude all other packages above it. This can make it difficult to exclude packages deep in your hierarchy without abandoning package name obfuscation entirely.</p>
<p>The solution I&#8217;ve come up with is to make a clear distinction between obfuscated and non-obfuscated packages in the package naming conventions I use. It turns out that this convention fits nicely with another naming convention used in the Eclipse code itself that separates code making up the public API from internal code. Basically, package names that can be obfuscated are always considered to be &#8220;internal&#8221; packages and will <em>never</em> contain classes referenced by extensions or extension points. Public packages are excluded from package name obfuscation and may contain excluded classes.</p>
<p>To make this convention as useful as possible (to allow as many packages to be obfuscated as possible), this distinction between public and internal needs to be made very high in the package structure. My convention differs from the Eclipse convention in that I make this branch even before the plugin name portion of the package structure. Here is an example of the convention I use.</p>
<ul>
<li><em>Public package</em> &#8211; com.marketcontours.plugin-name.subpackage</li>
<li><em>Obfuscated package</em> &#8211; com.marketcontours.internal.plugin-name.subpackage</li>
</ul>
<p>Of course, only public packages can be included in the &#8220;Exported Packages&#8221; list for a plugin. If you specify a package that will be obfuscated, the plugin will not be able resolve the package name at runtime. This is just one more reason to align the concepts of public/internal packages and non-obfuscated/obfuscated packages. And finally, by maximizing the amount of classes in internal packages (which is a good thing to do for many reasons), we can keep the amount of unobfuscated package names to a minimum.</p>
<h3>Excluding class names &#8211; a new properties file</h3>
<p>The second challenge is to exclude the names of classes and interfaces referenced by extensions and extension points. I&#8217;ve found that the easiest way to do this is to track the exclusions at the plugin level with a new properties file called <code>obfuscation.properties</code>. Whenever I need to add a new exclusion, I put it into this property file, and then at build time these exclusions are combined by Zelix into a master exclusion list. The exclusion format I use is particular to Zelix, and is meant to exclude both the package and class names of the classes in question. To see the details of what the exclusions look like, check out the sample properties file included in the download below.</p>
<p>Remember that you need to include any class referenced in either your <code>plugin.xml</code> or <code>manifest.mf</code> files. This includes the Plugin (or Activator) class, if you use one.</p>
<p>Also, for now, each <code>obfuscation.properties</code> file must be added by hand to the the Zelix script. So every time you create a new plugin, you&#8217;ll need to edit the script. One area for improvement would be to have the Ant script create the list of properties files at build time and substitute them into the Zelix script.</p>
<h3>Obfuscation and localization</h3>
<p>There are a few extra gotchas that need to be handled when obfuscating an RCP application. The main one is that your localization classes (if you are using the new NLS class) need to be excluded from obfuscation. Fortunately, this can be done with one exclusion in the Zelix script:<br />
<code><br />
exclude     *.* + extends org.eclipse.osgi.util.NLS;<br />
</code><br />
This line causes any class that extends the NLS class to be excluded from obfuscation.</p>
<p>A second issue also relates to NLS classes. When Zelix does flow-control obfuscation (for more information on this feature, see the Zelix site), it adds a static variable to various classes. This is usually not a problem, but with NLS classes it is. The NLS static initializer attempts to resolve the these static variables which it thinks are localized strings, and this initialization fails for these new variables added by Zelix. This doesn&#8217;t cause visible runtime problems, but it does pollute the logs. But again, this problem can be solved by adding a single exclude to the Zelix properties file:<br />
<code><br />
obfuscateFlowExclude *.* extends org.eclipse.osgi.util.NLS *;<br />
</code></p>
<h3>Try it for yourself</h3>
<p>That ends this brief summary of my obfuscation process. If you would like to try this out for yourself, you can download the scripts that I use. Applying them to your own build process should be pretty straightforward, but if you have any questions, feel free to <a href="mailto:patrick@rcpquickstart.com">ask me questions</a>.</p>
<p><a href="http://idisk.mac.com/pjpaulin-public/rcpquickstart/rcp-obfuscation-scripts.zip">Download obfuscation scripts</a></p>
<a href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a> <a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F22%2Fobfuscating-an-rcp-application%2F&amp;linkname=Obfuscating%20an%20RCP%20Application">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2007/06/22/obfuscating-an-rcp-application/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Getting started with PDE Build</title>
		<link>http://www.modumind.com/2007/06/06/getting-started-with-pde-build/</link>
		<comments>http://www.modumind.com/2007/06/06/getting-started-with-pde-build/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 17:10:28 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Builds]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Rich Client Platform]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/06/06/getting-started-with-pde-build/</guid>
		<description><![CDATA[I often work with teams getting started with Eclipse RCP, and the most common complaint I hear is that it&#8217;s too hard to set up automated builds. PDE Build can be frustrating to work with because it&#8217;s a black box. Your code goes in one side and a fully branded RCP application pops out the [...]]]></description>
			<content:encoded><![CDATA[<p>I often work with teams getting started with Eclipse RCP, and the most common complaint I hear is that it&#8217;s too hard to set up automated builds. PDE Build can be frustrating to work with because it&#8217;s a black box. Your code goes in one side and a fully branded RCP application pops out the other. But if something goes wrong inside the box, where do you start to debug?</p>
<p>In my opinion, the best way to work with PDE Build is to get a very simple build running in your environment. Then make small, incremental additions, verifying the integrity of the process after each change. So the immediate problem for a team becomes: <em>How do I get that first build running?</em></p>
<p>To help with this, I&#8217;ve put together a simple feature-based RCP product build. Just <a href="http://idisk.mac.com/pjpaulin-public/rcpquickstart/pdebuild-tutorial-1.zip">download</a> and import the sample projects. If you follow the instructions in the included <code>readme.txt</code> file, you should have a build running fairly quickly. Before you know it, you&#8217;ll be seeing that always elusive <code>BUILD SUCCESSFUL</code> message flash across your screen!</p>
<p><em>Note: If you want to run this sample build using Eclipse 3.2, you&#8217;ll need to work around a PDE Build <a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=152577">defect</a>. For instructions on how to do this, check out the &#8220;Problems parsing feature file in a product build&#8221; section on the <a href="http://wiki.eclipse.org/index.php/PDEBuild">PDE Build wiki page</a>.</em></p>
<p><em>Update &#8211; October 6, 2009: The sample projects have now been updated to work with Eclipse 3.5.1</em></p>
<a href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a> <a href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a> <a href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a> <a href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a> <a href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a> <a href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a> <a href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.modumind.com%2F2007%2F06%2F06%2Fgetting-started-with-pde-build%2F&amp;linkname=Getting%20started%20with%20PDE%20Build">Share/Save</a>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2007/06/06/getting-started-with-pde-build/feed/</wfw:commentRss>
		<slash:comments>279</slash:comments>
		</item>
	</channel>
</rss>
