Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Corona HowTo: Include a New Plugin in Build"

(For test plugins)
m (obsolete)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
=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 [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.corona/tests/org.eclipse.corona.tests.repository/test.xml?view=log the script in one of plugins].
 
 
For client side tests - see [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.corona/tests/org.eclipse.corona.tests.container.project.ui/test.xml?view=log 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>)''.
 
<blockquote>
 
<pre>
 
public static junit.framework.Test suite() {
 
    junit.framework.TestSuite suite = new junit.framework.TestSuite("An example suite");
 
    suite.addTestSuite(SomeTest.class);
 
    return suite;
 
}
 
</pre>
 
</blockquote>
 
* Copy [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.corona/tests/org.eclipse.corona.tests.repository/test.xml?view=log the example ant script] to your plugin as test.xml
 
* Modify the ''suite'' target:
 
<!--*# If you have UI test, uncomment the ''<ant target="ui-test"...'' and set property ''classname'' with the test suite class for UI tests.
 
*# Do the same for non-UI tests in ''<ant target="core-test"...''
 
-->
 
*# Now UI tests are not run because of technical problems, only server and non-UI client tests can be run
 
*# 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 [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.corona/features/ 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 [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.corona/maps/ 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
 
** the file is located in [http://dev.eclipse.org/viewcvs/indextech.cgi/org.eclipse.corona/maps/ org.eclipse.corona/build/internalBuildTools/testConfigs] in subfolder ''linux-local'' for client tests, or ''linux-local-server'' for server tests
 
** include target for the test (let the plugin name is ''org.eclipse.corona.tests.mytests'').
 
<blockquote>
 
<pre>
 
<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>
 
</pre>
 
</blockquote>
 
 
** enable the target in already existing target named ''all''
 
<blockquote>
 
<pre>
 
<target name="all">
 
...
 
<antcall target="mytests.test" />
 
...
 
</target>
 
</pre>
 
</blockquote>
 
 
=Check if the automated build works=
 
Verify if the currently configured build works correctly. The page [[Corona_Development_Build#Execution_of_Build_Scripts|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.
 
 
[[Category:Corona]]
 

Latest revision as of 10:51, 27 February 2008

Back to the top