-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable package-name setting for v5.9+
Support Target Grouping - Allow opting out of package boundary - Allow subgrouping within a package - Default set to package boundary
- Loading branch information
Showing
30 changed files
with
580 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// swift-tools-version:999.0 | ||
// swift-tools-version:5.9 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// swift-tools-version:999.0 | ||
// swift-tools-version:5.9 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
|
19 changes: 19 additions & 0 deletions
19
Fixtures/Miscellaneous/TargetGrouping/libPkg/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,19 @@ | ||
// swift-tools-version:5.9 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "libPkg", | ||
products: [ | ||
.executable(name: "ExampleApp", targets: ["ExampleApp"]), | ||
.library(name: "MainLib", targets: ["MainLib"]), | ||
], | ||
targets: [ | ||
.executableTarget(name: "ExampleApp", group: .excluded, dependencies: ["MainLib"]), | ||
.target(name: "MainLib", group: .package, dependencies: ["Core"]), | ||
.target(name: "Core", group: .package, dependencies: ["DataManager"]), | ||
.target(name: "DataManager", group: .named("DataGroup"), dependencies: ["DataModel"]), | ||
.target(name: "DataModel", group: .named("DataGroup")), | ||
.testTarget(name: "MainLibTests", group: .package, dependencies: ["MainLib"]), | ||
.testTarget(name: "BlackBoxTests", group: .excluded, dependencies: ["MainLib"]) | ||
] | ||
) |
11 changes: 11 additions & 0 deletions
11
Fixtures/Miscellaneous/TargetGrouping/libPkg/Sources/Core/Core.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,11 @@ | ||
import DataManager | ||
|
||
public struct PublicCore { | ||
public let publicVar: Int | ||
public init(publicVar: Int) { | ||
self.publicVar = publicVar | ||
} | ||
public func publicCoreFunc() { | ||
managePublicFunc() | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
Fixtures/Miscellaneous/TargetGrouping/libPkg/Sources/DataManager/File.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,5 @@ | ||
import DataModel | ||
|
||
public func managePublicFunc() -> PublicData? { | ||
return nil | ||
} |
1 change: 1 addition & 0 deletions
1
Fixtures/Miscellaneous/TargetGrouping/libPkg/Sources/DataModel/File.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 @@ | ||
public class PublicData {} |
3 changes: 3 additions & 0 deletions
3
Fixtures/Miscellaneous/TargetGrouping/libPkg/Sources/ExampleApp/main.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 @@ | ||
import MainLib | ||
|
||
publicFunc() |
6 changes: 6 additions & 0 deletions
6
Fixtures/Miscellaneous/TargetGrouping/libPkg/Sources/MainLib/Lib.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,6 @@ | ||
import Core | ||
|
||
public func publicFunc() -> Int { | ||
print("public decl") | ||
return PublicCore(publicVar: 10).publicVar | ||
} |
9 changes: 9 additions & 0 deletions
9
Fixtures/Miscellaneous/TargetGrouping/libPkg/Tests/BlackBoxTests/BlackBoxTests.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 MainLib | ||
import XCTest | ||
|
||
class BlackBoxTests: XCTestCase { | ||
func testBlackBox() { | ||
let x = publicFunc() | ||
XCTAssertTrue(x > 0) | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
Fixtures/Miscellaneous/TargetGrouping/libPkg/Tests/MainLibTests/MainLibTests.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 MainLib | ||
import XCTest | ||
|
||
class TestMainLib: XCTestCase { | ||
func testMainLib() { | ||
let x = publicFunc() | ||
XCTAssertTrue(x > 0) | ||
} | ||
} |
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
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
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
Oops, something went wrong.