Building and running Flank on Windows WSL
It is possible to build and run Flank on Windows through WSL. You could configure it using your own Windows machine or you could use GitHub actions to do this.
Building
Own Windows machine
- Install WSL on Windows using Microsoft Guide
- Launch WSL console
- Install JDK if you do not have any installed
sudo apt-get install openjdk-15-jre sudo apt-get install openjdk-15-jdk export JAVA_HOME=/usr/lib/jvm/openjdk-15-jdk export PATH=$PATH:$JAVA_HOME/bin
- Install
dos2unix
using the commandsudo apt-get install dos2unix
- Convert files to UNIX in your Flank repository directory
find . -type f -print0 | xargs -0 -n 1 -P 4 dos2unix
- Make Gradlew wrapper executable
chmod +x gradlew
- Build Flank using command
./gradlew clean build
GitHub actions
- Setup WSL on
windows-2019
runnerruns-on: windows-2019
- Setup default shell to
wsl-bash {0}
this will allow avoiding typingwsl-bash
on start each commanddefaults: run: shell: wsl-bash {0}
- Use GitHub action for setup WSL
- uses: Vampire/setup-wsl@v1 with: distribution: Ubuntu-20.04 additional-packages: dos2unix
- In order to build flank you should install java, add permission to Gradle wrapper file and prepare each file using
dos2unix
- name: Configure WSL for flank run: | find . -type f -print0 | xargs -0 -n 1 -P 4 dos2unix chmod +x gradlew sudo apt-get -y install openjdk-8-jdk
- After this step you could build flank like in every UNIX machine
./gradlew clean build
- For reference please check Flank team implementation of WSL workflow
Running
After building using the above steps or downloading using the command
wget --quiet https://github.com/Flank/flank/releases/download/XXX/flank.jar -O ./flank.jar
where XXX
is the latest version of flank from Flank releases on GitHub
You could run Flank both on your own machine or GitHub actions typing the command:
java -jar <PATH TO FLANK> <COMMANDS> <OPTIONS>
You could also add Flank's bash helper folder to your $PATH
environment variable. This will allow you to call the shell scripts in that helper folder from anywhere.