Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

For now, we assume that each subproject has an sbt configuration. The build script will run each subproject that has some changes.


Code Block
languagebash
titleThe draft implementation of the script
#!/bin/bash

COUNT=0

#list subdirectories
for d in */ ; do
    #check for sbt subproject
    if [ -f "$d/build.sbt" ]
    then
        #check for changes
        if git diff --name-only HEAD^ | grep "$d" > /dev/null 
        then
            DIFF[COUNT]="$d"
            COUNT=$((COUNT+1))
        fi
    fi
done

#run test for all subprojects with changes
for i in ${DIFF[@]}; do
    echo "Run sbt"
    cd "$i"
    sbt test
    cd ../
done
For now, we assume that each subproject has an sbt configuration. The build script will run each subproject that has some changes.