From 9f927676d27c017eca3c087f8688f395e1219232 Mon Sep 17 00:00:00 2001 From: Dimitris Koutsogiorgas Date: Mon, 14 Aug 2023 11:22:57 -0700 Subject: [PATCH] Wrong output path with manifest --- wire-runtime-swift/build.gradle.kts | 3 +- .../src/test/proto/manifest.yml | 14 ++++++++ .../src/test/proto/rpc/rpc.proto | 22 ++++++++++++ .../src/test/proto/rpc/sync.proto | 34 +++++++++++++++++++ 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 wire-runtime-swift/src/test/proto/manifest.yml create mode 100644 wire-runtime-swift/src/test/proto/rpc/rpc.proto create mode 100644 wire-runtime-swift/src/test/proto/rpc/sync.proto diff --git a/wire-runtime-swift/build.gradle.kts b/wire-runtime-swift/build.gradle.kts index 6eabfbea34..4843e785b0 100644 --- a/wire-runtime-swift/build.gradle.kts +++ b/wire-runtime-swift/build.gradle.kts @@ -104,7 +104,8 @@ val generateTestProtos by tasks.creating(JavaExec::class) { mainClass.set("com.squareup.wire.WireCompiler") args = listOf( "--proto_path=$protoPath", - "--swift_out=$swiftOut" + "--swift_out=$swiftOut", + "--experimental-module-manifest=$protoPath/manifest.yml" ) } diff --git a/wire-runtime-swift/src/test/proto/manifest.yml b/wire-runtime-swift/src/test/proto/manifest.yml new file mode 100644 index 0000000000..29428ef3c1 --- /dev/null +++ b/wire-runtime-swift/src/test/proto/manifest.yml @@ -0,0 +1,14 @@ +--- +squareup_protos_rpc: + roots: + - squareup.protos.rpc.Response + prunes: + - google.protobuf.* +squareup_protos_sync: + roots: + - squareup.protos.sync.GetResponse + - squareup.protos.sync.SyncErrorCode + dependencies: + - squareup_protos_rpc + prunes: + - google.protobuf.* diff --git a/wire-runtime-swift/src/test/proto/rpc/rpc.proto b/wire-runtime-swift/src/test/proto/rpc/rpc.proto new file mode 100644 index 0000000000..b5e0a2295b --- /dev/null +++ b/wire-runtime-swift/src/test/proto/rpc/rpc.proto @@ -0,0 +1,22 @@ +/* + * Copyright 2023 Square 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. + */ +syntax = "proto2"; + +package squareup.protos.rpc; + +message Response { + optional string something = 1; +} diff --git a/wire-runtime-swift/src/test/proto/rpc/sync.proto b/wire-runtime-swift/src/test/proto/rpc/sync.proto new file mode 100644 index 0000000000..a0fd2fecd4 --- /dev/null +++ b/wire-runtime-swift/src/test/proto/rpc/sync.proto @@ -0,0 +1,34 @@ +/* + * Copyright 2023 Square 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. + */ +syntax = "proto2"; + +package squareup.protos.sync; + +import "rpc/rpc.proto"; + +enum SyncErrorCode { + SESSION_EXPIRED = 1; + UNAUTHORIZED = 2; +} + +message GetResponse { + optional string name = 1; + optional SyncErrorCode sync_error_code = 2; +} + +extend squareup.protos.rpc.Response { + optional SyncErrorCode sync_error_code = 3; +}