Skip to content
Kyrill Zotkin edited this page Nov 5, 2021 · 108 revisions

Usage

To use the ClassMaker, install it from the 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 to injected class:

@Inject
ClassMakerService classMaker;  
//...  
EPackage result = (EPackage) classMaker.make(dynamicEPackage, progressMonitor);

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

In case, if client class is not injected, ClassMakerService could be imported like any ordinary OSGi service. See, for example, Lars Vogel's tutorial on how to do it.

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.

Also install Tycho.

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


Please, install the Target Platform DSL https://github.com/eclipse-cbi/targetplatform-dsl.

Find the org.enterprisedomain.target.tpd file in org.enterprisedomain.target project and select "Set as Target Platform" in it's context menu.

Next steps are the same as in other sections.

Tests

To run the tests, just 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 a Console View.

Headless build

If you want to run a build with Maven.

First, in Eclipse right-click the ClassMaker, choose Run As > Maven Build. Enter clean verify in Goals.

The results of the build should be in bundles/org.enterprisedomain.classmaker/target/site folder.

Troubleshooting

If an exception like org.osgi.framework.BundleException: Could not resolve module appears in the Console, 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