Skip to content

Commit

Permalink
Support SPM installation
Browse files Browse the repository at this point in the history
  • Loading branch information
allenhumphreys committed Dec 5, 2023
1 parent 006acea commit aaeb244
Show file tree
Hide file tree
Showing 22 changed files with 390 additions and 169 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/Aztec.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Aztec"
BuildableName = "Aztec"
BlueprintName = "Aztec"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Aztec"
BuildableName = "Aztec"
BlueprintName = "Aztec"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Aztec"
BuildableName = "Aztec"
BlueprintName = "Aztec"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WordPressEditor"
BuildableName = "WordPressEditor"
BlueprintName = "WordPressEditor"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AztecTests"
BuildableName = "AztecTests"
BlueprintName = "AztecTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WordPressEditorTests"
BuildableName = "WordPressEditorTests"
BlueprintName = "WordPressEditorTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AztecTests"
BuildableName = "AztecTests"
BlueprintName = "AztecTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WordPressEditorTests"
BuildableName = "WordPressEditorTests"
BlueprintName = "WordPressEditorTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Aztec"
BuildableName = "Aztec"
BlueprintName = "Aztec"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
66 changes: 66 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/WordPressEditor.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WordPressEditor"
BuildableName = "WordPressEditor"
BlueprintName = "WordPressEditor"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WordPressEditor"
BuildableName = "WordPressEditor"
BlueprintName = "WordPressEditor"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
3 changes: 1 addition & 2 deletions Aztec.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -967,8 +967,7 @@
F1DC21B22199D58B007C189E /* ElementToAttributedString */,
F1E75630215B0C9E004BC254 /* StringAttributesToAttributes */,
);
name = Converters;
path = "New Group";
path = Converters;
sourceTree = "<group>";
};
F126ADC521553E25008F7DD1 /* AttributesToStringAttributes */ = {
Expand Down
4 changes: 4 additions & 0 deletions Aztec/Classes/Extensions/NSBundle+AztecBundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import Foundation

extension Bundle {
@objc public class var aztecBundle: Bundle {
#if SPM
return .module
#else
let defaultBundle = Bundle(for: EditorView.self)
// If installed with CocoaPods, resources will be in WordPress-Aztec-iOS.bundle
if let bundleURL = defaultBundle.resourceURL,
Expand All @@ -10,5 +13,6 @@ extension Bundle {
}
// Otherwise, the default bundle is used for resources
return defaultBundle
#endif
}
}
56 changes: 0 additions & 56 deletions AztecTests/BaseConverters/CLinkedListToArrayConverterTests.swift

This file was deleted.

9 changes: 4 additions & 5 deletions AztecTests/Extensions/UIImageResizeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class UIImageResizeTests: XCTestCase {
}

func testResizingImageWorks() {
let bundle = Bundle(for: type(of: self))
let bundle = Bundle.aztecTestsBundle

guard let image = UIImage(named: "aztec", in: bundle, compatibleWith: nil) else {
XCTFail()
Expand Down Expand Up @@ -52,7 +52,7 @@ class UIImageResizeTests: XCTestCase {
}

func testResizingImageWorks2() {
let bundle = Bundle(for: type(of: self))
let bundle = Bundle.aztecTestsBundle

guard let image = UIImage(named: "aztec", in: bundle, compatibleWith: nil) else {
XCTFail()
Expand Down Expand Up @@ -90,9 +90,8 @@ class UIImageResizeTests: XCTestCase {
}

func testResizingImageWithoutSizeChangeReturnsSameImage() {
let bundle = Bundle(for: type(of: self))

guard let image = UIImage(named: "aztec", in: bundle, compatibleWith: nil) else {

guard let image = UIImage(named: "aztec", in: .aztecTestsBundle, compatibleWith: nil) else {
XCTFail()
return
}
Expand Down
11 changes: 11 additions & 0 deletions AztecTests/TestingSupport/NSBundle+AztecTestsBundle.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Foundation

extension Bundle {
@objc public class var aztecTestsBundle: Bundle {
#if SPM
return .module
#else
return Bundle(for: TextViewStub.self)
#endif
}
}
Loading

0 comments on commit aaeb244

Please sign in to comment.