Jump to: navigation, search

Corona HowTo: Include a New Plugin in Build

Revision as of 05:03, 25 April 2007 by Pawel.kaczmarek.compuware.com (Talk | contribs) (For test plugins)

Correct Plugin Structure

A Corona plugin is a regular Equinox plugin/fragment that conforms to Europa build practices. If a new plugin is created the following should be assured:

  • 4-part version numbering should be used, the first three parts are numbers, the last is "qualifier" word, for example: 0.5.0.qualifier. The "qualifier" is not used for plugins representing 3rd party.
  • plugin must correctly list its required JVM versions in the manifest/plugin.xml
  • build.properties file must list all files that should be included in the build result (the option bin.includes), if a jar file is included in Corona, but does not have IP approval, it should be excluded from build.properties.

For test plugins

Test plugins must be written in JUnit 3. JUnit 4 is not yet supported.

It is assumed that Corona tests are run on port 3300 and 3301. It is configured as described later.

The test plugin must have an ant script, which will run the test. Typically it is called test.xml and is placed in test plugin's root directory.

For server side tests - see the script in one of plugins.

For client side tests - see the script in one of plugins.


To add it to your plugin:

  • Make test suits - one for tests that require UI and/or second that do not need UI.
    Test suit may be any class that have a method public static junit.framework.Test suite(). The return object is junit.framework.TestSuite with all your test classes added. To add a test class, you need to invoke addTestSuite(<TestClass>).
public static junit.framework.Test suite() {
    junit.framework.TestSuite suite = new junit.framework.TestSuite("An example suite");
    suite.addTestSuite(SomeTest.class); 
    return suite; 
}
  • Copy the example ant script to your plugin as test.xml
  • Modify the suite target:
    1. Now UI tests are not run because of technical problems, only server and non-UI client tests can be run
    2. Set classname and vmargs properties to run Corona on required ports. Don't forget to check -Dcorona.type value

Modify Build

The following steps should be taken to include a new plugin in build:

  • add the plugin to Corona Client and/or Server feature (steps for adding to Corona client feature)
    • checkout feature projects from Technology CVS org.eclipse.corona/features/
    • open feature.xml in proper feature project - org.eclipse.corona.client, org.eclipse.corona.server, org.eclipse.corona.test.client or org.eclipse.test.corona.server
    • open feature.xml
    • on Plug-ins and fragments tab select Add and select the new plugin
    • then select Versions and select Synchronization options: "Copy versions from plug-in and fragment manifests"
    • save the feature.xml and commit to CVS
  • modify Corona maps for Corona client and/or server
    • the maps can be found in maps folder in CVS under org.eclipse.corona/maps
    • add a line that represents the plugin, the line must specify plugin/fragment, name and CVS access parameters analogously to other defined entries in maps.
  • If milestone version or 3rd party jars change it is necessary to modify files in the build folder (the folder is in Corona CVS)
    • in customTargets.xml modify getPlugins target, set the correct argument to wget of 3rd party jars OR
    • assure that download folder on the build machine contains a file named build.zip with all necessary 3rd party plugins and jars.

For Test Plugins

For test plugins, the following changes must be done in build:

  • add the plugin to Corona Client and/or Server test feature as described earlier
  • modify Corona maps for Corona client and/or server tests as described earlier
  • modify the appropriate test.xml file for client xor server
	<target name="mytests.test" description="Runs the org.eclipse.corona.tests.mytests test.xml">
		<antcall target="runtests">
			<param name="testPlugin" value="org.eclipse.corona.tests.mytests_0.8.0" />
			<param name="report" value="org.eclipse.corona.tests.mytests" />
		</antcall>
	</target>
    • enable the target in already existing target named all
	<target name="all">
		...
		<antcall target="mytests.test" />
		...
	</target>

Check if the automated build works

Verify if the currently configured build works correctly. The page Execution of Build Scripts describes how to run a automated build.

The page Corona_Development_Build describes steps to set up a new build environment or adjust existing one.