How to build mbeddr on Windows — January 21, 2017

How to build mbeddr on Windows

This howto describes how to build the mbeddr sources from scratch on Windows.

If you are looking on how to build an mbeddr or mbeddr platform-based app, please see the mbeddr build guide.

In this howto, I built mbeddr nightly 380 for JetBrains MPS 3.4.3 on Windows 7 using Oracle JDK 1.8 update 121 (see the JDK Oracle archive if the link is not available anymore), ant 1.9.7, and mingw32 (also install msys along with it and select the pthreads dev package).

A warning to those who want to use OpenJDK instead of Oracle JDK: the mbeddr build uses gradle, which needs keys for the gradle and mbeddr service repositories in the trust store. You can try this solution to add the necessary keys from the servers in the URLs of gradle and mbeddr that go wrong, but I chose the easy route and used Oracle JDK, which is anyway recommended with JetBrains MPS, the platform on which mbeddr is built.

Start first by checking out the mbeddr.core repository and checking out the nightly-380 tag:

> git clone https://github.com/mbeddr/mbeddr.core
> cd mbeddr.core
> git checkout nightly-380-MPS-3.4.3

Before starting to build, don’t forget to put javacant, gcc, and make in your PATH and all the java platform jars in your CLASSPATH, either in your global/local environment variables, or directly on the shell before compiling. I did it on the shell:

> set PATH="C:\Program Files\Java\jdk1.8.0_121\bin";%PATH%
> set PATH=C:\app\apache-ant-1.9.7\bin;%PATH%
> set PATH=C:\app\mingw32\bin;C:\app\mingw32\msys\1.0\bin;%PATH%
> set CLASSPATH="C:\Program Files\Java\jdk1.8.0_121\lib\*.jar";%CLASSPATH%

Then you only need to tell gradle to do its job:

> gradlew build assemble

If you also need to use your locally built version of mbeddr for other builds on your local machine that depend on it, you can run this command to put it in the local Maven cache:

> gradlew publishMbeddrPlatformPublicationToMavenLocal

Thanks to  Sergej Koščejev and Kolja Dummann from the mbeddr team for the hints and tips to get the build running.

Advertisements