You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2022/12/05 12:30:23 UTC
[incubator-kyuubi] branch branch-1.6 updated: [KYUUBI #3903] Support windows generate `kyuubi-version-info.properties`
This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch branch-1.6
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git
The following commit(s) were added to refs/heads/branch-1.6 by this push:
new 4ed63255a [KYUUBI #3903] Support windows generate `kyuubi-version-info.properties`
4ed63255a is described below
commit 4ed63255a8e470bdd726fed9a540cb7a7f2c83e1
Author: sychen <sy...@ctrip.com>
AuthorDate: Mon Dec 5 20:27:43 2022 +0800
[KYUUBI #3903] Support windows generate `kyuubi-version-info.properties`
Windows users need to generate `kyuubi-version-info.properties` to debug.
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [x] Add screenshots for manual tests if appropriate
- [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
Closes #3903 from cxzl25/win_gen_version_info.
Closes #3903
089cf9eb [sychen] support windows generate kyuubi-version-info.properties
Authored-by: sychen <sy...@ctrip.com>
Signed-off-by: Cheng Pan <ch...@apache.org>
(cherry picked from commit 730fd57ccf6accf5636ad7bef13b16e8727de8ee)
Signed-off-by: Cheng Pan <ch...@apache.org>
---
build/kyuubi-build-info.cmd | 50 +++++++++++++++++++++++++++++++++++++++++++++
kyuubi-common/pom.xml | 36 ++++++++++++++++++++++----------
2 files changed, 75 insertions(+), 11 deletions(-)
diff --git a/build/kyuubi-build-info.cmd b/build/kyuubi-build-info.cmd
new file mode 100755
index 000000000..7717b48e4
--- /dev/null
+++ b/build/kyuubi-build-info.cmd
@@ -0,0 +1,50 @@
+@echo off
+
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements. See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+rem
+
+SET EXTRA_RESOURCE_DIR=%~1
+IF NOT EXIST "%EXTRA_RESOURCE_DIR%" MKDIR "%EXTRA_RESOURCE_DIR%"
+SET BUILD_INFO="%EXTRA_RESOURCE_DIR%"\kyuubi-version-info.properties
+CALL :echo_build_properties %* > "%BUILD_INFO%"
+
+EXIT /B %ERRORLEVEL%
+
+:echo_build_properties
+echo kyuubi_version=%~2
+echo kyuubi_java_version=%~3
+echo kyuubi_scala_version=%~4
+echo kyuubi_spark_version=%~5
+echo kyuubi_hive_version=%~6
+echo kyuubi_hadoop_version=%~7
+echo kyuubi_flink_version=%~8
+echo kyuubi_trino_version=%~9
+echo user=%username%
+
+FOR /F %%i IN ('git rev-parse HEAD') DO SET "revision=%%i"
+FOR /F %%i IN ('git rev-parse --abbrev-ref HEAD') DO SET "branch=%%i"
+FOR /F %%i IN ('git config --get remote.origin.url') DO SET "url=%%i"
+
+FOR /f %%i IN ('date /t') DO SET current_date=%%i
+FOR /f %%i IN ("%TIME%") DO SET current_time=%%i
+set date=%current_date%_%current_time%
+
+echo revision=%revision%
+echo branch=%branch%
+echo date=%date%
+echo url=%url%
+GOTO:EOF
diff --git a/kyuubi-common/pom.xml b/kyuubi-common/pom.xml
index ff010da6d..8a6caff2e 100644
--- a/kyuubi-common/pom.xml
+++ b/kyuubi-common/pom.xml
@@ -187,17 +187,31 @@
<phase>generate-resources</phase>
<configuration>
<target>
- <exec executable="bash">
- <arg value="${project.basedir}/../build/kyuubi-build-info"/>
- <arg value="${project.build.directory}/extra-resources"/>
- <arg value="${project.version}"/>
- <arg value="${java.version}"/>
- <arg value="${scala.binary.version}"/>
- <arg value="${spark.version}"/>
- <arg value="${hive.version}"/>
- <arg value="${hadoop.version}"/>
- <arg value="${flink.version}"/>
- <arg value="${trino.client.version}"/>
+ <exec executable="bash" osfamily="unix">
+ <arg value="${project.basedir}/../build/kyuubi-build-info"></arg>
+ <arg value="${project.build.directory}/extra-resources"></arg>
+ <arg value="${project.version}"></arg>
+ <arg value="${java.version}"></arg>
+ <arg value="${scala.binary.version}"></arg>
+ <arg value="${spark.version}"></arg>
+ <arg value="${hive.version}"></arg>
+ <arg value="${hadoop.version}"></arg>
+ <arg value="${flink.version}"></arg>
+ <arg value="${trino.client.version}"></arg>
+ </exec>
+
+ <exec executable="cmd.exe" osfamily="windows">
+ <arg value="/c"></arg>
+ <arg value="${project.basedir}/../build/kyuubi-build-info.cmd"></arg>
+ <arg value="${project.build.directory}/extra-resources"></arg>
+ <arg value="${project.version}"></arg>
+ <arg value="${java.version}"></arg>
+ <arg value="${scala.binary.version}"></arg>
+ <arg value="${spark.version}"></arg>
+ <arg value="${hive.version}"></arg>
+ <arg value="${hadoop.version}"></arg>
+ <arg value="${flink.version}"></arg>
+ <arg value="${trino.client.version}"></arg>
</exec>
</target>
</configuration>