-
-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add XCLocalSwiftPackageReference Support (#799)
- This implements parsing of new element type named `XCLocalSwiftPackageReference` which seems to be introduced with the release of Xcode 15. - This can be seen when adding a local package via the Package settings editor in the Xcode UI in Xcode 15 - `localPackages` are now exposed on `PBXProject` - To add clarify `remotePackages` was also introduced which is intended to replace the now deprecated `packages` property Test Plan: - Use `XcodeProj` to read and write a project with the new local package element - Verify `XcodeProj` is able to read the project without any issues - Verify the project written to disk is identical to the original one that was read
- Loading branch information
Showing
22 changed files
with
2,038 additions
and
65 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
4 changes: 4 additions & 0 deletions
4
Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/.gitignore
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,4 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
/*.xcodeproj |
31 changes: 31 additions & 0 deletions
31
Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Package.swift
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,31 @@ | ||
// swift-tools-version:5.1 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "MyOtherLocalPackage", | ||
products: [ | ||
// Products define the executables and libraries produced by a package, and make them visible to other packages. | ||
.library( | ||
name: "MyOtherLocalPackage", | ||
targets: ["MyOtherLocalPackage"] | ||
), | ||
], | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
// .package(url: /* package url */, from: "1.0.0"), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages which this package depends on. | ||
.target( | ||
name: "MyOtherLocalPackage", | ||
dependencies: [] | ||
), | ||
.testTarget( | ||
name: "MyOtherLocalPackageTests", | ||
dependencies: ["MyOtherLocalPackage"] | ||
), | ||
] | ||
) |
3 changes: 3 additions & 0 deletions
3
Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/README.md
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,3 @@ | ||
# MyLocalPackage | ||
|
||
A description of this package. |
3 changes: 3 additions & 0 deletions
3
...herLocalPackage/MyOtherLocalPackage/Sources/MyOtherLocalPackage/MyOtherLocalPackage.swift
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,3 @@ | ||
struct MyOtherLocalPackage { | ||
var text = "Hello, World!" | ||
} |
7 changes: 7 additions & 0 deletions
7
Fixtures/iOS/MyOtherLocalPackage/MyOtherLocalPackage/Tests/LinuxMain.swift
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,7 @@ | ||
import XCTest | ||
|
||
import MyLocalPackageTests | ||
|
||
var tests = [XCTestCaseEntry]() | ||
tests += MyLocalPackageTests.allTests() | ||
XCTMain(tests) |
15 changes: 15 additions & 0 deletions
15
...LocalPackage/MyOtherLocalPackage/Tests/MyOtherLocalPackageTests/MyLocalPackageTests.swift
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,15 @@ | ||
import XCTest | ||
@testable import MyOtherLocalPackage | ||
|
||
final class MyLocalPackageTests: XCTestCase { | ||
func testExample() { | ||
// This is an example of a functional test case. | ||
// Use XCTAssert and related functions to verify your tests produce the correct | ||
// results. | ||
XCTAssertEqual(MyOtherLocalPackage().text, "Hello, World!") | ||
} | ||
|
||
static var allTests = [ | ||
("testExample", testExample), | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
...therLocalPackage/MyOtherLocalPackage/Tests/MyOtherLocalPackageTests/XCTestManifests.swift
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,9 @@ | ||
import XCTest | ||
|
||
#if !canImport(ObjectiveC) | ||
public func allTests() -> [XCTestCaseEntry] { | ||
[ | ||
testCase(MyLocalPackageTests.allTests), | ||
] | ||
} | ||
#endif |
Oops, something went wrong.