Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Examples/Google/NaturalLanguage/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all:
swift build -c release
cp .build/release/NaturalLanguage .

clean :
clean:
rm -rf Packages googleapis .build
rm -f Package.pins NaturalLanguage Sources/*.pb.swift Sources/*.grpc.swift google.json
rm -rf Package.resolved
97 changes: 97 additions & 0 deletions Examples/Google/NaturalLanguage/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions Examples/Google/NaturalLanguage/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ let package = Package(
name: "NaturalLanguage",
dependencies: [
.package(url: "../../..", .branch("HEAD")),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.0.2"),
.package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.7.0"),
.package(url: "https://github.com/googleapis/google-auth-library-swift.git", from: "0.5.0")
],
targets: [
.target(name: "NaturalLanguage",
dependencies: [
"GRPC",
"SwiftProtobuf",
"Commander",
"OAuth2"],
path: "Sources")
])
.target(
name: "NaturalLanguage",
dependencies: [
"GRPC",
"SwiftProtobuf",
"OAuth2"
],
path: "Sources"
)
]
)
12 changes: 8 additions & 4 deletions Examples/Google/NaturalLanguage/RUNME
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ if [ ! -d "googleapis" ]; then
fi

protoc \
google/cloud/language/v1/language_service.proto \
google/cloud/language/v1/language_service.proto \
google/api/annotations.proto \
google/api/http.proto \
google/protobuf/descriptor.proto \
-Igoogleapis \
-Igoogleapis \
-I../common/include \
--swift_out=googleapis \
--grpc-swift_out=googleapis

# move Swift files to the Sources directory
find googleapis -name "*.swift" -exec mv {} Sources \;
# Move Swift files to the Sources directory. descriptor.pb.swift is provided
# with SwiftProtobuf (from 1.7.0).
find googleapis \
-name "*.swift" \
! -name "descriptor.pb.swift" \
-exec mv {} Sources \;
70 changes: 70 additions & 0 deletions Examples/Google/NaturalLanguage/Sources/annotations.pb.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// DO NOT EDIT.
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: google/api/annotations.proto
//
// For information on using the generated types, please see the documentation:
// https://github.com/apple/swift-protobuf/

// Copyright (c) 2015, Google Inc.
//
// 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 Foundation
import SwiftProtobuf

// 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
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that your are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}

// MARK: - Extension support defined in annotations.proto.

extension SwiftProtobuf.Google_Protobuf_MethodOptions {

/// See `HttpRule`.
var Google_Api_http: Google_Api_HttpRule {
get {return getExtensionValue(ext: Google_Api_Extensions_http) ?? Google_Api_HttpRule()}
set {setExtensionValue(ext: Google_Api_Extensions_http, value: newValue)}
}
/// Returns true if extension `Google_Api_Extensions_http`
/// has been explicitly set.
var hasGoogle_Api_http: Bool {
return hasExtensionValue(ext: Google_Api_Extensions_http)
}
/// Clears the value of extension `Google_Api_Extensions_http`.
/// Subsequent reads from it will return its default value.
mutating func clearGoogle_Api_http() {
clearExtensionValue(ext: Google_Api_Extensions_http)
}

}

/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by
/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed
/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create
/// a larger `SwiftProtobuf.SimpleExtensionMap`.
let Google_Api_Annotations_Extensions: SwiftProtobuf.SimpleExtensionMap = [
Google_Api_Extensions_http
]

/// See `HttpRule`.
let Google_Api_Extensions_http = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<Google_Api_HttpRule>, SwiftProtobuf.Google_Protobuf_MethodOptions>(
_protobuf_fieldNumber: 72295728,
fieldName: "google.api.http"
)
Loading