Skip to content

Commit 5e37384

Browse files
authored
Reset Modules as an Xcode local package with tests in CI (#24518)
* Add a dummy local package—We'll try to put the Modules there next * Replace ModulesAlterantive with Modules * Re-enable all the test targets in WordPressUnitTests * Delete unnecessary OCLint scheme Given OCLint is something we should drop soon, because it's only for Objective-C and we want to reduce that code surface. * Configure WordPressFlux scheme to run tests * Move Modules package reference from workspace to project * Use the shared setup CI script in the complete code freeze step * Add workaround for package path support missing * Point `color-studio` to a commit instead of a branch Locking dependencies to commits makes updating them a bit more burdensome, but at least it makes the update intentional and not automatic and surprising. This change was done to test Xcode's behavior in monitoring `Modules/Package.swift` and updating `Modules/Package.resolved`. See #24518 (comment)
1 parent 02db23c commit 5e37384

File tree

9 files changed

+72
-135
lines changed

9 files changed

+72
-135
lines changed

.buildkite/commands/complete-code-freeze.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ source use-bot-for-git
1212

1313
.buildkite/commands/checkout-release-branch.sh "$RELEASE_NUMBER"
1414

15-
echo '--- :ruby: Setup Ruby tools'
16-
install_gems
17-
18-
echo "--- :swift: Set up Swift Packages"
19-
install_swiftpm_dependencies
15+
"$(dirname "${BASH_SOURCE[0]}")/shared-set-up.sh"
2016

2117
echo '--- :closed_lock_with_key: Access secrets'
2218
bundle exec fastlane run configure_apply

.buildkite/commands/shared-set-up.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
echo "--- :rubygems: Setting up Gems"
44
install_gems
55

6+
# The push/pop is workaround for tooling not supporting a Package.swift path.
7+
# Note that neither ours nor Apple's tooling does.
8+
pushd "$(dirname "${BASH_SOURCE[0]}")/../../Modules"
69
echo "--- :swift: Setting up Swift Packages"
710
install_swiftpm_dependencies
11+
popd
812

913
echo "--- :xcode: Fetch XCFrameworks"
1014
rake dependencies

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,6 @@ WordPress/InfoPlist-internal.h
125125
# and assume no local copy would have generated the Pods.
126126
Pods/
127127

128-
# Modules — Where the Swift packages that make up the modular app live
129-
#
130-
# Ignore the Package.resolved file. The packages source of truth is the
131-
# resolved file generated by the Xcode workspace.
132-
Modules/Package.resolved
133-
134128
# While we depend on gutenberg-mobile, we download its XCFrameworks in
135129
# WordPress/Frameworks
136130
WordPress/Frameworks/*.xcframework

WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved renamed to Modules/Package.resolved

Lines changed: 27 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/Package.swift

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,18 @@ let package = Package(
4848
.package(url: "https://github.com/wordpress-mobile/MediaEditor-iOS", branch: "task/spm-support"),
4949
.package(url: "https://github.com/wordpress-mobile/NSObject-SafeExpectations", from: "0.0.6"),
5050
.package(url: "https://github.com/wordpress-mobile/NSURL-IDN", revision: "b34794c9a3f32312e1593d4a3d120572afa0d010"),
51-
.package(url: "https://github.com/wordpress-mobile/WordPressKit-iOS", branch: "wpios-edition"),
51+
.package(
52+
url: "https://github.com/wordpress-mobile/WordPressKit-iOS",
53+
revision: "5bc08764d2025e21685816065f611e884c8672d1" // see wpios-edition branch
54+
),
5255
.package(url: "https://github.com/zendesk/support_sdk_ios", from: "8.0.3"),
5356
// We can't use wordpress-rs branches nor commits here. Only tags work.
5457
.package(url: "https://github.com/Automattic/wordpress-rs", revision: "alpha-20250505"),
5558
.package(url: "https://github.com/wordpress-mobile/GutenbergKit", from: "0.2.0"),
56-
.package(url: "https://github.com/Automattic/color-studio", branch: "trunk"),
59+
.package(
60+
url: "https://github.com/Automattic/color-studio",
61+
revision: "bf141adc75e2769eb469a3e095bdc93dc30be8de"
62+
),
5763
.package(url: "https://github.com/wordpress-mobile/AztecEditor-iOS", from: "1.20.0"),
5864
],
5965
targets: XcodeSupport.targets + [
@@ -168,7 +174,12 @@ let package = Package(
168174
),
169175
.testTarget(name: "JetpackStatsWidgetsCoreTests", dependencies: [.target(name: "JetpackStatsWidgetsCore")], swiftSettings: [.swiftLanguageMode(.v5)]),
170176
.testTarget(name: "DesignSystemTests", dependencies: [.target(name: "DesignSystem")], swiftSettings: [.swiftLanguageMode(.v5)]),
171-
.testTarget(name: "WordPressFluxTests", dependencies: ["WordPressFlux"], swiftSettings: [.swiftLanguageMode(.v5)]),
177+
.testTarget(
178+
name: "WordPressFluxTests",
179+
dependencies: ["WordPressFlux"],
180+
exclude: ["WordPressFluxTests.xctestplan"],
181+
swiftSettings: [.swiftLanguageMode(.v5)]
182+
),
172183
.testTarget(name: "AsyncImageKitTests", dependencies: [
173184
.target(name: "AsyncImageKit"),
174185
.target(name: "WordPressTesting"),
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"configurations" : [
3+
{
4+
"id" : "92A65F35-8051-4F5F-B68A-1802B2E06105",
5+
"name" : "Test Scheme Action",
6+
"options" : {
7+
8+
}
9+
}
10+
],
11+
"defaultOptions" : {
12+
"codeCoverage" : false
13+
},
14+
"testTargets" : [
15+
{
16+
"target" : {
17+
"containerPath" : "container:",
18+
"identifier" : "WordPressFluxTests",
19+
"name" : "WordPressFluxTests"
20+
}
21+
}
22+
],
23+
"version" : 1
24+
}

Tests/KeystoneTests/WordPressUnitTests.xctestplan

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@
3232
},
3333
"testTargets" : [
3434
{
35-
"enabled" : false,
3635
"target" : {
3736
"containerPath" : "container:..\/Modules",
3837
"identifier" : "AsyncImageKitTests",
3938
"name" : "AsyncImageKitTests"
4039
}
4140
},
4241
{
43-
"enabled" : false,
4442
"target" : {
4543
"containerPath" : "container:WordPress.xcodeproj",
4644
"identifier" : "4AD953BA2C21451700D0EEFA",
@@ -62,39 +60,34 @@
6260
}
6361
},
6462
{
65-
"enabled" : false,
6663
"target" : {
6764
"containerPath" : "container:..\/Modules",
6865
"identifier" : "WordPressUIUnitTests",
6966
"name" : "WordPressUIUnitTests"
7067
}
7168
},
7269
{
73-
"enabled" : false,
7470
"target" : {
7571
"containerPath" : "container:..\/Modules",
7672
"identifier" : "WordPressSharedTests",
7773
"name" : "WordPressSharedTests"
7874
}
7975
},
8076
{
81-
"enabled" : false,
8277
"target" : {
8378
"containerPath" : "container:..\/Modules",
8479
"identifier" : "JetpackStatsWidgetsCoreTests",
8580
"name" : "JetpackStatsWidgetsCoreTests"
8681
}
8782
},
8883
{
89-
"enabled" : false,
9084
"target" : {
9185
"containerPath" : "container:..\/Modules",
9286
"identifier" : "WordPressFluxTests",
9387
"name" : "WordPressFluxTests"
9488
}
9589
},
9690
{
97-
"enabled" : false,
9891
"target" : {
9992
"containerPath" : "container:..\/Modules",
10093
"identifier" : "WordPressSharedObjCTests",

WordPress/WordPress.xcodeproj/project.pbxproj

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,7 @@
804804
3F9DD3F62CC214BF00DF1760 /* Common.debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.debug.xcconfig; sourceTree = "<group>"; };
805805
3F9DD3F72CC2188400DF1760 /* Common.alpha.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.alpha.xcconfig; sourceTree = "<group>"; };
806806
3FA640652670CEFE0064401E /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
807+
3FD4B20E2DCC468200781DFA /* Modules */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Modules; path = ../Modules; sourceTree = SOURCE_ROOT; };
807808
406A0EEF224D39C50016AD6A /* Flags.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Flags.xcassets; sourceTree = "<group>"; };
808809
433840C622C2BA5B00CB13F8 /* AppImages.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = AppImages.xcassets; path = Resources/AppImages.xcassets; sourceTree = "<group>"; };
809810
4A690C142BA790BC00A8E0C5 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
@@ -1606,6 +1607,7 @@
16061607
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
16071608
isa = PBXGroup;
16081609
children = (
1610+
3FD4B20E2DCC468200781DFA /* Modules */,
16091611
0C5C46FB2D98395300F2CD55 /* Sources */,
16101612
0C5A19CB2D9B07E700C25301 /* Tests */,
16111613
F14B5F6F208E648200439554 /* config */,
@@ -2705,7 +2707,6 @@
27052707
);
27062708
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
27072709
packageReferences = (
2708-
0C8095952DC2A4B9008DFC2F /* XCLocalSwiftPackageReference "../Modules" */,
27092710
);
27102711
preferredProjectObjectVersion = 77;
27112712
productRefGroup = 19C28FACFE9D520D11CA2CBB /* Products */;
@@ -7040,13 +7041,6 @@
70407041
};
70417042
/* End XCConfigurationList section */
70427043

7043-
/* Begin XCLocalSwiftPackageReference section */
7044-
0C8095952DC2A4B9008DFC2F /* XCLocalSwiftPackageReference "../Modules" */ = {
7045-
isa = XCLocalSwiftPackageReference;
7046-
relativePath = ../Modules;
7047-
};
7048-
/* End XCLocalSwiftPackageReference section */
7049-
70507044
/* Begin XCSwiftPackageProductDependency section */
70517045
0C2155A52C39A24D00EFE2C0 /* XcodeTarget_UITests */ = {
70527046
isa = XCSwiftPackageProductDependency;

0 commit comments

Comments
 (0)