Skip to content

Development Environment Setup

Fernando Dodino edited this page Jun 26, 2021 · 94 revisions

Preparing the development environment

If you want to refer to Wollok based on Eclipse Neon, please refer to this historical page

General requirements

Please, don't use latest releases of Maven. They really suck, and makes you get stuck in the middle of the first build. There's also a problem while trying to compile using xtend-maven-build: 3.3.9 is the preferred Maven version.

Wollok 2.0 is planned to run on

Problems found & solved for this version

Download the source code

This should work independently of your IDE (eclipse)

# using ssh
git clone [email protected]:uqbar-project/wollok.git
# or https
git clone https://github.com/uqbar-project/wollok.git
  • Switch to "dev" branch, which is our main development branch. We don't directly modify the "master" branch
git checkout dev

Be sure that

  • you are pointing to a JDK 1.8 in JAVA_HOME environment variable
  • you have to configure MAVEN_OPTS with this setting
MAVEN_OPTS="-Xmx2048m -Duser.language=en -Duser.country=US -Dnl=  -Dfile.encoding=UTF-8"

Previously, it was required to add a -Darguments='-Dtycho.disableP2Mirrors=true' -Dtycho.disableP2Mirrors=true, in order to tell maven not to use mirrors: using archived p2 repositories, a NullPointerException was thrown during build. This error was fixed, so please avoid this configuration if setted because this will cause Wollok build to fail.

Check configuration

fernando@dodain-pc ~ $ mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T13:41:47-03:00)
Maven home: /usr/local/apache-maven-3.3.9
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.8.0_45/jre
Default locale: en_US, platform encoding: UTF-8
  • Default locale should be en, otherwise your build will fail if you are in a Spanish OS installation. That is because some XPECT tests need a locale validation message.

Pointing to wollok-language repo

Since 1.9.2 version, to add a reference to the wollok-language, link .wlk files and access to sanity tests, you must do this:

./wollokInstall.sh   # Linux
wollokInstall.bat    # Windows

This will create a subfolder wollok-language inside your wollok file system. If you want to learn more, please refer to the development page

Run Maven Build

Then run perform a maven build to run all the tests and make sure it all runs fine:

cd org.uqbar.project.wollok.releng/
mvn clean install

You need to have an internet connection for the build, since maven tycho plugins required this :(

Importing the code into the IDE

After you have built it with maven you can import all the projects into eclipse by using the "Import existing Maven project" option and selecting all the projects in the repository.

There will be a couple (3) of pom files with errors similar to "Plugin Execution not covered...". That's because you need to install some extensions (connectors) to eclipse's maven plugin. Hit CTRL+1 or right-click and select "Discover m2e connectors". Then select it and install it. You need to do this for:

  • Tycho,
  • buildhelper, etc.

Settings

Configuring Eclipse ini file

  • Close Eclipse
  • Add following line to eclipse.ini of your Eclipse installation:
-vmargs
-Dosgi.requiredJavaVersion=1.8
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Dosgi.requiredJavaVersion=1.8
-Xms1024m
-Xmx1768m
-Declipse.p2.max.threads=10

Configuration -Declipse.p2.mirrors=false is no longer required and it's not recommended.

  • Open Eclipse again

Eclipse settings

JRE language

If you are in a spanish OS installation, in Eclipse, you could alternatively set the VM arguments. To this aim, go to Preferences -> Java -> Installed JRE, then select the JRE in which the tests are to be run, "Edit" and in the pop-up window, fill the "Default VM Arguments" field.

-Duser.language=en -Duser.country=US -Dnl=

Default encoding to UTF-8

If you are in a Windows installation, please go to Window > Preferences > Find "encoding" and set all configs to UTF-8.

Target Platform

Window > Preferences > Find "target" and set "Target Platform" to definition in org.uqbar.project.wollok.targetplatform

It will take a long time and will change from 0% to 95% suddenly. Don't worry, it is the expected behavior.

Warning configuration

  • Open Window > Preferences menu, search for "Discouraged" and set Discouraged reference to Ignore (third option from Deprecated and Restricted API, in Eclipse 2019-xx you have a search input)

wollokDevDiscouragedAccess

  • Also set to ignore Unexported package to avoid confusing warnings:

WollokPluginConfiguration

Running tests

Run all JUNIt tests from eclipse by right-clicking the "org.uqbar.project.wollok.test" project.

If your machine is in a different locale/language than english, then some tests will fail, since they expect english messages. To fix that configure the Run Configuration for the test adding the following JVM arguments

-Duser.language=en -Duser.country=US -Dnl=

Show failures only

Since we have a looooot of tests in Wollok, we highly recommend you to set "Show failures only" toggle button to true.

showFailuresOnly

Oh no, my tests are failing! (take it easy)

Right now, if you run all the tests, all Xpect tests will fail. You have to manually run all Xpect tests in a second step, and they will pass succesfully. We'll try to fix it but it's a hard work to do (you won't encounter this problem in Travis or AppVeyor build).

wollokTest2Times

Running an embedded Wollok environment

If you want to test Wollok environment from a User point of view, go to org.uqbar.project.wollok.ui, open plugin.xml file and in Overview Tab (first of all) > Launch an Eclipse application (or Launch an Eclipse application in Debug mode). This opens a new environment in User mode.

runningWollokEnv

Clone this wiki locally