File tree Expand file tree Collapse file tree 6 files changed +106
-20
lines changed
Expand file tree Collapse file tree 6 files changed +106
-20
lines changed Original file line number Diff line number Diff line change 1- #! /bin/sh -ex
1+ #! /bin/bash
2+ # Copyright 2024 Google LLC
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+
16+ set -e
217
318BASE_DIR=$( cd " $( dirname " ${BASH_SOURCE[0]:- $0 } " ) " 2>&1 > /dev/null && cd .. && pwd)
4- . " ${BASE_DIR} /dumper/app/src/main/sh/java_versioning.sh"
5- BASE_BIN_DIR=" ${BASE_DIR} /dumper/app/build/install/app/bin"
6- BIN=$( is_java_greater_than_8 && echo " ${BASE_BIN_DIR} /dwh-migration-dumper" || echo " ${BASE_BIN_DIR} /dwh-migration-dumper-java8" )
19+ BIN=" ${BASE_DIR} /dumper/app/build/install/app/bin/dwh-migration-dumper-starter"
720
821if [ ! -x " $BIN " ] ; then
922 (cd " ${BASE_DIR} " && ./gradlew --parallel :dumper:app:installDist)
1023fi
1124
12- exec " $BIN " " $@ "
25+ export JDK_JAVA_OPTIONS=" --add-opens=java.base/java.nio=ALL-UNNAMED"
26+
27+ exec " $BIN " " $@ "
Original file line number Diff line number Diff line change 1+ @ rem Copyright 2024 Google LLC
2+ @ rem
3+ @ rem Licensed under the Apache License, Version 2.0 (the "License");
4+ @ rem you may not use this file except in compliance with the License.
5+ @ rem You may obtain a copy of the License at
6+ @ rem
7+ @ rem http://www.apache.org/licenses/LICENSE-2.0
8+ @ rem
9+ @ rem Unless required by applicable law or agreed to in writing, software
10+ @ rem distributed under the License is distributed on an "AS IS" BASIS,
11+ @ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ @ rem See the License for the specific language governing permissions and
13+ @ rem limitations under the License.
14+
15+ @ if " %DEBUG% " == " " @ echo off
16+ set JDK_JAVA_OPTIONS = " --add-opens=java.base/java.nio=ALL-UNNAMED"
17+
18+ set " DIRNAME = %~dp0 ..\dumper\app\build\install\app\bin"
19+ " %DIRNAME% \dwh-migration-dumper-starter.bat" %*
Original file line number Diff line number Diff line change @@ -123,19 +123,11 @@ jacocoTestReport {
123123}
124124
125125startScripts {
126+ applicationName = " dwh-migration-dumper-starter"
126127 classpath = files(' $APP_HOME/lib/*' )
127- defaultJvmOpts = [" --add-opens=java.base/java.nio=ALL-UNNAMED" ]
128- }
129-
130- task createStartScriptForJava8 (type : CreateStartScripts ) {
131- mainClass = tasks. startScripts. mainClass
132- applicationName = ' dwh-migration-dumper-java8'
133- outputDir = tasks. startScripts. outputDir
134- classpath = tasks. startScripts. classpath
135128}
136129
137130tasks. named(' installDist' ) {
138- dependsOn ' createStartScriptForJava8'
139131 dependsOn ' cloudExtractorStartScripts'
140132 dependsOn ' cloudExtractorStartScriptsForJava8'
141133}
@@ -944,6 +936,12 @@ distributions {
944936 from(cloudExtractorStartScripts) {
945937 into " bin"
946938 }
939+ from(" src/main/sh/dwh-migration-dumper" ) {
940+ into " bin"
941+ }
942+ from(" src/main/sh/dwh-migration-dumper.bat" ) {
943+ into " bin"
944+ }
947945 from(generateLicenseReport) {
948946 into " docs/licenses"
949947 }
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Copyright 2024 Google LLC
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
15+
16+ set -e
17+
18+ BASE_DIR=$( cd " $( dirname " ${BASH_SOURCE[0]:- $0 } " ) " 2>&1 > /dev/null && cd .. && pwd)
19+ BIN=" ${BASE_DIR} /bin/dwh-migration-dumper-starter"
20+
21+ export JDK_JAVA_OPTIONS=" --add-opens=java.base/java.nio=ALL-UNNAMED"
22+
23+ exec " $BIN " " $@ "
Original file line number Diff line number Diff line change 1+ @ rem Copyright 2024 Google LLC
2+ @ rem
3+ @ rem Licensed under the Apache License, Version 2.0 (the "License");
4+ @ rem you may not use this file except in compliance with the License.
5+ @ rem You may obtain a copy of the License at
6+ @ rem
7+ @ rem http://www.apache.org/licenses/LICENSE-2.0
8+ @ rem
9+ @ rem Unless required by applicable law or agreed to in writing, software
10+ @ rem distributed under the License is distributed on an "AS IS" BASIS,
11+ @ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ @ rem See the License for the specific language governing permissions and
13+ @ rem limitations under the License.
14+
15+ @ if " %DEBUG% " == " " @ echo off
16+ set JDK_JAVA_OPTIONS = " --add-opens=java.base/java.nio=ALL-UNNAMED"
17+
18+ set " DIRNAME = %~dp0 "
19+ " %DIRNAME% \dwh-migration-dumper-starter.bat" %*
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ # Copyright 2024 Google LLC
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # You may obtain a copy of the License at
7+ #
8+ # http://www.apache.org/licenses/LICENSE-2.0
9+ #
10+ # Unless required by applicable law or agreed to in writing, software
11+ # distributed under the License is distributed on an "AS IS" BASIS,
12+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ # See the License for the specific language governing permissions and
14+ # limitations under the License.
215
316function is_java_greater_than_8() {
4- java_path=$( which java)
5- java_version_output=$( $java_path -version 2>&1 )
17+ java_version_output=" $( java -version 2>&1 ) "
618
7- # Will return 1 for all versions before Java 9, but we do not care .
8- java_major_version=$( echo " $java_version_output " | grep -Eoi ' version "?([0-9]+)' | head -1 | cut -d' "' -f2 | cut -d' .' -f1)
19+ # Will return 1 for all versions before Java 9.
20+ java_major_version=" $( echo " $java_version_output " | grep -Eoi ' version "?([0-9]+)' | head -1 | cut -d' "' -f2 | cut -d' .' -f1) "
921
1022 # Check if the major version is greater than 8.
11- if [[ $java_major_version -gt 8 ]]; then
23+ if [[ " $java_major_version " -gt 8 ]]; then
1224 return 0 # True
1325 else
1426 return 1 # False
1527 fi
16- }
28+ }
You can’t perform that action at this time.
0 commit comments