Skip to content

Development Environment Setup

Fernando Dodino edited this page Nov 21, 2019 · 94 revisions

Preparing the development environment

General requirements

New Upcoming Version

Wollok 2.0 is planned to run on

Some useful links to recreate a new environment

Maven installation

For Current Wollok Versions

IDE

Wollok 1.9 (current stable build)

  • Download Eclipse Neon for Java Developers should be fine. Do not install "Eclipse DSL Tools" , because it comes with 2.10 XText Version which we are not willing to use.

  • Install XText Complete SDK 2.11 and XTend IDE 2.11 from update site. To do so, go to "Help" -> "Install New Software" and add this URL: http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/, be sure to uncheck "Show only the latest versions of available software" to see them).

  • Install xpect from update site (same as for xsemantics). Xpect 0.2.0 Version & JDT Unit Extension 0.1.0. http://www.xpect-tests.org/updatesite/nightly/

You'll need to install some eclipse maven connectors (check below in "importing into the IDE")

Working with the 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 -Darguments='-Dtycho.disableP2Mirrors=true' -Dtycho.disableP2Mirrors=true"

You can check this 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 is 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.
  • We are telling maven not to use mirrors, because when using archived p2 repositories, a NullPointerException is thrown during build.

Pointing to wollok-language repo

Since 1.9.1 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.

+ wollok
  + org.uqbar.project.wollok
  + org.uqbar.project.wollok.lib
    + link to lang.wlk
    + link to game.wlk
    + ... etc ...
  + wollok-language
    + src
    + test
      + sanity
        + (subfolders with a lot of .wtest files)

You don't have to do anything else, it'll work. If you want to make changes to sanity tests or .wlk core libraries, you'll have to push in the corresponding repository. Wollok Xtext will link .wlk files to reflect core library changes into Runtime Application and future releases.

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.

Don't worry if errors appear, they will be corrected next step.

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
-Declipse.p2.mirrors=false
  • Open Eclipse again

Setting JRE language in Eclipse

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

If there are errors in this target platform definition, you should Edit it, and then Reload it (you must have Internet connection).

Warning configuration

wollokDevDiscouragedAccess

Open Window > Preferences menu, search for "Discouraged" and set Discouraged reference to Ignore (third option from Deprecated and Restricted API)

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=

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.

Clone this wiki locally