Skip to content

Commit d5cf1d2

Browse files
committed
Fixes bazel breaking due to new project structure
Address warnings within the library
1 parent 40708c5 commit d5cf1d2

File tree

18 files changed

+29
-18
lines changed

18 files changed

+29
-18
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import PackageDescription
2020
let package = Package(
2121
name: "FlatBuffers",
2222
platforms: [
23-
.iOS(.v11),
23+
.iOS(.v12),
2424
.macOS(.v10_14),
2525
],
2626
products: [

grpc/examples/swift/Greeter/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import PackageDescription
2020
let package = Package(
2121
name: "Greeter",
2222
platforms: [
23-
.iOS(.v11),
23+
.iOS(.v12),
2424
.macOS(.v10_14),
2525
],
2626
dependencies: [

swift/BUILD.bazel

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
22

3+
swift_library(
4+
name = "FlexBuffers",
5+
srcs = glob([
6+
"Sources/FlexBuffers/**/*.swift",
7+
"Sources/Common/*.swift"
8+
]),
9+
module_name = "FlexBuffers",
10+
visibility = ["//visibility:public"],
11+
)
12+
313
swift_library(
414
name = "swift",
5-
srcs = glob(["Sources/FlatBuffers/*.swift"]),
15+
srcs = glob([
16+
"Sources/FlatBuffers/*.swift",
17+
"Sources/Common/*.swift"
18+
]),
619
module_name = "FlatBuffers",
720
visibility = ["//visibility:public"],
821
)
22+

swift/Sources/FlatBuffers/ByteBuffer.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import Common
1817
import Foundation
1918

2019
/// `ByteBuffer` is the interface that stores the data for a `Flatbuffers` object
@@ -294,7 +293,7 @@ public struct ByteBuffer {
294293
}
295294
assert(index < _storage.capacity, "Write index is out of writing bound")
296295
assert(index >= 0, "Writer index should be above zero")
297-
_ = withUnsafePointer(to: value) { ptr in
296+
withUnsafePointer(to: value) { ptr in
298297
_storage.withUnsafeRawPointer {
299298
memcpy(
300299
$0.advanced(by: index),

swift/Sources/FlatBuffers/Constants.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
#if canImport(Common)
1718
@_exported import Common
19+
#endif
1820
import Foundation
1921

2022
/// Type aliases

swift/Sources/FlatBuffers/FlatBufferBuilder.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import Common
1817
import Foundation
1918

2019
/// ``FlatBufferBuilder`` builds a `FlatBuffer` through manipulating its internal state.

swift/Sources/FlatBuffers/Table.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import Common
1817
import Foundation
1918

2019
/// `Table` is a Flatbuffers object that can read,

swift/Sources/FlatBuffers/_InternalByteBuffer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ struct _InternalByteBuffer {
253253
}
254254
assert(index < _storage.capacity, "Write index is out of writing bound")
255255
assert(index >= 0, "Writer index should be above zero")
256-
_ = withUnsafePointer(to: value) {
256+
withUnsafePointer(to: value) {
257257
memcpy(
258258
_storage.memory.advanced(by: index),
259259
$0,

0 commit comments

Comments
 (0)