wangyum commented on code in PR #11097:
URL:
https://github.com/apache/incubator-gluten/pull/11097#discussion_r2529974247
##########
dev/change-scala-version.sh:
##########
@@ -13,6 +14,42 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#
-mock-maker-inline
\ No newline at end of file
+set -e
+
+VALID_VERSIONS=( 2.12 2.13 )
+
+usage() {
+ echo "Usage: $(basename $0) [-h|--help] <version>
+where :
+ -h| --help Display this help text
+ valid version values : ${VALID_VERSIONS[*]}
+" 1>&2
+ exit 1
+}
+
+if [[ ($# -ne 1) || ( $1 == "--help") || $1 == "-h" ]]; then
+ usage
+fi
+
+TO_VERSION=$1
+
+check_scala_version() {
+ for i in ${VALID_VERSIONS[*]}; do [ $i = "$1" ] && return 0; done
+ echo "Invalid Scala version: $1. Valid versions: ${VALID_VERSIONS[*]}" 1>&2
+ exit 1
+}
+
+check_scala_version "$TO_VERSION"
+
+if [ $TO_VERSION = "2.13" ]; then
+ FROM_VERSION="2.12"
+else
+ FROM_VERSION="2.13"
+fi
+
+sed_i() {
+ sed -e "$1" "$2" > "$2.tmp" && mv "$2.tmp" "$2"
+}
+
+sed_i 's/\(artifactId.*\)_'$FROM_VERSION'/\1_'$TO_VERSION'/g' package/pom.xml
Review Comment:
This file copy from
https://github.com/apache/spark/blob/master/dev/change-scala-version.sh
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]