In this article, you will learn how to get started in setting up a development environment for Openflexo infrastructure, using Eclipse IDE.
Gradle is now used as production tool for the whole Openflexo infrastructure.
As a preliminary phase, you should:
Because of the use of Gradle as a build tool, you should verify if “BuildShip” comes with your Eclipse release.
Otherwise, you should install “BuildShip 2.0” or above.
To do that,
Switch to Git repository perspective.
Click on “Clone a Git repository”, to import source code from github (where openflexo source code is available)
At this step you must to fill the URI of the openflexo-dev repository which is https://github.com/openflexo-team/openflexo-dev or ssh://git@github.com/openflexo-team/openflexo-dev.git When you have filled the URI, the Host and Repository path are automatically setup, so just click on Next.
The next wizard presents the different branches associated with openflexo-dev project. Click Next
Select a local GIT directory, and click Finish
Switch back to “Java perspective”, right-click and select Import…
Select “Existing Gradle Project”, and click Next
Select Next on the following wizard.
Select your project root directory: here /Users/mac/GIT/openflexo-dev, and click Next
Select “Gradle wrapper” and click Next.
Click Finish.
Open “settings.gradle” file and comment all the “includeBuild” lines then save it.
Right click on openflexo-dev project, choose Gradle then Refresh Gradle Project.
Your project should be shown without errors. Contained projects should be visible in your workspace.
Do the same for Connie component, using https://github.com/openflexo-team/connie (branch/version 1.5.0.1)
After having imported the project in your workspace, you may experience some compilation issues, caused by some problems with gradle/eclipse integration.
You must first run “build” task for connie-parser, to generate and compile sablecc grammar.
Open a terminal in Connie repository folder then run this command: “ ./gradlew build “
Right click on openflexo-dev and from “Gradle” choose “refresh Gradle project”.
An other small issue might also appear: compilation issues in flexoutils project, in src/test/resources. In fact, those files are resources and should not be compiled. To exclude them from java build path, select those folders, right-click and select Build Path > Exclude.
Your Connie projects should all compile now.
In the same way you can import any other openflexo projects from the openflexo git repository. Project URIs are:
Note that the projects to import only depend on your needs. It is really rare that you need to modify all components of Openflexo infrastructure. You may develop on only one project. In this case, all other projects will be imported as jars from Openflexo artifactory.
Please also note that you always need to import OpenflexoBuildPlugin to be able to build any Openflexo component.
Branches to use should be consistent such as:
Components (development versions) | Branch 1.9.1 | Branch 2.0.0 | Branch 2.1.0 |
---|---|---|---|
OpenflexoBuildPlugin | 1.9.1 | 2.0.0 | 2.1.0 |
OpenflexoProduction | 0.5 | 0.5 | 0.5 |
Connie | 1.4.2 | 1.5 | 1.5.1 |
Pamela | 1.4.2 | 1.5 | 1.6 |
Gina | 2.1.2 | 2.2 | 2.2.1 |
Diana | 1.4.2 | 1.5 | 1.5.1 |
OpenflexoUtils | 1.4.2 | 1.5 | 1.5.1 |
OpenflexoCore | 1.9.1 | 2.0.0 | 2.1.0 |
TechnologyAdapters | 1.9.1 | 2.0.0 | 2.1.0 |
OpenflexoDiagram | N/A | 2.0.0 | 2.1.0 |
OpenflexoOWL | N/A | 2.0.0 | 2.1.0 |
OpenflexoEMF | N/A | 2.0.0 | 2.1.0 |
OpenflexoHTTP | 1.9.1 | 2.0.0 | 2.1.0 |
OpenflexoJDBC | 1.9.1 | 2.0.0 | 2.1.0 |
OpenflexoKafka | 1.9.1 | 2.0.0 | 2.1.0 |
OpenflexoOBP2 | N/A | 2.0.0 | 2.1.0 |
OpenflexoRhapsody | N/A | 2.0.0 | 2.1.0 |
OpenflexoModules | 1.9.1 | 2.0.0 | 2.1.0 |
OpenflexoPackaging | 1.9.1 | 2.0.0 | 2.1.0 |
Modelers (optional) | 1.9.1 | 2.0.0 | 2.1.0 |
IntegrationTests (opt) | 1.9.1 | 2.0.0 | 2.1.0 |
Here are the former versions of infrastructure:
Components (stable versions) | Branch 1.8.1 | Branch 1.9.0 |
---|---|---|
OpenflexoProduction | 0.5 | 0.5 |
Connie | 1.4 | 1.4.1 |
Pamela | 1.4 | 1.4.1 |
Gina | 2.1 | 2.1.1 |
Diana | 1.4 | 1.4.1 |
OpenflexoUtils | 1.4 | 1.4.1 |
OpenflexoCore | 1.8.1 | 1.9.0 |
TechnologyAdapters | 1.8.1 | 1.9.0 |
OpenflexoModules | 1.8.1 | 1.9.0 |
OpenflexoPackaging | 1.8.1 | 1.9.0 |
Modelers (optional) | 1.8.1 | 1.9.0 |
Warning: When importing OpenFlexoCore you will have to build a parser. Do as for Connie: * You must first run “build” task for fml-parser (in the gradle task view), to generate and compile sablecc grammar. * Then, refresh fml-parser project (Gradle>Refresh Gradle Project), and select build/generated-sources/sablecc folder. In needed, Right-click and select Build Path > Use as source folder.
Warning: Some errors may remain (We use some special Java features). You may have to change the eclipse preferences for the Java:Compiler:Errors/Warnings see below.
Finally your workspace should contains your set of imported projects.
To run on Eclipse an Openflexo packaging from openflexo-packaging project (both openflexo-packaging and openflexo-modules must be imported first), create a new Eclise Run Configuration. Set the project to one of the existing packagings(flexomaintainer, flexosemantics, flexosemanticsplus…) and the main class “org.openflexo.Flexo” (depending on the Eclipse version, searching feature does not find “org.openflexo.Flexo” class, so you have to enter it manually)
Set “dev” as a program arguments.
Open the “git perspective”, and right click on the project for which you want to push your commits, and select properties.
Depending on components you have downloaded on your environement, you may experience issues with Eclipse production, where dependancies are resolved using jars, and not projects that are checkouted in your environment.
Building 2.0 supports now this as composite builds.
To enable this, you should edit file “settings.gradle” located in openflexo-packaging project, and uncomment following lines:
file('../').listFiles().each { File otherProject -> if (!otherProject.equals(file('.')) && new File(otherProject, "build.gradle").exists()) { includeBuild otherProject } }
Then right click on “openflexo-packaging” project, and right click: Gradle > Refresh gradle project
All dependancies to projects located in your environment should now be correctely resolved.
Here are the standard configuration for save actions that are to be used in Openflexo developers team: