Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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

The 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
  • No labels