Skip to content

Commit 71913fd

Browse files
authored
Simplify Experiments into a Swift package (#15622)
2 parents 2b3869a + 1d33e99 commit 71913fd

File tree

25 files changed

+72
-834
lines changed

25 files changed

+72
-834
lines changed

Experiments/Experiments.xcodeproj/project.pbxproj

Lines changed: 0 additions & 653 deletions
This file was deleted.

Experiments/Experiments.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 0 additions & 7 deletions
This file was deleted.

Experiments/Experiments.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 0 additions & 42 deletions
This file was deleted.

Experiments/Experiments/Experiments.h

Lines changed: 0 additions & 11 deletions
This file was deleted.

Experiments/Experiments/Experiments.xcconfig

Lines changed: 0 additions & 1 deletion
This file was deleted.

Experiments/Experiments/Info.plist

Lines changed: 0 additions & 22 deletions
This file was deleted.

Experiments/ExperimentsTests/Info.plist

Lines changed: 0 additions & 22 deletions
This file was deleted.

Experiments/Experiments.xcodeproj/xcshareddata/xcschemes/Experiments.xcscheme renamed to Modules/.swiftpm/xcode/xcshareddata/xcschemes/Experiments.xcscheme

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
buildForAnalyzing = "YES">
1616
<BuildableReference
1717
BuildableIdentifier = "primary"
18-
BlueprintIdentifier = "0270C08027069A8900FC799F"
19-
BuildableName = "Experiments.framework"
18+
BlueprintIdentifier = "Experiments"
19+
BuildableName = "Experiments"
2020
BlueprintName = "Experiments"
21-
ReferencedContainer = "container:Experiments.xcodeproj">
21+
ReferencedContainer = "container:">
2222
</BuildableReference>
2323
</BuildActionEntry>
2424
</BuildActionEntries>
@@ -30,7 +30,7 @@
3030
shouldUseLaunchSchemeArgsEnv = "YES">
3131
<TestPlans>
3232
<TestPlanReference
33-
reference = "container:ExperimentsTests/Experiments.xctestplan"
33+
reference = "container:Tests/ExperimentsTests/Experiments.xctestplan"
3434
default = "YES">
3535
</TestPlanReference>
3636
</TestPlans>
@@ -55,10 +55,10 @@
5555
<MacroExpansion>
5656
<BuildableReference
5757
BuildableIdentifier = "primary"
58-
BlueprintIdentifier = "0270C08027069A8900FC799F"
59-
BuildableName = "Experiments.framework"
58+
BlueprintIdentifier = "Experiments"
59+
BuildableName = "Experiments"
6060
BlueprintName = "Experiments"
61-
ReferencedContainer = "container:Experiments.xcodeproj">
61+
ReferencedContainer = "container:">
6262
</BuildableReference>
6363
</MacroExpansion>
6464
</ProfileAction>

Modules/Package.swift

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ let package = Package(
1515
name: "Codegen",
1616
targets: ["Codegen"]
1717
),
18+
.library(
19+
name: "Experiments",
20+
targets: ["Experiments"]
21+
),
1822
.library(
1923
name: "TestKit",
2024
targets: ["TestKit"]
@@ -77,6 +81,12 @@ let package = Package(
7781
name: "Codegen",
7882
exclude: ["README.md", "Sourcery"] // Relative to sources path
7983
),
84+
.target(
85+
name: "Experiments",
86+
dependencies: [
87+
.product(name: "AutomatticTracks", package: "Automattic-Tracks-iOS"),
88+
]
89+
),
8090
.target(
8191
name: "TestKit",
8292
dependencies: ["Difference", "Nimble"]
@@ -114,6 +124,13 @@ let package = Package(
114124
name: "WPMediaPicker",
115125
resources: [.process("Resources")]
116126
),
127+
.testTarget(
128+
name: "ExperimentsTests",
129+
dependencies: [
130+
"Experiments",
131+
.product(name: "AutomatticTracks", package: "Automattic-Tracks-iOS"),
132+
]
133+
),
117134
.testTarget(
118135
name: "WooFoundationTests",
119136
dependencies: ["TestKit", .target(name: "WooFoundation")]
@@ -151,8 +168,6 @@ let package = Package(
151168
// including frameworks with large resources bundled into multiple targets.
152169

153170
enum XcodeTargetNames {
154-
static let experiments = "Experiments"
155-
static let experimentsTests = "ExperimentsTests"
156171
static let fakes = "Fakes"
157172
static let hardware = "Hardware"
158173
static let hardwareTests = "HardwareTests"
@@ -178,8 +193,6 @@ enum XcodeTargetNames {
178193
enum XcodeSupport {
179194
static var products: [Product] {
180195
[
181-
XcodeTargetNames.experiments,
182-
XcodeTargetNames.experimentsTests,
183196
XcodeTargetNames.fakes,
184197
XcodeTargetNames.hardware,
185198
XcodeTargetNames.hardwareTests,
@@ -205,19 +218,6 @@ enum XcodeSupport {
205218

206219
static var targets: [Target] {
207220
[
208-
.xcodeTarget(
209-
XcodeTargetNames.experiments,
210-
dependencies: [
211-
.product(name: "AutomatticTracks", package: "Automattic-Tracks-iOS"),
212-
]
213-
),
214-
.xcodeTarget(
215-
XcodeTargetNames.experimentsTests,
216-
dependencies: [
217-
.product(name: "AutomatticTracks", package: "Automattic-Tracks-iOS"),
218-
XcodeTargetNames.experiments.asDependency
219-
]
220-
),
221221
.xcodeTarget(
222222
XcodeTargetNames.fakes,
223223
dependencies: ["Codegen"]
@@ -284,6 +284,7 @@ enum XcodeSupport {
284284
.xcodeTarget(
285285
XcodeTargetNames.storeWidgetsExtension,
286286
dependencies: [
287+
"Experiments",
287288
"WooFoundation",
288289
.product(name: "KeychainAccess", package: "KeychainAccess"),
289290
]
@@ -299,6 +300,7 @@ enum XcodeSupport {
299300
XcodeTargetNames.wooCommerce,
300301
dependencies: [
301302
"Codegen",
303+
"Experiments",
302304
"WooFoundation",
303305
"WordPressShared",
304306
"WordPressUI",

Experiments/ExperimentsTests/Experiments.xctestplan renamed to Modules/Tests/ExperimentsTests/Experiments.xctestplan

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"testTargets" : [
1515
{
1616
"target" : {
17-
"containerPath" : "container:Experiments.xcodeproj",
18-
"identifier" : "0270C08927069A8900FC799F",
17+
"containerPath" : "container:",
18+
"identifier" : "ExperimentsTests",
1919
"name" : "ExperimentsTests"
2020
}
2121
}

WooCommerce.xcworkspace/contents.xcworkspacedata

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

WooCommerce/NotificationExtension/OrderNotificationViewModel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Foundation
22
import KeychainAccess
33
import Networking
4+
import UserNotifications
45

56
/// View Model for the `OrderNotificationViewController`type.
67
///

WooCommerce/StoreWidgets/StoreInfoDataService.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import Foundation
2+
13
#if canImport(Networking)
24
import Networking
35
#elseif canImport(NetworkingWatchOS)

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,6 @@
492492
02A9BCD62737F73C00159C79 /* JetpackBenefitItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A9BCD52737F73C00159C79 /* JetpackBenefitItem.swift */; };
493493
02AA586628531D0E0068B6F0 /* CloseAccountCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02AA586528531D0E0068B6F0 /* CloseAccountCoordinatorTests.swift */; };
494494
02AAD54525023A8300BA1E26 /* ProductFormRemoteActionUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02AAD54425023A8300BA1E26 /* ProductFormRemoteActionUseCase.swift */; };
495-
02AB82EC27069D5D008D7334 /* Experiments.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 02AB82EB27069D5D008D7334 /* Experiments.framework */; };
496-
02AB82ED27069D5D008D7334 /* Experiments.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 02AB82EB27069D5D008D7334 /* Experiments.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
497495
02AC30CF2888EC8100146A25 /* WooAnalyticsEvent+LoginOnboarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02AC30CE2888EC8100146A25 /* WooAnalyticsEvent+LoginOnboarding.swift */; };
498496
02AC822C2498BC9700A615FB /* ProductFormViewModel+UpdatesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02AC822B2498BC9700A615FB /* ProductFormViewModel+UpdatesTests.swift */; };
499497
02ACD25A2852E11700EC928E /* CloseAccountCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02ACD2592852E11700EC928E /* CloseAccountCoordinator.swift */; };
@@ -1165,7 +1163,6 @@
11651163
26D1E9E82949818B00A7DC62 /* AnalyticsHubTimeRageAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26D1E9E72949818B00A7DC62 /* AnalyticsHubTimeRageAdapter.swift */; };
11661164
26D57CF72B59820600E8EFB8 /* View+ContainerBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26D57CF62B59820600E8EFB8 /* View+ContainerBackground.swift */; };
11671165
26D86B692C50110600435411 /* TopPerformersCardDataSyncUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26D86B682C50110600435411 /* TopPerformersCardDataSyncUseCase.swift */; };
1168-
26D9E54828C10A3B0098DF26 /* Experiments.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26D9E54728C10A3B0098DF26 /* Experiments.framework */; };
11691166
26DB7E3528636D2200506173 /* NonEditableOrderBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26DB7E3428636D2200506173 /* NonEditableOrderBanner.swift */; };
11701167
26DD32D42BEBCDFB00F2C69C /* WooConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D1AFBF20BC67C200DB0E8C /* WooConstants.swift */; };
11711168
26DD32D62BEBCE3900F2C69C /* UserDefaults+Woo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5AA7B3E20ED81C2004DA14F /* UserDefaults+Woo.swift */; };
@@ -3259,7 +3256,6 @@
32593256
3F09A3FE2D243D3F00D8ACCE /* WordPressAuthenticator.framework in Embed Frameworks */,
32603257
D88FDB4625DD223B00CB0DBD /* Hardware.framework in Embed Frameworks */,
32613258
B5C3B5EA20D189FC0072CB9D /* Storage.framework in Embed Frameworks */,
3262-
02AB82ED27069D5D008D7334 /* Experiments.framework in Embed Frameworks */,
32633259
B5C3B5E920D189F70072CB9D /* Yosemite.framework in Embed Frameworks */,
32643260
B5C3B5E820D189F30072CB9D /* Networking.framework in Embed Frameworks */,
32653261
3F0904152D26A40800D8ACCE /* WordPressAuthenticator.framework in Embed Frameworks */,
@@ -6469,7 +6465,6 @@
64696465
260DE20C28CA8F31009ECD7C /* Networking.framework in Frameworks */,
64706466
3F1FA84328B60125009E246C /* SwiftUI.framework in Frameworks */,
64716467
3F1FA84228B60125009E246C /* WidgetKit.framework in Frameworks */,
6472-
26D9E54828C10A3B0098DF26 /* Experiments.framework in Frameworks */,
64736468
);
64746469
runOnlyForDeploymentPostprocessing = 0;
64756470
};
@@ -6495,7 +6490,6 @@
64956490
3F2B4AEE2DDC31A200E5E49C /* XcodeTarget_WooCommerce in Frameworks */,
64966491
3F0904142D26A40800D8ACCE /* WordPressAuthenticator.framework in Frameworks */,
64976492
B5C3B5E320D189E60072CB9D /* Networking.framework in Frameworks */,
6498-
02AB82EC27069D5D008D7334 /* Experiments.framework in Frameworks */,
64996493
);
65006494
runOnlyForDeploymentPostprocessing = 0;
65016495
};

0 commit comments

Comments
 (0)