diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/lint.sh | 18 | ||||
-rwxr-xr-x | scripts/push-pods.sh | 8 | ||||
-rwxr-xr-x | scripts/style.sh | 34 | ||||
-rwxr-xr-x | scripts/update-tags.sh | 36 |
4 files changed, 64 insertions, 32 deletions
diff --git a/scripts/lint.sh b/scripts/lint.sh index d474129..3d4f453 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -68,10 +68,21 @@ else command=(git ls-files) fi +# POSIX xargs is required to run commands at least once, but cpplint.py fails +# (with huge help text) if no files are supplied. Apple xargs avoids invocation +# if there are no arguments. Use a temporary file to avoid depending on/testing +# for this feature. +TEMP=$(mktemp -t lint-files-$$.XXXXXXXXXX) +trap "rm '$TEMP'" EXIT + # Straight C++ files get regular cpplint "${command[@]}" "${git_options[@]}" \ -- 'Firestore/core/**/*.'{h,cc} \ - | xargs -0 python scripts/cpplint.py --quiet 2>&1 + > "$TEMP" + +if [[ -s "$TEMP" ]]; then + xargs -0 python scripts/cpplint.py --quiet 2>&1 < "$TEMP" +fi CPP_STATUS=$? # Objective-C++ files get a looser cpplint @@ -79,7 +90,10 @@ CPP_STATUS=$? -- 'Firestore/Source/**/*.'{h,m,mm} \ 'Firestore/Example/Tests/**/*.'{h,m,mm} \ 'Firestore/core/**/*.mm' \ - | xargs -0 python scripts/cpplint.py "${objc_lint_options[@]}" --quiet 2>&1 + > "$TEMP" +if [[ -s "$TEMP" ]]; then + xargs -0 python scripts/cpplint.py "${objc_lint_options[@]}" --quiet 2>&1 < "$TEMP" +fi OBJC_STATUS=$? if [[ $CPP_STATUS != 0 || $OBJC_STATUS != 0 ]]; then diff --git a/scripts/push-pods.sh b/scripts/push-pods.sh index b79b76e..ed34d79 100755 --- a/scripts/push-pods.sh +++ b/scripts/push-pods.sh @@ -22,16 +22,16 @@ # investigation. pod cache clean FirebaseCore --all -#pod cache clean FirebaseAuth --all -pod cache clean FirebaseDatabase --all +pod cache clean FirebaseAuth --all +#pod cache clean FirebaseDatabase --all pod cache clean FirebaseFirestore --all #pod cache clean FirebaseFunctions --all pod cache clean FirebaseMessaging --all #pod cache clean FirebaseStorage --all pod repo push cpdc-internal-spec FirebaseCore.podspec -#pod repo push cpdc-internal-spec FirebaseAuth.podspec -pod repo push cpdc-internal-spec FirebaseDatabase.podspec +pod repo push cpdc-internal-spec FirebaseAuth.podspec +#pod repo push cpdc-internal-spec FirebaseDatabase.podspec pod repo push cpdc-internal-spec FirebaseFirestore.podspec --allow-warnings #pod repo push cpdc-internal-spec FirebaseFunctions.podspec pod repo push cpdc-internal-spec FirebaseMessaging.podspec diff --git a/scripts/style.sh b/scripts/style.sh index 8eff1e8..f82af77 100755 --- a/scripts/style.sh +++ b/scripts/style.sh @@ -21,18 +21,36 @@ # Commonly # ./scripts/style.sh master -system=$(uname -s) - +# Strip the clang-format version output down to the major version. Examples: +# clang-format version 7.0.0 (tags/google/stable/2018-01-11) +# clang-format version google3-trunk (trunk r333779) version=$(clang-format --version) + +# Remove leading "clang-format version" version="${version/*version /}" +# Remove trailing parenthetical version details +version="${version/ (*)/}" +# Remove everything after the first dot (note this is a glob, not a regex) version="${version/.*/}" -if [[ "$version" != 6 && "$version" != 7 ]]; then - # Allow an older clang-format to accommodate Travis version skew. - echo "Please upgrade to clang-format version 7." - echo "If it's installed via homebrew you can run: brew upgrade clang-format" - exit 1 -fi +case "$version" in + 6 | 7) + # Allow an older clang-format to accommodate Travis version skew. + ;; + google3-trunk) + echo "Please use a publicly released clang-format; a recent LLVM release" + echo "from http://releases.llvm.org/download.html will work." + echo "Prepend to PATH when running style.sh." + exit 1 + ;; + *) + echo "Please upgrade to clang-format version 7." + echo "If it's installed via homebrew you can run: brew upgrade clang-format" + exit 1 + ;; +esac + +system=$(uname -s) if [[ "$system" == "Darwin" ]]; then version=$(swiftformat --version) version="${version/*version /}" diff --git a/scripts/update-tags.sh b/scripts/update-tags.sh index d321dd8..d29fb5c 100755 --- a/scripts/update-tags.sh +++ b/scripts/update-tags.sh @@ -27,35 +27,35 @@ # Delete any existing tags at origin -git push --delete origin '5.1.0' -git push --delete origin 'Core-5.0.2' -#git push --delete origin 'Auth-5.0.0' -git push --delete origin 'Database-5.0.1' -git push --delete origin 'Firestore-0.12.2' +git push --delete origin '5.2.0' +git push --delete origin 'Core-5.0.3' +git push --delete origin 'Auth-5.0.1' +#git push --delete origin 'Database-5.0.1' +git push --delete origin 'Firestore-0.12.3' #git push --delete origin 'Functions-2.0.0' -git push --delete origin 'Messaging-3.0.1' +git push --delete origin 'Messaging-3.0.2' #git push --delete origin 'Storage-3.0.0' # Delete local tags -git tag --delete '5.1.0' -git tag --delete 'Core-5.0.2' -#git tag --delete 'Auth-5.0.0' -git tag --delete 'Database-5.0.1' -git tag --delete 'Firestore-0.12.2' +git tag --delete '5.2.0' +git tag --delete 'Core-5.0.3' +git tag --delete 'Auth-5.0.1' +#git tag --delete 'Database-5.0.1' +git tag --delete 'Firestore-0.12.3' #git tag --delete 'Functions-2.0.0' -git tag --delete 'Messaging-3.0.1' +git tag --delete 'Messaging-3.0.2' #git tag --delete 'Storage-3.0.0' # Add and push the tags -git tag '5.1.0' -git tag 'Core-5.0.2' -#git tag 'Auth-5.0.0' -git tag 'Database-5.0.1' -git tag 'Firestore-0.12.2' +git tag '5.2.0' +git tag 'Core-5.0.3' +git tag 'Auth-5.0.1' +# git tag 'Database-5.0.1' +git tag 'Firestore-0.12.3' #git tag 'Functions-2.0.0' -git tag 'Messaging-3.0.1' +git tag 'Messaging-3.0.2' #git tag 'Storage-3.0.0' git push origin --tags |