-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split the Package.swift files for CompileTests.
Provide Swift version specifics, ensure under v6 it uses v6 mode to ensure things compile cleanly there.
- Loading branch information
Showing
6 changed files
with
151 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
] | ||
) | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
] | ||
) | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"), | ||
] | ||
), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"), | ||
] | ||
), | ||
] | ||
) |