-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reset Modules as an Xcode local package with tests in CI #24518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
40dc57d
758f862
7e2e890
e2465cc
b17efe1
f6dd3c4
38c0d8a
cc744d8
35e360b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,12 +48,18 @@ let package = Package( | |
.package(url: "https://github.com/wordpress-mobile/MediaEditor-iOS", branch: "task/spm-support"), | ||
.package(url: "https://github.com/wordpress-mobile/NSObject-SafeExpectations", from: "0.0.6"), | ||
.package(url: "https://github.com/wordpress-mobile/NSURL-IDN", revision: "b34794c9a3f32312e1593d4a3d120572afa0d010"), | ||
.package(url: "https://github.com/wordpress-mobile/WordPressKit-iOS", branch: "wpios-edition"), | ||
.package( | ||
url: "https://github.com/wordpress-mobile/WordPressKit-iOS", | ||
revision: "5bc08764d2025e21685816065f611e884c8672d1" // see wpios-edition branch | ||
), | ||
.package(url: "https://github.com/zendesk/support_sdk_ios", from: "8.0.3"), | ||
// We can't use wordpress-rs branches nor commits here. Only tags work. | ||
.package(url: "https://github.com/Automattic/wordpress-rs", revision: "alpha-20250505"), | ||
.package(url: "https://github.com/wordpress-mobile/GutenbergKit", from: "0.2.0"), | ||
.package(url: "https://github.com/Automattic/color-studio", branch: "trunk"), | ||
.package( | ||
url: "https://github.com/Automattic/color-studio", | ||
revision: "bf141adc75e2769eb469a3e095bdc93dc30be8de" | ||
), | ||
.package(url: "https://github.com/wordpress-mobile/AztecEditor-iOS", from: "1.20.0"), | ||
], | ||
targets: XcodeSupport.targets + [ | ||
|
@@ -168,7 +174,12 @@ let package = Package( | |
), | ||
.testTarget(name: "JetpackStatsWidgetsCoreTests", dependencies: [.target(name: "JetpackStatsWidgetsCore")], swiftSettings: [.swiftLanguageMode(.v5)]), | ||
.testTarget(name: "DesignSystemTests", dependencies: [.target(name: "DesignSystem")], swiftSettings: [.swiftLanguageMode(.v5)]), | ||
.testTarget(name: "WordPressFluxTests", dependencies: ["WordPressFlux"], swiftSettings: [.swiftLanguageMode(.v5)]), | ||
.testTarget( | ||
name: "WordPressFluxTests", | ||
dependencies: ["WordPressFlux"], | ||
exclude: ["WordPressFluxTests.xctestplan"], | ||
swiftSettings: [.swiftLanguageMode(.v5)] | ||
), | ||
Comment on lines
-171
to
+182
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this to see how Interestingly, I tried using a copy-paste friendly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
.testTarget(name: "AsyncImageKitTests", dependencies: [ | ||
.target(name: "AsyncImageKit"), | ||
.target(name: "WordPressTesting"), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"configurations" : [ | ||
{ | ||
"id" : "92A65F35-8051-4F5F-B68A-1802B2E06105", | ||
"name" : "Test Scheme Action", | ||
"options" : { | ||
|
||
} | ||
} | ||
], | ||
"defaultOptions" : { | ||
"codeCoverage" : false | ||
}, | ||
"testTargets" : [ | ||
{ | ||
"target" : { | ||
"containerPath" : "container:", | ||
"identifier" : "WordPressFluxTests", | ||
"name" : "WordPressFluxTests" | ||
} | ||
} | ||
], | ||
"version" : 1 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -804,6 +804,7 @@ | |
3F9DD3F62CC214BF00DF1760 /* Common.debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.debug.xcconfig; sourceTree = "<group>"; }; | ||
3F9DD3F72CC2188400DF1760 /* Common.alpha.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.alpha.xcconfig; sourceTree = "<group>"; }; | ||
3FA640652670CEFE0064401E /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; | ||
3FD4B20E2DCC468200781DFA /* Modules */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Modules; path = ../Modules; sourceTree = SOURCE_ROOT; }; | ||
406A0EEF224D39C50016AD6A /* Flags.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Flags.xcassets; sourceTree = "<group>"; }; | ||
433840C622C2BA5B00CB13F8 /* AppImages.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = AppImages.xcassets; path = Resources/AppImages.xcassets; sourceTree = "<group>"; }; | ||
4A690C142BA790BC00A8E0C5 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; }; | ||
|
@@ -1606,6 +1607,7 @@ | |
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { | ||
isa = PBXGroup; | ||
children = ( | ||
3FD4B20E2DCC468200781DFA /* Modules */, | ||
0C5C46FB2D98395300F2CD55 /* Sources */, | ||
0C5A19CB2D9B07E700C25301 /* Tests */, | ||
F14B5F6F208E648200439554 /* config */, | ||
|
@@ -2705,7 +2707,6 @@ | |
); | ||
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; | ||
packageReferences = ( | ||
0C8095952DC2A4B9008DFC2F /* XCLocalSwiftPackageReference "../Modules" */, | ||
); | ||
preferredProjectObjectVersion = 77; | ||
productRefGroup = 19C28FACFE9D520D11CA2CBB /* Products */; | ||
|
@@ -7040,13 +7041,6 @@ | |
}; | ||
/* End XCConfigurationList section */ | ||
|
||
/* Begin XCLocalSwiftPackageReference section */ | ||
0C8095952DC2A4B9008DFC2F /* XCLocalSwiftPackageReference "../Modules" */ = { | ||
isa = XCLocalSwiftPackageReference; | ||
relativePath = ../Modules; | ||
}; | ||
/* End XCLocalSwiftPackageReference section */ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the difference between this and the previous setup (pre #24511) is that we no longer have any local swift package reference as a dependency for WordPress. My guess is that, whichever way it ended up like that, the duplicated reference—as a local module in the workspace and as a package reference—is what resulted in the duplicated entries shown in the #24511 description. |
||
/* Begin XCSwiftPackageProductDependency section */ | ||
0C2155A52C39A24D00EFE2C0 /* XcodeTarget_UITests */ = { | ||
isa = XCSwiftPackageProductDependency; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you had to use
...ace/xcshareddata/swiftpm/Package.resolved
managed by Xcode?Modules/Package.resolved
isn't, or is it? How did you get it to work? When you open the Xcode project, does it use pins fromModules/Package.resolved
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies @kean this change surprised me a bit and I should have preempted your question writing about it.
Before
Modules
was part of the workspace. When Xcode detected changes inModules/Package.swift
, it triggered the packages resolution and updated the resolved file in the workspacexcshareddata
folder.After
Modules
is part of the project, but is not a dependency of the project:When Xcode detects a change in
Modules/Package.swift
, it triggers the packages resolution and updatesModules/Package.resolved
.I guess that if we were to add additional package dependencies to the project Xcode would then re-introduce the workspace resolved file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified this by switching
color-studio
from pointing to a branch to a commit. The screenshot below shows Xcode highlighting the change in the gutter and the package resolution running.35e360b tracks the changes and the
.resolved
update.