Skip to content

Commit

Permalink
Add note about bundled protos not needing import SwiftProtobuf.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvl committed Dec 11, 2023
1 parent 4ac8a2e commit 917c687
Show file tree
Hide file tree
Showing 34 changed files with 36 additions and 3 deletions.
1 change: 1 addition & 0 deletions Reference/SwiftProtobuf/google/protobuf/any.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/SwiftProtobuf/google/protobuf/api.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
// without any other information (e.g. without reading its imports).

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/SwiftProtobuf/google/protobuf/duration.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/SwiftProtobuf/google/protobuf/empty.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/SwiftProtobuf/google/protobuf/struct.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/SwiftProtobuf/google/protobuf/timestamp.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/SwiftProtobuf/google/protobuf/type.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/SwiftProtobuf/google/protobuf/wrappers.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
// individual entries of a map or fields of a oneof can already detect presence.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/any.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/api.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/descriptor.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
// without any other information (e.g. without reading its imports).

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/duration.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/empty.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/field_mask.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/source_context.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/struct.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/timestamp.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/type.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Reference/upstream/google/protobuf/wrappers.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
// individual entries of a map or fields of a oneof can already detect presence.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/any.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/api.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/descriptor.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
// without any other information (e.g. without reading its imports).

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/duration.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/empty.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/field_mask.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/source_context.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/struct.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/timestamp.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/type.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftProtobuf/wrappers.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
// individual entries of a map or fields of a oneof can already detect presence.

import Foundation
// 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
Expand Down
6 changes: 3 additions & 3 deletions Sources/protoc-gen-swift/FileGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ class FileGenerator {
return ""
}
}()
if !fileDescriptor.isBundledProto {
// The well known types ship with the runtime, everything else needs
// to import the runtime.
if fileDescriptor.isBundledProto {
p.print("// 'import \(namer.swiftProtobufModuleName)' suppressed, this proto file is meant to be bundled in the runtime.")
} else {
p.print("\(visibilityAnnotation)import \(namer.swiftProtobufModuleName)")
}
if let neededImports = generatorOptions.protoToModuleMappings.neededModules(forFile: fileDescriptor) {
Expand Down

0 comments on commit 917c687

Please sign in to comment.