From 2165d9edffe749f53149bc3a1b70089add6852dd Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 23 Jun 2020 17:39:03 +0100 Subject: [PATCH 01/20] Implement option to use the new PHPicker on iOS14. --- .../AztecExample.xcodeproj/project.pbxproj | 6 ++ .../EditorDemoController+PHPicker.swift | 69 +++++++++++++++++++ Example/Example/EditorDemoController.swift | 7 +- Example/Example/Info.plist | 2 + 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 Example/Example/EditorDemoController+PHPicker.swift diff --git a/Example/AztecExample.xcodeproj/project.pbxproj b/Example/AztecExample.xcodeproj/project.pbxproj index a76700b52..01ba8bd72 100644 --- a/Example/AztecExample.xcodeproj/project.pbxproj +++ b/Example/AztecExample.xcodeproj/project.pbxproj @@ -40,6 +40,7 @@ FF149F4A20E3C49A0070FECB /* imagesOverlays.html in Resources */ = {isa = PBXBuildFile; fileRef = FF149F4920E3C49A0070FECB /* imagesOverlays.html */; }; FF1FD05C20932EDE00186384 /* gutenberg.html in Resources */ = {isa = PBXBuildFile; fileRef = FF1FD05B20932EDE00186384 /* gutenberg.html */; }; FF1FEC7E2406E071006221AA /* underline.html in Resources */ = {isa = PBXBuildFile; fileRef = FF1FEC7D2406E071006221AA /* underline.html */; }; + FF29DF0C24A2399A00868706 /* EditorDemoController+PHPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF29DF0B24A2399A00868706 /* EditorDemoController+PHPicker.swift */; }; FF5CDACD239E78B200CF235B /* failedMedia.html in Resources */ = {isa = PBXBuildFile; fileRef = FF5CDACC239E78B200CF235B /* failedMedia.html */; }; FF629DC9223BC418004C4106 /* videoShortcodes.html in Resources */ = {isa = PBXBuildFile; fileRef = FF629DC8223BC418004C4106 /* videoShortcodes.html */; }; FF9AF5481DB0E4E200C42ED3 /* AttachmentDetailsViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FF9AF5471DB0E4E200C42ED3 /* AttachmentDetailsViewController.storyboard */; }; @@ -162,6 +163,8 @@ FF149F4920E3C49A0070FECB /* imagesOverlays.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = imagesOverlays.html; sourceTree = ""; }; FF1FD05B20932EDE00186384 /* gutenberg.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = gutenberg.html; sourceTree = ""; }; FF1FEC7D2406E071006221AA /* underline.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = underline.html; sourceTree = ""; }; + FF29DF0B24A2399A00868706 /* EditorDemoController+PHPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "EditorDemoController+PHPicker.swift"; sourceTree = ""; }; + FF29DF1024A246D800868706 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; FF5CDACC239E78B200CF235B /* failedMedia.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = failedMedia.html; sourceTree = ""; }; FF629DC8223BC418004C4106 /* videoShortcodes.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = videoShortcodes.html; sourceTree = ""; }; FF9AF5471DB0E4E200C42ED3 /* AttachmentDetailsViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = AttachmentDetailsViewController.storyboard; sourceTree = ""; }; @@ -197,6 +200,7 @@ 02ECB379638AE0CDEAB24BEC /* Frameworks */ = { isa = PBXGroup; children = ( + FF29DF1024A246D800868706 /* MobileCoreServices.framework */, F122C2502072AE190018ED06 /* libxml2.tbd */, 5967193D1D8BC60D00F18F7F /* Gridicons.framework */, ); @@ -267,6 +271,7 @@ FF9AF5471DB0E4E200C42ED3 /* AttachmentDetailsViewController.storyboard */, 607FACD71AFB9204008FA782 /* ViewController.swift */, E63EF92A1D36A60B00B5BA4B /* EditorDemoController.swift */, + FF29DF0B24A2399A00868706 /* EditorDemoController+PHPicker.swift */, FFFA53D423C4AD0B00829A43 /* TextViewAttachmentDelegateProvider.swift */, FFFA53CF23C4A64200829A43 /* MediaInserter.swift */, FFFA53D623C4C43700829A43 /* UIImage+SaveTo.swift */, @@ -491,6 +496,7 @@ FFFA53D023C4A64200829A43 /* MediaInserter.swift in Sources */, B5DB1C371EC630E10005E623 /* UnknownEditorViewController.swift in Sources */, FFFA53D523C4AD0B00829A43 /* TextViewAttachmentDelegateProvider.swift in Sources */, + FF29DF0C24A2399A00868706 /* EditorDemoController+PHPicker.swift in Sources */, 599F25701D8BCF57002871D6 /* AppDelegate.swift in Sources */, 59D2873B1D8C599B00B99C80 /* AttachmentDetailsViewController.swift in Sources */, FFFA53D723C4C43700829A43 /* UIImage+SaveTo.swift in Sources */, diff --git a/Example/Example/EditorDemoController+PHPicker.swift b/Example/Example/EditorDemoController+PHPicker.swift new file mode 100644 index 000000000..e9006b81c --- /dev/null +++ b/Example/Example/EditorDemoController+PHPicker.swift @@ -0,0 +1,69 @@ +import Foundation +import PhotosUI +import CoreServices +import AVFoundation + + +@available(iOS 14, *) +extension EditorDemoController: PHPickerViewControllerDelegate { + + func showPHPicker() { + var configuration = PHPickerConfiguration() + configuration.selectionLimit = 10 + configuration.filter = PHPickerFilter.any(of: [.images, .videos]); + let viewController = PHPickerViewController(configuration: configuration) + viewController.delegate = self + present(viewController, animated: true, completion: nil) + } + + func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { + for result in results { + print("ID: \(result.assetIdentifier ?? "")\n") + print("Type Identifiers: \(result.itemProvider.registeredTypeIdentifiers)\n") + let mediaTypesPriority: [String] = [AVFileType.heic.rawValue, kUTTypeJPEG as String, kUTTypeGIF as String, AVFileType.mp4.rawValue, AVFileType.mov.rawValue] + for mediaType in mediaTypesPriority { + if result.itemProvider.hasItemConformingToTypeIdentifier(mediaType) { + exportImage(in: result.itemProvider, forTypeIdentifier: mediaType) + break + } + } + let videoTypesPriority: [String] = [AVFileType.mp4.rawValue, AVFileType.mov.rawValue] + for mediaType in videoTypesPriority { + if result.itemProvider.hasItemConformingToTypeIdentifier(mediaType) { + exportVideo(in: result.itemProvider, forTypeIdentifier: mediaType) + break + } + } + } + self.dismiss(animated: true, completion: nil) + } + + func exportImage(in item: NSItemProvider, forTypeIdentifier typeIdentifier: String) { + item.loadDataRepresentation(forTypeIdentifier: typeIdentifier) { (data, error) in + guard let imageData = data, let image = UIImage(data: imageData) else { + return + } + DispatchQueue.main.async { + self.mediaInserter.insertImage(image) + } + } + } + + func exportVideo(in item: NSItemProvider, forTypeIdentifier typeIdentifier: String) { + item.loadInPlaceFileRepresentation(forTypeIdentifier: typeIdentifier) { (url, result, error) in + guard let videoURL = url else { + return + } + let fileCoordinator: NSFileCoordinator = NSFileCoordinator.init(filePresenter: nil) + fileCoordinator.coordinate(readingItemAt: videoURL, options: [], error: nil) { (url) in + let fileManager = FileManager.init() + let destinationURL = URL(fileURLWithPath: NSTemporaryDirectory()+UUID().uuidString+".mp4") + try? fileManager.copyItem(at: url, to: destinationURL) + DispatchQueue.main.async { + self.mediaInserter.insertVideo(destinationURL) + } + } + } + } + +} diff --git a/Example/Example/EditorDemoController.swift b/Example/Example/EditorDemoController.swift index 792e6771e..9a3e246a3 100644 --- a/Example/Example/EditorDemoController.swift +++ b/Example/Example/EditorDemoController.swift @@ -1012,7 +1012,12 @@ extension EditorDemoController { } toolbar.leadingItemHandler = { [weak self] item in - self?.showImagePicker() + if #available(iOS 14, *) { + self?.showPHPicker() + } else { + // Fallback on earlier versions + self?.showImagePicker() + } } return toolbar diff --git a/Example/Example/Info.plist b/Example/Example/Info.plist index 5884bce7c..192008bb2 100644 --- a/Example/Example/Info.plist +++ b/Example/Example/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion en + NSAppleMusicUsageDescription + To add photos or videos to your content. CFBundleDisplayName Aztec CFBundleExecutable From 24af5294490311d94283785cb93e370bba7e16cc Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Fri, 26 Jun 2020 14:21:50 +0100 Subject: [PATCH 02/20] Use new API UniformTypeIdentifiers to check UTI compability. --- .../Example/EditorDemoController+PHPicker.swift | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Example/Example/EditorDemoController+PHPicker.swift b/Example/Example/EditorDemoController+PHPicker.swift index e9006b81c..a15ac50ad 100644 --- a/Example/Example/EditorDemoController+PHPicker.swift +++ b/Example/Example/EditorDemoController+PHPicker.swift @@ -1,8 +1,6 @@ import Foundation +import UniformTypeIdentifiers import PhotosUI -import CoreServices -import AVFoundation - @available(iOS 14, *) extension EditorDemoController: PHPickerViewControllerDelegate { @@ -20,17 +18,18 @@ extension EditorDemoController: PHPickerViewControllerDelegate { for result in results { print("ID: \(result.assetIdentifier ?? "")\n") print("Type Identifiers: \(result.itemProvider.registeredTypeIdentifiers)\n") - let mediaTypesPriority: [String] = [AVFileType.heic.rawValue, kUTTypeJPEG as String, kUTTypeGIF as String, AVFileType.mp4.rawValue, AVFileType.mov.rawValue] + + let mediaTypesPriority: [UTType] = [.heic, .jpeg, .gif] for mediaType in mediaTypesPriority { - if result.itemProvider.hasItemConformingToTypeIdentifier(mediaType) { - exportImage(in: result.itemProvider, forTypeIdentifier: mediaType) + if result.itemProvider.hasItemConformingToTypeIdentifier(mediaType.identifier) { + exportImage(in: result.itemProvider, forTypeIdentifier: mediaType.identifier) break } } - let videoTypesPriority: [String] = [AVFileType.mp4.rawValue, AVFileType.mov.rawValue] + let videoTypesPriority: [UTType] = [.movie, .mpeg] for mediaType in videoTypesPriority { - if result.itemProvider.hasItemConformingToTypeIdentifier(mediaType) { - exportVideo(in: result.itemProvider, forTypeIdentifier: mediaType) + if result.itemProvider.hasItemConformingToTypeIdentifier(mediaType.identifier) { + exportVideo(in: result.itemProvider, forTypeIdentifier: mediaType.identifier) break } } From bbb6c7e8fefac11fe019a7a5e8ccd870db7872bc Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 00:21:19 +0000 Subject: [PATCH 03/20] Update project configuration for Xcode 12. --- .../xcshareddata/xcschemes/Aztec.xcscheme | 28 ++++++++----------- .../xcschemes/Carthage Update.xcscheme | 6 +--- .../AztecExample.xcodeproj/project.pbxproj | 6 +++- .../xcschemes/AztecExample.xcscheme | 2 +- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme b/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme index 02bb0c855..1cf5571d4 100644 --- a/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme +++ b/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES" + onlyGenerateCoverageForSpecifiedTargets = "YES"> + + + + - - - - - - - - - - - - Date: Tue, 5 Jan 2021 00:23:14 +0000 Subject: [PATCH 04/20] Update circle.ci configuration to use Xcode 12 --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c0a10cfd..3656efa9f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ workflows: jobs: - ios/test: name: Test - xcode-version: "11.0" + xcode-version: "12.1.0" carthage-update: true carthage-working-directory: Example bundle-install: false @@ -21,19 +21,19 @@ workflows: - ios/validate-podspec: name: Validate WordPress-Aztec-iOS.podspec - xcode-version: "11.0" + xcode-version: "12.1.0" podspec-path: WordPress-Aztec-iOS.podspec - ios/validate-podspec: name: Validate WordPress-Editor-iOS.podspec - xcode-version: "11.0" + xcode-version: "12.1.0" podspec-path: WordPress-Editor-iOS.podspec # Reference WordPress-Aztec-iOS.podspec locally so we don't have to get it from the specs repo additional-parameters: --include-podspecs=WordPress-Aztec-iOS.podspec - ios/publish-podspec: name: Publish WordPress-Aztec-iOS to Trunk - xcode-version: "11.0" + xcode-version: "12.1.0" podspec-path: WordPress-Aztec-iOS.podspec post-to-slack: true filters: From 802c0715b3fc92008f524e679ba8492c594f70b8 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 13:55:14 +0000 Subject: [PATCH 05/20] Update circle.ci configuration to use custom carthage script. --- .circleci/config.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3656efa9f..8ac9f5bcd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,14 +4,20 @@ orbs: # Using 1.0 of our Orbs means it will use the latest 1.0.x version from https://github.com/wordpress-mobile/circleci-orbs ios: wordpress-mobile/ios@1.0 +commands: + custom-carthage: + steps: + - run: + name: Custom Carthage + command: cd Example && ./carthage.sh build --platform iOS && cd .. workflows: test_and_validate: jobs: + - custom-carthage + - ios/test: name: Test xcode-version: "12.1.0" - carthage-update: true - carthage-working-directory: Example bundle-install: false pod-install: false workspace: Aztec.xcworkspace @@ -45,7 +51,7 @@ workflows: - ios/publish-podspec: name: Publish WordPress-Editor-iOS to Trunk requires: [ "Publish WordPress-Aztec-iOS to Trunk" ] - xcode-version: "11.0" + xcode-version: "12.1.0" podspec-path: WordPress-Editor-iOS.podspec post-to-slack: true filters: From 63c28950b9fac496a811c5c5e8cfc656423a4c98 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 13:58:15 +0000 Subject: [PATCH 06/20] Update circle.ci configuration to use custom carthage script. --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8ac9f5bcd..dc11f3d56 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,9 @@ commands: workflows: test_and_validate: jobs: - - custom-carthage + - custom-carthage: + steps: + - custom-carthage - ios/test: name: Test From b14be5d6a22cca2eb8e7b536efd72fa597f1bada Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 14:04:19 +0000 Subject: [PATCH 07/20] Update circle.ci configuration to use custom carthage script. --- .circleci/config.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc11f3d56..63e428018 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,12 +10,16 @@ commands: - run: name: Custom Carthage command: cd Example && ./carthage.sh build --platform iOS && cd .. + +jobs: + custom-carthage: + steps: + - custom-carthage + workflows: test_and_validate: jobs: - - custom-carthage: - steps: - - custom-carthage + - custom-carthage - ios/test: name: Test From f5d1fa4c6e4735198a1b3f3ded0ed86b6370349c Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 14:14:55 +0000 Subject: [PATCH 08/20] Update circle.ci configuration to use custom carthage script. --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 63e428018..10f25a708 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,6 +13,8 @@ commands: jobs: custom-carthage: + macos: + - xcode-version: "12.1.0" steps: - custom-carthage From f0c57289a5149981223a07c3d6e9ff3903077bb6 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 14:23:01 +0000 Subject: [PATCH 09/20] Update circle.ci configuration to use custom carthage script. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 10f25a708..cdc969673 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,7 @@ commands: jobs: custom-carthage: macos: - - xcode-version: "12.1.0" + - xcode: "12.1.0" steps: - custom-carthage From ac362630e3a124ba9a2c5c9684d1a710ebdb6631 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 14:26:51 +0000 Subject: [PATCH 10/20] Update circle.ci configuration to use custom carthage script. --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cdc969673..8fbcb543d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,14 +7,13 @@ orbs: commands: custom-carthage: steps: + - xcode-version: "12.1.0" - run: name: Custom Carthage command: cd Example && ./carthage.sh build --platform iOS && cd .. jobs: custom-carthage: - macos: - - xcode: "12.1.0" steps: - custom-carthage From c5dcb9470e2da133ea45e3ea16c6c1c8bd70873b Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 14:28:46 +0000 Subject: [PATCH 11/20] Update circle.ci configuration to use custom carthage script. --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8fbcb543d..7a960c1e5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,13 +7,15 @@ orbs: commands: custom-carthage: steps: - - xcode-version: "12.1.0" - run: name: Custom Carthage command: cd Example && ./carthage.sh build --platform iOS && cd .. jobs: custom-carthage: + executor: + name: default + xcode-version: "12.1.0" steps: - custom-carthage From b4acbd2313d586e5322c108e0da8d0caa210268c Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 14:45:03 +0000 Subject: [PATCH 12/20] Update circle.ci configuration to use custom carthage script. --- .circleci/config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a960c1e5..83ebf75bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,6 +11,16 @@ commands: name: Custom Carthage command: cd Example && ./carthage.sh build --platform iOS && cd .. +executors: + default: + description: | + An executor with sensible defaults for iOS builds. + See supported versions here: https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions + parameters: + <<: *xcode_version_parameter + macos: + xcode: << parameters.xcode-version >> + jobs: custom-carthage: executor: From 11a1662ad006da3deefaf3c1582456991860dfd2 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 14:49:49 +0000 Subject: [PATCH 13/20] Update circle.ci configuration to use custom carthage script. --- .circleci/config.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83ebf75bf..c4ff741a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,16 +16,13 @@ executors: description: | An executor with sensible defaults for iOS builds. See supported versions here: https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions - parameters: - <<: *xcode_version_parameter macos: - xcode: << parameters.xcode-version >> - + xcode: "12.1.0" + jobs: custom-carthage: executor: name: default - xcode-version: "12.1.0" steps: - custom-carthage From 5102ea74f0884e582d345a9816baf89b522cdee7 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 15:00:03 +0000 Subject: [PATCH 14/20] Update circle.ci configuration to use custom carthage script. --- .circleci/config.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4ff741a9..93362185c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,13 +4,6 @@ orbs: # Using 1.0 of our Orbs means it will use the latest 1.0.x version from https://github.com/wordpress-mobile/circleci-orbs ios: wordpress-mobile/ios@1.0 -commands: - custom-carthage: - steps: - - run: - name: Custom Carthage - command: cd Example && ./carthage.sh build --platform iOS && cd .. - executors: default: description: | @@ -24,7 +17,9 @@ jobs: executor: name: default steps: - - custom-carthage + - run: + name: Custom Carthage + command: cd Example && ./carthage.sh build --platform iOS && cd .. workflows: test_and_validate: From 85505c72d988d87c21fb8ca525a7a3fadcfbb569 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 17:47:04 +0000 Subject: [PATCH 15/20] Remove uneccessary key in the Info.plist --- Example/Example/Info.plist | 2 -- 1 file changed, 2 deletions(-) diff --git a/Example/Example/Info.plist b/Example/Example/Info.plist index 192008bb2..5884bce7c 100644 --- a/Example/Example/Info.plist +++ b/Example/Example/Info.plist @@ -4,8 +4,6 @@ CFBundleDevelopmentRegion en - NSAppleMusicUsageDescription - To add photos or videos to your content. CFBundleDisplayName Aztec CFBundleExecutable From 64258c856cf5aeeb5f2dd2b811caaaa860ea5550 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 18:00:37 +0000 Subject: [PATCH 16/20] Update script to use build step instead of orb option. --- .circleci/config.yml | 27 ++---- .../xcschemes/Carthage Update.xcscheme | 26 +----- .../AztecExample.xcodeproj/project.pbxproj | 82 +++++++++++++++++++ 3 files changed, 93 insertions(+), 42 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 93362185c..1e91d0656 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,28 +4,15 @@ orbs: # Using 1.0 of our Orbs means it will use the latest 1.0.x version from https://github.com/wordpress-mobile/circleci-orbs ios: wordpress-mobile/ios@1.0 -executors: - default: - description: | - An executor with sensible defaults for iOS builds. - See supported versions here: https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions - macos: - xcode: "12.1.0" - -jobs: - custom-carthage: - executor: - name: default - steps: - - run: - name: Custom Carthage - command: cd Example && ./carthage.sh build --platform iOS && cd .. - workflows: test_and_validate: jobs: - - custom-carthage - + - ios/xcode-build: + name: Carthage Update + xcode-version: "12.1.0" + workspace: Aztec.workspace + scheme: Carthage Update + ios-version: "14.0" - ios/test: name: Test xcode-version: "12.1.0" @@ -34,7 +21,7 @@ workflows: workspace: Aztec.xcworkspace scheme: AztecExample device: iPhone 11 - ios-version: "13.0" + ios-version: "14.0" - ios/validate-podspec: name: Validate WordPress-Aztec-iOS.podspec diff --git a/Aztec.xcodeproj/xcshareddata/xcschemes/Carthage Update.xcscheme b/Aztec.xcodeproj/xcshareddata/xcschemes/Carthage Update.xcscheme index 18f4d552e..3f0e0cd99 100644 --- a/Aztec.xcodeproj/xcshareddata/xcschemes/Carthage Update.xcscheme +++ b/Aztec.xcodeproj/xcshareddata/xcschemes/Carthage Update.xcscheme @@ -14,10 +14,10 @@ buildForAnalyzing = "YES"> + BlueprintIdentifier = "FFB801A425A4DE2000B5A78F" + BuildableName = "Chartage Update" + BlueprintName = "Chartage Update" + ReferencedContainer = "container:Example/AztecExample.xcodeproj"> @@ -40,15 +40,6 @@ debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> - - - - - - - - diff --git a/Example/AztecExample.xcodeproj/project.pbxproj b/Example/AztecExample.xcodeproj/project.pbxproj index 3806fb09e..af07897f6 100644 --- a/Example/AztecExample.xcodeproj/project.pbxproj +++ b/Example/AztecExample.xcodeproj/project.pbxproj @@ -6,6 +6,20 @@ objectVersion = 46; objects = { +/* Begin PBXAggregateTarget section */ + FFB801A425A4DE2000B5A78F /* Chartage Update */ = { + isa = PBXAggregateTarget; + buildConfigurationList = FFB801AC25A4DE2000B5A78F /* Build configuration list for PBXAggregateTarget "Chartage Update" */; + buildPhases = ( + FFB801AF25A4DE2A00B5A78F /* ShellScript */, + ); + dependencies = ( + ); + name = "Chartage Update"; + productName = ChartageBuild; + }; +/* End PBXAggregateTarget section */ + /* Begin PBXBuildFile section */ 59280F2A1D47CAF40083FB59 /* content.html in Resources */ = {isa = PBXBuildFile; fileRef = 59280F281D47CAF40083FB59 /* content.html */; }; 59280F2B1D47CAF40083FB59 /* SampleText.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 59280F291D47CAF40083FB59 /* SampleText.rtf */; }; @@ -394,6 +408,10 @@ ProvisioningStyle = Automatic; TestTargetID = 607FACCF1AFB9204008FA782; }; + FFB801A425A4DE2000B5A78F = { + CreatedOnToolsVersion = 12.3; + ProvisioningStyle = Automatic; + }; }; }; buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "AztecExample" */; @@ -421,6 +439,7 @@ targets = ( 607FACCF1AFB9204008FA782 /* AztecExample */, CC400F161E9EC04200859AB4 /* AztecUITests */, + FFB801A425A4DE2000B5A78F /* Chartage Update */, ); }; /* End PBXProject section */ @@ -488,6 +507,26 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + FFB801AF25A4DE2A00B5A78F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n./carthage.sh build --platform iOS\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 607FACCC1AFB9204008FA782 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -952,6 +991,38 @@ }; name = "Release-Alpha"; }; + FFB801A525A4DE2000B5A78F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + FFB801A625A4DE2000B5A78F /* Release-Alpha */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = "Release-Alpha"; + }; + FFB801A725A4DE2000B5A78F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + FFB801A825A4DE2000B5A78F /* Profiling */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profiling; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -988,6 +1059,17 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + FFB801AC25A4DE2000B5A78F /* Build configuration list for PBXAggregateTarget "Chartage Update" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FFB801A525A4DE2000B5A78F /* Debug */, + FFB801A625A4DE2000B5A78F /* Release-Alpha */, + FFB801A725A4DE2000B5A78F /* Release */, + FFB801A825A4DE2000B5A78F /* Profiling */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 607FACC81AFB9204008FA782 /* Project object */; From 2869147ecfef8a3a28ac5ce1bc216876d6558a03 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 18:04:43 +0000 Subject: [PATCH 17/20] Update script. --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e91d0656..84fd97a53 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,12 +7,14 @@ orbs: workflows: test_and_validate: jobs: - - ios/xcode-build: + - ios/test: name: Carthage Update xcode-version: "12.1.0" workspace: Aztec.workspace scheme: Carthage Update ios-version: "14.0" + device: iPhone 11 + - ios/test: name: Test xcode-version: "12.1.0" From d155eaea7ef5b31a1555e6d7608b00027bf5b481 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 18:23:23 +0000 Subject: [PATCH 18/20] Update script --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 84fd97a53..4ce30ede3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,9 +10,8 @@ workflows: - ios/test: name: Carthage Update xcode-version: "12.1.0" - workspace: Aztec.workspace - scheme: Carthage Update - ios-version: "14.0" + workspace: Aztec.xcworkspace + scheme: Carthage Update device: iPhone 11 - ios/test: From 63811951a98682479aa241868d910653978dbf1d Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 18:48:38 +0000 Subject: [PATCH 19/20] Add new scheme to build Carthage. --- .circleci/config.yml | 2 +- .../xcshareddata/xcschemes/ChartageBuild.xcscheme | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) rename Aztec.xcodeproj/xcshareddata/xcschemes/Carthage Update.xcscheme => Example/AztecExample.xcodeproj/xcshareddata/xcschemes/ChartageBuild.xcscheme (81%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4ce30ede3..bf04b6dbd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ workflows: name: Carthage Update xcode-version: "12.1.0" workspace: Aztec.xcworkspace - scheme: Carthage Update + scheme: CarthageBuild device: iPhone 11 - ios/test: diff --git a/Aztec.xcodeproj/xcshareddata/xcschemes/Carthage Update.xcscheme b/Example/AztecExample.xcodeproj/xcshareddata/xcschemes/ChartageBuild.xcscheme similarity index 81% rename from Aztec.xcodeproj/xcshareddata/xcschemes/Carthage Update.xcscheme rename to Example/AztecExample.xcodeproj/xcshareddata/xcschemes/ChartageBuild.xcscheme index 3f0e0cd99..bedc495b7 100644 --- a/Aztec.xcodeproj/xcshareddata/xcschemes/Carthage Update.xcscheme +++ b/Example/AztecExample.xcodeproj/xcshareddata/xcschemes/ChartageBuild.xcscheme @@ -17,7 +17,7 @@ BlueprintIdentifier = "FFB801A425A4DE2000B5A78F" BuildableName = "Chartage Update" BlueprintName = "Chartage Update" - ReferencedContainer = "container:Example/AztecExample.xcodeproj"> + ReferencedContainer = "container:AztecExample.xcodeproj"> @@ -47,6 +47,15 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> + + + + From 648ae1f79deef97b4dc6d4e5483591de979dd05d Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Tue, 5 Jan 2021 23:11:01 +0000 Subject: [PATCH 20/20] Rename scheme --- .../xcschemes/{ChartageBuild.xcscheme => CarthageBuild.xcscheme} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Example/AztecExample.xcodeproj/xcshareddata/xcschemes/{ChartageBuild.xcscheme => CarthageBuild.xcscheme} (100%) diff --git a/Example/AztecExample.xcodeproj/xcshareddata/xcschemes/ChartageBuild.xcscheme b/Example/AztecExample.xcodeproj/xcshareddata/xcschemes/CarthageBuild.xcscheme similarity index 100% rename from Example/AztecExample.xcodeproj/xcshareddata/xcschemes/ChartageBuild.xcscheme rename to Example/AztecExample.xcodeproj/xcshareddata/xcschemes/CarthageBuild.xcscheme