Skip to main content

Setup the development environment for Openflexo using Eclipse

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.

1. Get eclipse, and configure your enviroment

As a preliminary phase, you should:

Components (development versions)    1.9.1        2.0.0        2.0.1        2.0.2        2.99        3.0.0        2.2.0    
Java versionJava 8Java 8Java 8Java 8Java 8Java 11Java 11
OpenflexoBuildConfig0.20.20.20.20.30.30.4 ? (modules)
OpenflexoBuildPlugin1.9.12.0.02.0.12.0.22.993.0.02.2.0
OpenflexoProduction0.50.50.50.50.50.50.5
Connie1.4.21.51.5.0.11.5.0.22.0.02.1.02.2.0
Pamela1.4.21.51.5.0.11.5.0.21.61.6.11.7 ?
Gina2.1.22.22.2.0.12.2.0.22.32.42.5 ?
Diana1.4.21.51.5.0.11.5.0.21.61.71.8 ?
OpenflexoUtils1.4.21.51.5.0.11.5.0.21.61.71.8 ?
OpenflexoCore1.9.12.0.02.0.12.0.22.993.0.02.2.0
TechnologyAdapters1.9.12.0.02.0.12.0.22.993.0.02.2.0
OpenflexoDiagramN/A2.0.02.0.12.0.22.993.0.02.2.0
OpenflexoOWLN/A2.0.02.0.12.0.22.993.0.02.2.0
OpenflexoEMFN/A2.0.02.0.12.0.22.993.0.02.2.0
OpenflexoHTTP1.9.12.0.02.0.12.0.22.993.0.02.2.0
OpenflexoJDBC1.9.12.0.02.0.12.0.22.993.0.02.2.0
OpenflexoKafka1.9.12.0.02.0.12.0.22.993.0.02.2.0
OpenflexoOBP2N/A2.0.02.0.12.0.22.993.0.02.2.0
OpenflexoRhapsodyN/A2.0.02.0.12.0.22.993.0.02.2.0
OpenflexoModules1.9.12.0.02.0.12.0.22.993.0.02.2.0
OpenflexoPackaging1.9.12.0.02.0.12.0.22.993.0.02.2.0
Modelers (optional)1.9.12.0.02.0.12.0.22.993.0.02.2.0
IntegrationTests (opt)1.9.12.0.02.0.12.0.22.993.0.02.2.0

 

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,

  • Launch Eclipse
  • In the help menu, choose "eclipse marketplace..."
  • In the search field type "BuildShip" and press enter
  • Select "Buildship Gradle Integration", and click install (if it is not already installed)

1-InstallBuildShip

2. Import Openflexo Developement Component

Switch to Git repository perspective.

Click on "Clone a Git repository", to import source code from github (where openflexo source code is available)

2-ImportOpenflexoDevelopement1

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

2-ImportOpenflexoDevelopement2

Select a local GIT directory, and click Finish

2-ImportOpenflexoDevelopement3

Switch back to "Java perspective", right-click and select Import...

2-ImportOpenflexoDevelopement4

Select "Existing Gradle Project", and click Next

2-ImportOpenflexoDevelopement5

Select Next on the following wizard.

2-ImportOpenflexoDevelopement6

Select your project root directory: here /Users/mac/GIT/openflexo-dev, and click Next

2-ImportOpenflexoDevelopement7

Select "Gradle wrapper" and click Next.

2-ImportOpenflexoDevelopement8

Click Finish.

2-ImportOpenflexoDevelopement9

Open "settings.gradle" file and comment all the "includeBuild" lines then save it.

2-ImportOpenflexoDevelopement10

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.

3. Import Connie component.

Do the same for Connie component, using https://github.com/openflexo-team/connie (branch/version 1.5.0.1)

3-ImportConnie

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.

3-BuildConnie

Open a terminal in Connie repository folder then run this command: “ ./gradlew build “

3-BuildConnie2

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.

5-ConnieIssues3

Your Connie projects should all compile now.

4. Import other components

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:

  • 1.9.1 infrastructure has been released on 2019
  • 2.0.0 infrastructure has been released on june 2020
  • 2.1.0 infrastructure is beeing under active development (FML textual syntax)
Components (development versions)    Branch 1.9.1        Branch 2.0.0        Branch 2.1.0    
OpenflexoBuildPlugin1.9.12.0.02.1.0
OpenflexoProduction0.50.50.5
Connie1.4.21.51.5.1
Pamela1.4.21.51.6
Gina2.1.22.22.2.1
Diana1.4.21.51.5.1
OpenflexoUtils1.4.21.51.5.1
OpenflexoCore1.9.12.0.02.1.0
TechnologyAdapters1.9.12.0.02.1.0
OpenflexoDiagramN/A2.0.02.1.0
OpenflexoOWLN/A2.0.02.1.0
OpenflexoEMFN/A2.0.02.1.0
OpenflexoHTTP1.9.12.0.02.1.0
OpenflexoJDBC1.9.12.0.02.1.0
OpenflexoKafka1.9.12.0.02.1.0
OpenflexoOBP2N/A2.0.02.1.0
OpenflexoRhapsodyN/A2.0.02.1.0
OpenflexoModules1.9.12.0.02.1.0
OpenflexoPackaging1.9.12.0.02.1.0
Modelers (optional)1.9.12.0.02.1.0
IntegrationTests (opt)1.9.12.0.02.1.0

 

Here are the former versions of infrastructure:

  • 1.9.0 infrastructure, released on october 2018
  • 1.8.1 released on 2017 (mostly deprecated)
Components (stable versions)    Branch 1.8.1        Branch 1.9.0    
OpenflexoProduction0.50.5
Connie1.41.4.1
Pamela1.41.4.1
Gina2.12.1.1
Diana1.41.4.1
OpenflexoUtils1.41.4.1
OpenflexoCore1.8.11.9.0
TechnologyAdapters1.8.11.9.0
OpenflexoModules1.8.11.9.0
OpenflexoPackaging1.8.11.9.0
Modelers (optional)1.8.11.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.

4-CompilerPrefsWarning

Finally your workspace should contains your set of imported projects.

5. Run Openflexo packaging

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)

5-LaunchConfig

Set "dev" as a program arguments.

5-LaunchConfig2

6. Configure Push to Upstream

Open the "git perspective", and right click on the project for which you want to push your commits, and select properties.

  • Set the autocrlf property to true
  • Set the push properties
  • Check the github url(should be ssh).

6-PushPullConfig

7. Resolving dependancies using eclise

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.

8. Recommandations to develop on Openflexo infrastructure

Here are the standard configuration for save actions that are to be used in Openflexo developers team:

8-SaveActions