Skip to content

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

  1. Install WSL on Windows using Microsoft Guide
  2. Launch WSL console
  3. 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
    
  4. Install dos2unix using the command sudo apt-get install dos2unix
  5. Convert files to UNIX in your Flank repository directory
    find . -type f -print0 | xargs -0 -n 1 -P 4 dos2unix
    
  6. Make Gradlew wrapper executable
    chmod +x gradlew
    
  7. Build Flank using command ./gradlew clean build

GitHub actions

  1. Setup WSL on windows-2019 runner
    runs-on: windows-2019
    
  2. Setup default shell to wsl-bash {0} this will allow avoiding typing wsl-bash on start each command
    defaults:
      run:
        shell: wsl-bash {0}
    
  3. Use GitHub action for setup WSL
    - uses: Vampire/setup-wsl@v1
      with:
        distribution: Ubuntu-20.04
        additional-packages:
          dos2unix
    
  4. 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
    
  5. After this step you could build flank like in every UNIX machine
    ./gradlew clean build
    
  6. 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.