Skip to content

Commit

Permalink
Modify change-scala-version.sh to choose scala.version from <profile>.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarutak committed Mar 18, 2021
1 parent 4cdc8c5 commit 3c66069
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dev/change-scala-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ find "$BASEDIR" -name 'pom.xml' -not -path '*target*' -print \
# First find the right full version from the profile's build
# NOTE: We used to fetch the value of scala.version before but sed is used now. This is a workaround for SPARK-34762.
ESCAPED_TO_VERSION=$(echo $TO_VERSION | sed -n "s/\./\\\\./gp")
SCALA_VERSION=$(sed -n "s;^.*<scala-$ESCAPED_TO_VERSION\.version>\(.*\)</scala-$ESCAPED_TO_VERSION\.version>.*$;\1;p" pom.xml)
SCALA_VERSION=$(sed -n "/<id>scala-$ESCAPED_TO_VERSION<\/id>/,/<\/profile>/ \
s;^.*<scala\.version>\(.*\)</scala\.version>.*$;\1;p" pom.xml)
sed_i '1,/<scala\.version>[0-9]*\.[0-9]*\.[0-9]*</s/<scala\.version>[0-9]*\.[0-9]*\.[0-9]*</<scala.version>'$SCALA_VERSION'</' \
"$BASEDIR/pom.xml"

Expand Down

0 comments on commit 3c66069

Please sign in to comment.