File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 2020
2121# Find the version files in this directory or its descendants, but don't recurse too deep.
2222# This line must be kept in sync with "bump-version.set.sh".
23- VERSFILES=$( find . -maxdepth 3 ! -path ./.git/\* | grep -v /node_modules/ | grep -E ' .*/(version|Cargo.toml|version.go|package.json|pom.xml|version.sbt)$' )
23+ VERSFILES=$( find . -maxdepth 3 ! -path ./.git/\* | grep -v /node_modules/ | grep -E ' .*/(version|Cargo.toml|version.go|package.json|pom.xml|version.sbt|build.gradle.kts )$' )
2424
2525# Do we have at least one?
2626if [ -z " ${VERSFILES} " ] ; then
@@ -72,6 +72,9 @@ for FILE in ${VERSFILES} ; do
7272 version.sbt)
7373 VERS=$( sed -e ' s/^[^"]*"//' -e ' s/"$//' < " ${FILE} " )
7474 ;;
75+ build.gradle.kts)
76+ VERS=$( grep " ^version.*=" < " ${FILE} " | sed -e ' s/^[^"]*"//' -e ' s/"$//' )
77+ ;;
7578 * )
7679 echo " Can't parse '${FILE} ' for version" 1>&2
7780 exit 1
Original file line number Diff line number Diff line change 3535
3636# Find the version files in this directory or its descendants, but don't recurse too deep.
3737# This line must be kept in sync with "bump-version.get.sh".
38- VERSFILES=$( find . -maxdepth 3 ! -path ./.git/\* | grep -v /node_modules/ | grep -E ' .*/(version|Cargo.toml|version.go|package.json|pom.xml|version.sbt)$' )
38+ VERSFILES=$( find . -maxdepth 3 ! -path ./.git/\* | grep -v /node_modules/ | grep -E ' .*/(version|Cargo.toml|version.go|package.json|pom.xml|version.sbt|build.gradle.kts )$' )
3939
4040# Edit the version files.
4141for FILE in ${VERSFILES} ; do
@@ -100,6 +100,13 @@ for FILE in ${VERSFILES} ; do
100100 rm " ${FILE} .tmp"
101101 ;;
102102
103+ build.gradle.kts)
104+ # Replace -foo with -SNAPSHOT to be compatible with Java conventions.
105+ JAVAVERS=" ${NEWVERS/ -*/ -SNAPSHOT} "
106+ sed ' s/^version = ".*"$/version = "' " ${JAVAVERS} " ' "/' " ${FILE} " > " ${FILE} .tmp"
107+ mv " ${FILE} .tmp" " ${FILE} "
108+ ;;
109+
103110 * )
104111 echo " Can't edit '${FILE} ' with new version" 1>&2
105112 exit 1
You can’t perform that action at this time.
0 commit comments