diff --git a/CompileTests/InternalImportsByDefault/Package.swift b/CompileTests/InternalImportsByDefault/Package.swift index f7d5e8759..33d1183d5 100644 --- a/CompileTests/InternalImportsByDefault/Package.swift +++ b/CompileTests/InternalImportsByDefault/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 6.0 // Package.swift // @@ -10,7 +10,6 @@ import PackageDescription -#if compiler(>=5.9) let package = Package( name: "CompileTests", dependencies: [ @@ -37,20 +36,6 @@ let package = Package( .plugin(name: "SwiftProtobufPlugin", package: "swift-protobuf") ] ) - ] -) -#else -let package = Package( - name: "CompileTests", - targets: [ - .executableTarget( - name: "InternalImportsByDefault", - exclude: [ - "swift-protobuf-config.json", - "Protos/SomeProtoWithBytes.proto", - "Protos/ServiceOnly.proto", - ] - ) - ] + ], + swiftLanguageModes: [.v6] ) -#endif diff --git a/CompileTests/InternalImportsByDefault/Package@swift-5.8.swift b/CompileTests/InternalImportsByDefault/Package@swift-5.8.swift new file mode 100644 index 000000000..4041d92af --- /dev/null +++ b/CompileTests/InternalImportsByDefault/Package@swift-5.8.swift @@ -0,0 +1,25 @@ +// swift-tools-version: 5.8 + +// Package.swift +// +// Copyright (c) 2024 Apple Inc. and the project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See LICENSE.txt for license information: +// https://github.com/apple/swift-protobuf/blob/main/LICENSE.txt + +import PackageDescription + +let package = Package( + name: "CompileTests", + targets: [ + .executableTarget( + name: "InternalImportsByDefault", + exclude: [ + "swift-protobuf-config.json", + "Protos/SomeProtoWithBytes.proto", + "Protos/ServiceOnly.proto", + ] + ) + ] +) diff --git a/CompileTests/InternalImportsByDefault/Package@swift-5.9.swift b/CompileTests/InternalImportsByDefault/Package@swift-5.9.swift new file mode 100644 index 000000000..57b316a18 --- /dev/null +++ b/CompileTests/InternalImportsByDefault/Package@swift-5.9.swift @@ -0,0 +1,40 @@ +// swift-tools-version: 5.9 + +// Package.swift +// +// Copyright (c) 2024 Apple Inc. and the project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See LICENSE.txt for license information: +// https://github.com/apple/swift-protobuf/blob/main/LICENSE.txt + +import PackageDescription + +let package = Package( + name: "CompileTests", + dependencies: [ + .package(path: "../..") + ], + targets: [ + .executableTarget( + name: "InternalImportsByDefault", + dependencies: [ + .product(name: "SwiftProtobuf", package: "swift-protobuf") + ], + exclude: [ + "Protos/SomeProtoWithBytes.proto", + "Protos/ServiceOnly.proto", + ], + swiftSettings: [ + .enableExperimentalFeature("InternalImportsByDefault"), + .enableExperimentalFeature("AccessLevelOnImport"), + // Enable warnings as errors so the build fails if warnings are + // present in generated code. + .unsafeFlags(["-warnings-as-errors"]), + ], + plugins: [ + .plugin(name: "SwiftProtobufPlugin", package: "swift-protobuf") + ] + ) + ] +) diff --git a/CompileTests/MultiModule/Package.swift b/CompileTests/MultiModule/Package.swift index 497376b36..d67a02322 100644 --- a/CompileTests/MultiModule/Package.swift +++ b/CompileTests/MultiModule/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.6 +// swift-tools-version: 6.0 import PackageDescription @@ -36,5 +36,6 @@ let package = Package( .target(name: "ImportsAPublicly"), ] ), - ] + ], + swiftLanguageModes: [.v6] ) diff --git a/CompileTests/MultiModule/Package@swift-5.8.swift b/CompileTests/MultiModule/Package@swift-5.8.swift new file mode 100644 index 000000000..9ef2ed43f --- /dev/null +++ b/CompileTests/MultiModule/Package@swift-5.8.swift @@ -0,0 +1,40 @@ +// swift-tools-version: 5.8 + +import PackageDescription + +let package = Package( + name: "CompileTests", + dependencies: [ + .package(name: "swift-protobuf", path: "../..") + ], + targets: [ + .testTarget( + name: "Test1", + dependencies: ["ImportsAPublicly"] + ), + .testTarget( + name: "Test2", + dependencies: ["ImportsImportsAPublicly"] + ), + .target( + name: "ModuleA", + dependencies: [ + .product(name: "SwiftProtobuf", package: "swift-protobuf") + ] + ), + .target( + name: "ImportsAPublicly", + dependencies: [ + .product(name: "SwiftProtobuf", package: "swift-protobuf"), + .target(name: "ModuleA"), + ] + ), + .target( + name: "ImportsImportsAPublicly", + dependencies: [ + .product(name: "SwiftProtobuf", package: "swift-protobuf"), + .target(name: "ImportsAPublicly"), + ] + ), + ] +) diff --git a/CompileTests/MultiModule/Package@swift-5.9.swift b/CompileTests/MultiModule/Package@swift-5.9.swift new file mode 100644 index 000000000..4b6080916 --- /dev/null +++ b/CompileTests/MultiModule/Package@swift-5.9.swift @@ -0,0 +1,40 @@ +// swift-tools-version: 5.9 + +import PackageDescription + +let package = Package( + name: "CompileTests", + dependencies: [ + .package(name: "swift-protobuf", path: "../..") + ], + targets: [ + .testTarget( + name: "Test1", + dependencies: ["ImportsAPublicly"] + ), + .testTarget( + name: "Test2", + dependencies: ["ImportsImportsAPublicly"] + ), + .target( + name: "ModuleA", + dependencies: [ + .product(name: "SwiftProtobuf", package: "swift-protobuf") + ] + ), + .target( + name: "ImportsAPublicly", + dependencies: [ + .product(name: "SwiftProtobuf", package: "swift-protobuf"), + .target(name: "ModuleA"), + ] + ), + .target( + name: "ImportsImportsAPublicly", + dependencies: [ + .product(name: "SwiftProtobuf", package: "swift-protobuf"), + .target(name: "ImportsAPublicly"), + ] + ), + ] +)