From 555116c237e4999b13e8ddb8ddf47b6d9236f84e Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Wed, 13 Nov 2024 16:50:20 +0000 Subject: [PATCH] dataconnect: internal convenience script updates --- .../scripts/compile_kotlin.sh | 6 +-- firebase-dataconnect/scripts/emulator_run.sh | 38 +++++++++++++++++++ .../scripts/generate_data_connect_sources.sh | 6 +-- firebase-dataconnect/scripts/run_all_tests.sh | 6 +-- .../scripts/run_integration_tests.sh | 6 +-- .../scripts/run_unit_tests.sh | 6 +-- firebase-dataconnect/scripts/spotlessApply.sh | 6 +-- 7 files changed, 44 insertions(+), 30 deletions(-) create mode 100755 firebase-dataconnect/scripts/emulator_run.sh diff --git a/firebase-dataconnect/scripts/compile_kotlin.sh b/firebase-dataconnect/scripts/compile_kotlin.sh index 479099500a6..64b68bfac67 100755 --- a/firebase-dataconnect/scripts/compile_kotlin.sh +++ b/firebase-dataconnect/scripts/compile_kotlin.sh @@ -16,11 +16,6 @@ set -euo pipefail -if [[ $# -gt 0 ]] ; then - echo "ERROR: no command-line arguments are supported, but got $*" >&2 - exit 2 -fi - readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.." readonly TARGETS=( @@ -43,6 +38,7 @@ readonly args=( "-p" "${PROJECT_ROOT_DIR}" "--configure-on-demand" + "$@" "${TARGETS[@]}" ) diff --git a/firebase-dataconnect/scripts/emulator_run.sh b/firebase-dataconnect/scripts/emulator_run.sh new file mode 100755 index 00000000000..352584af85d --- /dev/null +++ b/firebase-dataconnect/scripts/emulator_run.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +set -euo pipefail + +readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.." + +( + set -xv + cd "${PROJECT_ROOT_DIR}"/firebase-dataconnect/emulator + ./wipe_postgres_db.sh + ./start_postgres_pod.sh +) + +readonly args=( + "${PROJECT_ROOT_DIR}/gradlew" + "-p" + "${PROJECT_ROOT_DIR}" + "--configure-on-demand" + "$@" + ":firebase-dataconnect:connectors:runDebugDataConnectEmulator" +) + +echo "${args[*]}" +exec "${args[@]}" diff --git a/firebase-dataconnect/scripts/generate_data_connect_sources.sh b/firebase-dataconnect/scripts/generate_data_connect_sources.sh index 25c4d05e02a..d685d990253 100755 --- a/firebase-dataconnect/scripts/generate_data_connect_sources.sh +++ b/firebase-dataconnect/scripts/generate_data_connect_sources.sh @@ -16,11 +16,6 @@ set -euo pipefail -if [[ $# -gt 0 ]] ; then - echo "ERROR: no command-line arguments are supported, but got $*" >&2 - exit 2 -fi - readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.." readonly TARGETS=( @@ -32,6 +27,7 @@ readonly args=( "-p" "${PROJECT_ROOT_DIR}" "--configure-on-demand" + "$@" "${TARGETS[@]}" ) diff --git a/firebase-dataconnect/scripts/run_all_tests.sh b/firebase-dataconnect/scripts/run_all_tests.sh index bba852dbdc6..e7c38e6c3a2 100755 --- a/firebase-dataconnect/scripts/run_all_tests.sh +++ b/firebase-dataconnect/scripts/run_all_tests.sh @@ -16,11 +16,6 @@ set -euo pipefail -if [[ $# -gt 0 ]] ; then - echo "ERROR: no command-line arguments are supported, but got $*" >&2 - exit 2 -fi - readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.." readonly TARGETS=( @@ -39,6 +34,7 @@ readonly args=( "-p" "${PROJECT_ROOT_DIR}" "--configure-on-demand" + "$@" "${TARGETS[@]}" ) diff --git a/firebase-dataconnect/scripts/run_integration_tests.sh b/firebase-dataconnect/scripts/run_integration_tests.sh index 33e41603ca2..914839c3141 100755 --- a/firebase-dataconnect/scripts/run_integration_tests.sh +++ b/firebase-dataconnect/scripts/run_integration_tests.sh @@ -16,11 +16,6 @@ set -euo pipefail -if [[ $# -gt 0 ]] ; then - echo "ERROR: no command-line arguments are supported, but got $*" >&2 - exit 2 -fi - readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.." readonly TARGETS=( @@ -35,6 +30,7 @@ readonly args=( "-p" "${PROJECT_ROOT_DIR}" "--configure-on-demand" + "$@" "${TARGETS[@]}" ) diff --git a/firebase-dataconnect/scripts/run_unit_tests.sh b/firebase-dataconnect/scripts/run_unit_tests.sh index 6bbc8a52dbb..4bd53b738b3 100755 --- a/firebase-dataconnect/scripts/run_unit_tests.sh +++ b/firebase-dataconnect/scripts/run_unit_tests.sh @@ -16,11 +16,6 @@ set -euo pipefail -if [[ $# -gt 0 ]] ; then - echo "ERROR: no command-line arguments are supported, but got $*" >&2 - exit 2 -fi - readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.." readonly TARGETS=( @@ -35,6 +30,7 @@ readonly args=( "-p" "${PROJECT_ROOT_DIR}" "--configure-on-demand" + "$@" "${TARGETS[@]}" ) diff --git a/firebase-dataconnect/scripts/spotlessApply.sh b/firebase-dataconnect/scripts/spotlessApply.sh index 162794bbc1c..8944c83c03f 100755 --- a/firebase-dataconnect/scripts/spotlessApply.sh +++ b/firebase-dataconnect/scripts/spotlessApply.sh @@ -16,11 +16,6 @@ set -euo pipefail -if [[ $# -gt 0 ]] ; then - echo "ERROR: no command-line arguments are supported, but got $*" >&2 - exit 2 -fi - readonly PROJECT_ROOT_DIR="$(dirname "$0")/../.." readonly TARGETS=( @@ -35,6 +30,7 @@ readonly args=( "-p" "${PROJECT_ROOT_DIR}" "--configure-on-demand" + "$@" "${TARGETS[@]}" )