From f390a595ee3e0e5cf2e2cf7addd61f19f458cbb9 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Tue, 9 Aug 2022 07:16:24 -0700 Subject: [PATCH] Revert "Updates objectc script to accept relative paths. (#35190)" (#35265) This reverts commit 9aaa21a290afe5df4f16b5d3ce03911278b781f3. --- tools/gen_objcdoc.sh | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/tools/gen_objcdoc.sh b/tools/gen_objcdoc.sh index 7f7d65d4f4bd6..dd0583b939231 100755 --- a/tools/gen_objcdoc.sh +++ b/tools/gen_objcdoc.sh @@ -7,29 +7,27 @@ set -e -if [[ $# -eq 0 ]]; then - echo "Error: Argument specifying output directory required." - exit 1 -fi - -# Move to the flutter checkout -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -pushd "$SCRIPT_DIR/../../flutter" - FLUTTER_UMBRELLA_HEADER=$(find ../out -maxdepth 4 -type f -name Flutter.h | grep 'ios_' | head -n 1) if [[ ! -f "$FLUTTER_UMBRELLA_HEADER" ]] then echo "Error: This script must be run at the root of the Flutter source tree with at least one built Flutter.framework in ../out/ios*/Flutter.framework." - echo "Running from: $(pwd)" exit 1 fi -OUTPUT_DIR="$1/objectc_docs" -ZIP_DESTINATION="$1" -if [ "${OUTPUT_DIR:0:1}" != "/" ] -then - ZIP_DESTINATION="$SCRIPT_DIR/../../$1" - OUTPUT_DIR="$ZIP_DESTINATION/objectc_docs" + +# If the script is running from within LUCI we use the LUCI_WORKDIR, if not we force the caller of the script +# to pass an output directory as the first parameter. +OUTPUT_DIR="" + +if [[ -z "$LUCI_CI" ]]; then + if [[ $# -eq 0 ]]; then + echo "Error: Argument specifying output directory required." + exit 1 + else + OUTPUT_DIR="$1" + fi +else + OUTPUT_DIR="$LUCI_WORKDIR/objectc_docs" fi # If GEM_HOME is set, prefer using its copy of jazzy. @@ -85,8 +83,3 @@ if [[ $EXPECTED_CLASSES != $ACTUAL_CLASSES ]]; then diff <(echo "$EXPECTED_CLASSES") <(echo "$ACTUAL_CLASSES") exit -1 fi - -# Create the final zip file. -pushd $OUTPUT_DIR -zip -r "$ZIP_DESTINATION/ios-objcdoc.zip" . -popd