Skip to content
Kyrill Zotkin edited this page Sep 12, 2017 · 108 revisions

Usage

To use the ClassMaker, install it from update site and import to the Eclipse OSGi plug-in's dependencies.

To use the E4 DI, import javax.inject and org.eclipse.e4.core.di plug-ins and place the following client code:

@Inject
ClassMakerPlant classMaker;  
//...  
EPackage result = classMaker.make(dynamicEPackage);

The result variable will contain the EPackage generated in runtime. See also the sample.

Tests

To run the tests, install the JDK and Eclipse. Better, run Eclipse within workspace contained in the parent folder, because the ${../workspace_loc} folder will also be used (for junit-workspace).

Open the Git perspective, clone the https://github.com/enterpriseDomain/ClassMaker.git repository, import projects, and launch the JUnit Plug-in Test with Run As... context menu on org.enterprisedomain.classmaker.tests project.

The progress will be displayed in the Console View.

Build locally

Install eclipse, for example a package for RCP and RAP Developers for your platform.

Launch it with the workspace contained in the parent folder (see below) and open the Git perspective with the menu Window > Perspective > Open Perspective > Other....

Click Clone a Git repository. If in the wizard page Select Repository Source there are no GitHub entry, see below or install Eclipse GitHub integration with task focused interface feature from the EGit GitHub update site. On the next page Search the GitHub for repository by name, i.e. ClassMaker. On the next page, select the branch, and then choose the destination directory. Click Finish.

Alternatively, on the first page of Clone Git Repository wizard you can select a Clone URI and paste the https://github.com/enterpriseDomain/ClassMaker.git URL. The following steps are the same.

Right click on the newly cloned repository on the Git Repositories view and select the Import Projects... menu item. Select the root of Working Tree. On the next page you can choose specific projects. Select the leaf projects. org.enterprisedomain.classmaker from bundles folder and org.enterprisedomain.classmaker.target from releng are required to run the build.

org.enterprisedomain.classmaker.tests are also neccessary if you want to run tests.


Open org.enterprisedomain.classmaker.target.target file in org.enterprisedomain.classmaker.target project and click the "Set as Target Platform" link.

Next steps are the same as in other sections.

Headless build

If you want to run a build without launching the Eclipse UI, maybe the Ant CLI will be suffice. It uses Eclipse SDK to run PDE Build and launches org.eclipse.ant.core.antRunner application.

First, in Eclipse right-click the org.enterprisedomain.classmaker/plugin.xml, choose Plug-in Tools > Create Ant Build File.

Then go to http://download.eclipse.org/eclipse/downloads/. Choose version, preferrably the latest stable release. Download the "Eclipse SDK" for your platform and extract to directory. Open the command line cd to this dir and execute:

java -jar eclipse/plugins/org.eclipse.equinox.launcher_<version> -application org.eclipse.ant.core.antRunner -buildfile <path to ClassMaker repo>/bundles/org.enterprisedomain.classmaker/build.xml.

The results of the build should be in org.enterprisedomain.classmaker/@dot folder.

Troubleshooting

If in the Console appears exception like org.osgi.framework.BundleException: Could not resolve module, open the Run Configurations, select your launch configuration, go to Plug-ins tab, and in drop-down list Launch with select "plug-ins selected below only" instead of "all workspace and enabled target plug-ins". Then press the Deselect All button, check your plug-in and press the Add Required Plug-ins button. Press Apply.

Clone this wiki locally