Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
postUpdateHooks = [{
command = ["./update-inner-workflows.sh"],
commitMessage = "Regenerated inner workflows",
groupId = "org.typelevel",
artifactId = "sbt-typelevel"
}]
postUpdateHooks = [
{
command = ["./update-inner-workflows.sh"],
commitMessage = "Regenerated inner workflows",
groupId = "org.typelevel",
artifactId = "sbt-typelevel"
},
{
command = ["./update-scala-versions.sh"],
commitMessage = "Synced Scala 2.13 version to inner template",
groupId = "org.scala-lang",
artifactId = "scala-library"
},
{
command = ["./update-scala-versions.sh"],
commitMessage = "Synced Scala 3 version to inner template",
groupId = "org.scala-lang",
artifactId = "scala3-library_3"
}
]
updates.fileExtensions = [".scala", ".sbt", ".properties", ".md"]
22 changes: 22 additions & 0 deletions update-scala-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# exit when any command fails
set -e

echo "Syncing Scala versions from build.sbt to default.properties"
SCALA2_VERSION=$(grep 'scala-library' build.sbt | grep -o '"2.13.[0-9]\+"' | tr -d '"')
SCALA3_VERSION=$(grep 'scala3-library_3' build.sbt | grep -o '"3.[0-9]\+.[0-9]\+"' | tr -d '"')

if [ -z "$SCALA2_VERSION" ] || [ -z "$SCALA3_VERSION" ]; then
echo "Error: Could not extract Scala versions from build.sbt"
exit 1
fi
echo "Found Scala 2 version: $SCALA2_VERSION"
echo "Found Scala 3 version: $SCALA3_VERSION"

# Update default.properties
sed -i.bak "s/scala_version = [0-9.]*/scala_version = $SCALA2_VERSION/" src/main/g8/default.properties
sed -i.bak "s/other_scala_version = [0-9.]*/other_scala_version = $SCALA3_VERSION/" src/main/g8/default.properties
rm -f src/main/g8/default.properties.bak

echo "Updated src/main/g8/default.properties"