Skip to content

Commit

Permalink
Add CI specific Package files for building with warnings as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abandy committed Jun 20, 2024
1 parent 89d6354 commit 078be68
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 18 deletions.
4 changes: 4 additions & 0 deletions ci/scripts/swift_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ popd

source_dir=${1}/swift/Arrow
pushd ${source_dir}
mv Package.swift Package.swift.ignore
mv Package.swift.build Package.swift
swift test
popd

source_dir=${1}/swift/ArrowFlight
pushd ${source_dir}
mv Package.swift Package.swift.ignore
mv Package.swift.build Package.swift
swift test
popd
13 changes: 2 additions & 11 deletions swift/Arrow/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,18 @@ let package = Package(
targets: [
.target(
name: "ArrowC",
path: "Sources/ArrowC",
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
]
path: "Sources/ArrowC"
),
.target(
name: "Arrow",
dependencies: ["ArrowC",
.product(name: "FlatBuffers", package: "flatbuffers"),
.product(name: "Atomics", package: "swift-atomics")
],
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
]
),
.testTarget(
name: "ArrowTests",
dependencies: ["Arrow", "ArrowC"],
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
]
dependencies: ["Arrow", "ArrowC"]
)
]
)
70 changes: 70 additions & 0 deletions swift/Arrow/Package.swift.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// swift-tools-version:5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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 PackageDescription

let package = Package(
name: "Arrow",
platforms: [
.macOS(.v10_14)
],
products: [
.library(
name: "Arrow",
targets: ["Arrow"])
],
dependencies: [
// The latest version of flatbuffers v23.5.26 was built in May 26, 2023
// and therefore doesn't include the unaligned buffer swift changes.
// This can be changed back to using the tag once a new version of
// flatbuffers has been released.
.package(url: "https://github.com/google/flatbuffers.git", branch: "master"),
.package(
url: "https://github.com/apple/swift-atomics.git",
.upToNextMajor(from: "1.2.0") // or `.upToNextMinor
)
],
targets: [
.target(
name: "ArrowC",
path: "Sources/ArrowC",
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
]
),
.target(
name: "Arrow",
dependencies: ["ArrowC",
.product(name: "FlatBuffers", package: "flatbuffers"),
.product(name: "Atomics", package: "swift-atomics")
],
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
]
),
.testTarget(
name: "ArrowTests",
dependencies: ["Arrow", "ArrowC"],
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
]
)
]
)
8 changes: 1 addition & 7 deletions swift/ArrowFlight/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,11 @@ let package = Package(
.product(name: "Arrow", package: "Arrow"),
.product(name: "GRPC", package: "grpc-swift"),
.product(name: "SwiftProtobuf", package: "swift-protobuf")
],
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
]
),
.testTarget(
name: "ArrowFlightTests",
dependencies: ["ArrowFlight"],
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
]
dependencies: ["ArrowFlight"]
)
]
)
61 changes: 61 additions & 0 deletions swift/ArrowFlight/Package.swift.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// swift-tools-version:5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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 PackageDescription

let package = Package(
name: "ArrowFlight",
platforms: [
.macOS(.v10_15)
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "ArrowFlight",
targets: ["ArrowFlight"])
],
dependencies: [
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.15.0"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.6.0"),
.package(path: "../Arrow")
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "ArrowFlight",
dependencies: [
.product(name: "Arrow", package: "Arrow"),
.product(name: "GRPC", package: "grpc-swift"),
.product(name: "SwiftProtobuf", package: "swift-protobuf")
],
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
]
),
.testTarget(
name: "ArrowFlightTests",
dependencies: ["ArrowFlight"],
swiftSettings: [
.unsafeFlags(["-warnings-as-errors"])
]
)
]
)

0 comments on commit 078be68

Please sign in to comment.