Skip to content

Commit

Permalink
Add simple script to run projects based on the current config
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Jan 10, 2024
1 parent 975177b commit 0bdcd97
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions scripts/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -e

# Simple script to run projects locally based on the current projects config

if [ $# -ne 1 ]; then
echo "Wrong number of script arguments, got $# expected 1"
exit 1
fi
scriptDir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"

projectName=$1
scalaVersion=$2
if [[ -z $scalaVersion ]]; then
scalaVersion=`${scriptDir}/lastVersionNightly.sc`
fi
extraScalacOptions=""
disabledScalacOptions=""

echo "projectName: $projectName"
echo "scalaVersion: $scalaVersion"

ConfigFile="${scriptDir}/../.github/workflows/buildConfig.json"
function config () {
path=".\"$projectName\"$@"
jq -c -r "$path" $ConfigFile
}
DefaultConfig="{}"


$scriptDir/../project-builder/build-revision.sh \
"$(config .project)" \
"$(config .repoUrl)" \
"$(config .revision)" \
"${scalaVersion}" \
"$(config .version)" \
"$(config .targets)" \
"" \
'1.6.2' \
"$(config .config // ${DefaultConfig})" \
"$extraScalacOptions" \
"$disabledScalacOptions" 2>&1 | tee build-logs.txt

cat build-status.txt

0 comments on commit 0bdcd97

Please sign in to comment.