소스 검색

Remove the gRPC Authors copyright header from generated swift files (#1612)

Motivation:

The common practice of code generators is not to apply their own copyright and
license headers to generated files. Instead the output is owned by the owner
of the input files and the executor of the code generator.

Fixes #1611.

Modifications:

Removed license header from file generator, test case files, and checks for
generated file license headers in the CI sanity license-check.

Results:

End users of protoc-gen-grpc-swift will not have a Copyright by gRPC Authors
added to the generated swift files from their own proto files.

Related:

The copyright headers could be added back via #1610.
Kristopher Wuollett 2 년 전
부모
커밋
8a70336d12

+ 0 - 16
Examples/Google/NaturalLanguage/Sources/language_service.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: google/cloud/language/v1/language_service.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import NIOConcurrencyHelpers

+ 0 - 16
Sources/Examples/Echo/Model/echo.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: echo.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import NIOConcurrencyHelpers

+ 0 - 16
Sources/Examples/HelloWorld/Model/helloworld.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: helloworld.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import NIOConcurrencyHelpers

+ 0 - 16
Sources/Examples/RouteGuide/Model/route_guide.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: route_guide.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import NIOConcurrencyHelpers

+ 0 - 16
Sources/GRPCInteroperabilityTestModels/Generated/test.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: src/proto/grpc/testing/test.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import NIOConcurrencyHelpers

+ 0 - 16
Sources/protoc-gen-grpc-swift/Generator.swift

@@ -115,22 +115,6 @@ class Generator {
     //
     // Generated by the protocol buffer compiler.
     // Source: \(self.file.name)
-    //
-
-    //
-    // Copyright 2018, gRPC Authors All rights reserved.
-    //
-    // 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.
     //\n
     """)
 

+ 0 - 16
Tests/GRPCTests/Codegen/Normalization/normalization.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: normalization.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import NIOConcurrencyHelpers

+ 0 - 16
dev/codegen-tests/01-echo/golden/echo.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: echo.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import SwiftProtobuf

+ 0 - 16
dev/codegen-tests/02-multifile/golden/a.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: a.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import SwiftProtobuf

+ 0 - 16
dev/codegen-tests/02-multifile/golden/b.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: b.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import SwiftProtobuf

+ 0 - 16
dev/codegen-tests/03-multifile-with-module-map/golden/a.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: a.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import SwiftProtobuf

+ 0 - 16
dev/codegen-tests/03-multifile-with-module-map/golden/b.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: b.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import SwiftProtobuf

+ 0 - 16
dev/codegen-tests/04-service-with-message-import/golden/service.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: service.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import SwiftProtobuf

+ 0 - 16
dev/codegen-tests/05-service-only/golden/test.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: test.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import SwiftProtobuf

+ 0 - 16
dev/codegen-tests/06-test-client-only/golden/test.grpc.swift

@@ -5,22 +5,6 @@
 // Generated by the protocol buffer compiler.
 // Source: test.proto
 //
-
-//
-// Copyright 2018, gRPC Authors All rights reserved.
-//
-// 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.
-//
 import GRPC
 import NIO
 import SwiftProtobuf

+ 2 - 40
scripts/license-check.sh

@@ -38,42 +38,6 @@ read -r -d '' COPYRIGHT_HEADER_SWIFT << 'EOF'
 EOF
 SWIFT_SHA=$(echo "$COPYRIGHT_HEADER_SWIFT" | shasum | awk '{print $1}')
 
-# Copyright header text and SHA for *.grpc.swift files
-read -r -d '' COPYRIGHT_HEADER_SWIFT_GRPC << 'EOF'
-// Copyright YEARS, gRPC Authors All rights reserved.
-//
-// 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.
-EOF
-SWIFT_GRPC_SHA=$(echo "$COPYRIGHT_HEADER_SWIFT_GRPC" | shasum | awk '{print $1}')
-
-# Copyright header text and SHA for *.pb.swift files
-read -r -d '' COPYRIGHT_HEADER_SWIFT_PB << 'EOF'
-// Copyright YEARS gRPC authors.
-//
-// 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.
-EOF
-SWIFT_GRPC_PB=$(echo "$COPYRIGHT_HEADER_SWIFT_PB" | shasum | awk '{print $1}')
-
 replace_years() {
   sed -e 's/201[56789]-20[12][0-9]/YEARS/' -e 's/201[56789]/YEARS/'
 }
@@ -134,10 +98,8 @@ check_copyright_headers() {
     fi
 
   done < <(find . -name '*.swift' \
-    ! -name 'echo.pb.swift' \
-    ! -name 'annotations.pb.swift' \
-    ! -name 'language_service.pb.swift' \
-    ! -name 'http.pb.swift' \
+    ! -name '*.pb.swift' \
+    ! -name '*.grpc.swift' \
     ! -name 'LinuxMain.swift' \
     ! -name 'XCTestManifests.swift' \
     ! -path './.build/*')