浏览代码

Update license check and generated code (#858)

Motivation:

SwiftProtobuf 1.9 has added an extra line to the headers of its
generated code, our license checker didn't like this.

The Makefile also does not specify Package.resolved as a depenendcy for
the SwiftProtobuf protoc plugin target so the plugin is not always
up-to-date.

Modifications:

- Update the license checker to allow for the extra line
- Allow the license checker to complete before exiting so that all
  invalid files are listed
- Update the protoc-gen-swift Makefile target to depenend on
  Package.resolved
- Regenerate code

Result:

Happier license checks.
George Barnett 5 年之前
父节点
当前提交
4f1d6558a7
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      scripts/license-check.sh

+ 4 - 2
scripts/license-check.sh

@@ -110,7 +110,7 @@ check_copyright_headers() {
       ;;
       ;;
     *.pb.swift)
     *.pb.swift)
       expected_sha="$SWIFT_GRPC_PB"
       expected_sha="$SWIFT_GRPC_PB"
-      drop_first=8
+      drop_first=9
       expected_lines=13
       expected_lines=13
       ;;
       ;;
     */Package.swift)
     */Package.swift)
@@ -131,11 +131,13 @@ check_copyright_headers() {
     | shasum \
     | shasum \
     | awk '{print $1}')
     | awk '{print $1}')
 
 
+  rc=0
   if [ "$actual_sha" != "$expected_sha" ]; then
   if [ "$actual_sha" != "$expected_sha" ]; then
     printf "\033[0;31mMissing or invalid copyright headers in '$filename'\033[0m\n"
     printf "\033[0;31mMissing or invalid copyright headers in '$filename'\033[0m\n"
-    exit 1
+    rc=1
   fi
   fi
   done
   done
+  exit $rc
 }
 }
 
 
 check_copyright_headers
 check_copyright_headers