Skip to content
Open
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
16 changes: 2 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,8 @@ jobs:
# which is also what would be desired, so we don't bother listing explicit ones.
swift:
- version: "6.2"
hook: "SWIFT_BUILD_TEST_HOOK=\"-Xswiftc -warnings-as-errors\""
- version: "6.1"
hook: "SWIFT_BUILD_TEST_HOOK=\"-Xswiftc -warnings-as-errors\""
- version: "6.0"
hook: "SWIFT_BUILD_TEST_HOOK=\"-Xswiftc -warnings-as-errors\""
- version: "5.10"
# No "hook", see https://github.com/apple/swift-protobuf/issues/1560 for the
# current issue with using -warnings-as-errors on linux.
container:
image: swift:${{ matrix.swift.version }}
steps:
Expand All @@ -47,20 +41,14 @@ jobs:
# `make` is needed for using our own `Makefile`.
run: apt-get update && apt-get install -y make g++
- name: Build
run: make build ${{ matrix.swift.hook }}
run: make build SWIFT_BUILD_TEST_HOOK="-Xswiftc -warnings-as-errors"
- name: Test runtime
run: make test-runtime ${{ matrix.swift.hook }}
run: make test-runtime SWIFT_BUILD_TEST_HOOK="-Xswiftc -warnings-as-errors"
- name: Test plugin
# The protoc build isn't part of Package@swift-5.10.swift
if: ${{ matrix.swift.version != '5.10' }}
run: make test-plugin
- name: Test SPM plugin
# The protoc build isn't part of Package@swift-5.10.swift
if: ${{ matrix.swift.version != '5.10' }}
run: make test-spm-plugin
- name: Compilation Tests
# The protoc build isn't part of Package@swift-5.10.swift
if: ${{ matrix.swift.version != '5.10' }}
run: make compile-tests

api-breakage:
Expand Down
40 changes: 0 additions & 40 deletions CompileTests/InternalImportsByDefault/Package@swift-5.10.swift

This file was deleted.

40 changes: 0 additions & 40 deletions CompileTests/MultiModule/Package@swift-5.10.swift

This file was deleted.

16 changes: 2 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,8 @@ test-plugin: build ${PROTOC_GEN_SWIFT} ${PROTOC}
diff -ru _test Reference

# Test the SPM plugin.
# TODO: simplify this when swift 5.10 support is dropped.
test-spm-plugin:
@SWIFT_VERSION=$$(${SWIFT} --version | head -n1 | sed 's/.*Swift version \([0-9]*\)\..*/\1/'); \
if [ "$$SWIFT_VERSION" -lt 6 ]; then \
env PROTOC_PATH=$$(realpath ${PROTOC}) ${SWIFT} test --package-path PluginExamples; \
else \
${SWIFT} test --package-path PluginExamples; \
fi
${SWIFT} test --package-path PluginExamples

compile-tests: \
compile-tests-multimodule \
Expand All @@ -233,14 +227,8 @@ compile-tests-multimodule:

# Test that ensures that using access level modifiers on imports yields code that's buildable
# when `InternalImportsByDefault` is enabled on the module.
# TODO: simplify this when swift 5.10 support is dropped.
compile-tests-internalimportsbydefault:
@SWIFT_VERSION=$$(${SWIFT} --version | head -n1 | sed 's/.*Swift version \([0-9]*\)\..*/\1/'); \
if [ "$$SWIFT_VERSION" -lt 6 ]; then \
env PROTOC_PATH=$$(realpath ${PROTOC}) ${SWIFT} build --package-path CompileTests/InternalImportsByDefault; \
else \
${SWIFT} build --package-path CompileTests/InternalImportsByDefault; \
fi
${SWIFT} build --package-path CompileTests/InternalImportsByDefault


# Rebuild the reference files by running the local version of protoc-gen-swift
Expand Down
5 changes: 2 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ let package = Package(
swiftSettings: .packageSettings
),
],
swiftLanguageModes: [.v5],
swiftLanguageModes: [.v6],
cxxLanguageStandard: .gnucxx17
)

Expand All @@ -426,8 +426,7 @@ let package = Package(
extension Array where Element == PackageDescription.SwiftSetting {
static var packageSettings: Self {
[
.enableExperimentalFeature("StrictConcurrency=complete"),
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("ExistentialAny")
]
}
}
98 changes: 0 additions & 98 deletions Package@swift-5.10.swift

This file was deleted.

7 changes: 3 additions & 4 deletions Package@swift-6.0.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.10
// swift-tools-version:6.0

// Package.swift
//
Expand Down Expand Up @@ -408,7 +408,7 @@ let package = Package(
swiftSettings: .packageSettings
),
],
swiftLanguageVersions: [.v5],
swiftLanguageModes: [.v6],
cxxLanguageStandard: .gnucxx17
)

Expand All @@ -417,8 +417,7 @@ let package = Package(
extension Array where Element == PackageDescription.SwiftSetting {
static var packageSettings: Self {
[
.enableExperimentalFeature("StrictConcurrency=complete"),
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("ExistentialAny")
]
}
}
60 changes: 0 additions & 60 deletions PluginExamples/Package@swift-5.10.swift

This file was deleted.

6 changes: 3 additions & 3 deletions Plugins/SwiftProtobufPlugin/plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct SwiftProtobufPlugin {
/// Errors thrown by the `SwiftProtobufPlugin`
enum PluginError: Error, CustomStringConvertible {
/// Indicates that the target where the plugin was applied to was not `SourceModuleTarget`.
case invalidTarget(Target)
case invalidTarget(String)
/// Indicates that the file extension of an input file was not `.proto`.
case invalidInputFileExtension(String)
/// Indicates that there was no configuration file at the required location.
Expand All @@ -15,7 +15,7 @@ struct SwiftProtobufPlugin {
var description: String {
switch self {
case let .invalidTarget(target):
return "Expected a SwiftSourceModuleTarget but got '\(type(of: target))'."
return "Expected a SwiftSourceModuleTarget but got '\(target)'."
case let .invalidInputFileExtension(path):
return "The input file '\(path)' does not have a '.proto' extension."
case let .noConfigFound(path):
Expand Down Expand Up @@ -245,7 +245,7 @@ extension SwiftProtobufPlugin: BuildToolPlugin {
target: Target
) async throws -> [Command] {
guard let swiftTarget = target as? SwiftSourceModuleTarget else {
throw PluginError.invalidTarget(target)
throw PluginError.invalidTarget(String(describing: type(of: target)))
}
return try createBuildCommands(
pluginWorkDirectory: context.pluginWorkDirectory,
Expand Down
Loading