Skip to content
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

Upgrade to Xcode 16.2 #1404

Merged
merged 27 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
dccf8ef
DRY `env` and `agents` in Buildkite pipeline
mokagio Apr 16, 2024
afc4064
Address an access control warning
mokagio Apr 16, 2024
168f40e
Centralize deployment target definition at projects level
mokagio Apr 16, 2024
2f50d83
Bump deployment target to iOS 12.0, minimum for Xcode 15.3
mokagio Apr 16, 2024
380e6ac
Use Xcode 15.3 in CI
mokagio Apr 16, 2024
0b59180
Use Ruby 3.2.2 and update RuboCop to compatible version
mokagio Apr 16, 2024
34808d7
Bump iOS and Simulator versions for CI
mokagio Apr 16, 2024
5baf0b9
Allow warnings when validating podspec
mokagio Apr 16, 2024
78bd117
Update Fastlane in the hope it helps with stuck tests in CI
mokagio Apr 16, 2024
e41da8f
Don't waste time cleaning up Simulators in CI
mokagio Apr 16, 2024
04e4fc8
Merge remote-tracking branch 'origin/develop' into mokagio/xcode-15.3
mokagio Apr 16, 2024
210f02c
Merge remote-tracking branch 'origin/tooling/fix-sync-pod-publication…
mokagio Apr 17, 2024
665b15b
Fix NSSecureCoding implementations
AliSoftware Apr 18, 2024
90c0e4d
Use `UTType.utf8PlainText` (explicit encoding) instead of `kUTTypePla…
AliSoftware Apr 18, 2024
5c3004b
Fix overriding non-open class outside module
AliSoftware Apr 18, 2024
e21dbff
Revert "Fix overriding non-open class outside module"
AliSoftware Apr 18, 2024
c67821c
Declare `class var supportsSecureCoding` as `open`
AliSoftware Apr 18, 2024
83e548f
Simpler code style on UIPasteboard+Helpers > UTType
AliSoftware Apr 19, 2024
ce0726e
Fix shorcode test by using an attribute with key-value
May 21, 2024
7531747
Merge pull request #1395 from wordpress-mobile/fix/shortcode-test
May 21, 2024
34f1ace
Add `shared-pipeline-vars` to Buildkite setup and use Xcode 16.2
mokagio Jan 17, 2025
57be3ca
Remove unnecessary `""` from Buildkite pipeline
mokagio Jan 17, 2025
f37477a
Use inlined one-liner commands consistently in Buildkite pipeline
mokagio Jan 17, 2025
0fd2aad
Use custom GitHub commit status labels for all steps
mokagio Jan 17, 2025
27cc13a
Run CI tests on iPhone 16 Pro iOS 18.2 Simulator
mokagio Jan 17, 2025
834b097
Explicitly set `device` in CI runs to avoid attempting macOS tests
mokagio Jan 17, 2025
2496cac
Upgrade Fastlane to work with latest Apple toolchain
mokagio Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 44 additions & 45 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,72 @@
# Nodes with values to reuse in the pipeline.
common_params:
plugins: &common_plugins
- automattic/a8c-ci-toolkit#3.3.0
# Common environment values to use with the `env` key.
env: &common_env
IMAGE_ID: xcode-15.0.1
agents:
queue: mac
env:
IMAGE_ID: $IMAGE_ID

# This is the default pipeline – it will build and test the app
steps:
#################
# Build and Test
#################
- label: "🧪 Build and Test"
key: "test"
command: |
build_and_test_pod
env: *common_env
plugins: *common_plugins
- label: 🧪 Build and Test
key: test
command: build_and_test_pod
plugins: [$CI_TOOLKIT_PLUGIN]
notify:
- github_commit_status:
context: Unit Tests

#################
# Validate Podspecs
#################
- label: "🔬 Validate Podspecs"
key: "validate"
command: |
validate_podspec --patch-cocoapods
env: *common_env
plugins: *common_plugins
agents:
queue: mac
- label: 🔬 Validate Podspecs
key: validate
# Ideally, --allow-warnings should be removed once the warnings have been addressed
command: validate_podspec --patch-cocoapods --allow-warnings
plugins: [$CI_TOOLKIT_PLUGIN]
notify:
- github_commit_status:
context: Validate Podspecs

#################
# Lint
#################
- label: "🧹 Lint"
key: "lint"
command: |
lint_pod
env: *common_env
plugins: *common_plugins
- label: 🧹 Lint
key: lint
command: lint_pod
plugins: [$CI_TOOLKIT_PLUGIN]
notify:
- github_commit_status:
context: Lint Pod

#################
# Publish the Podspec (if we're building a tag)
#################
- label: "⬆️ Publish Aztec Podspec"
key: "publish-aztec"
- label: ⬆️ Publish Aztec Podspec
key: publish-aztec
command: .buildkite/publish-aztec-pod.sh
env: *common_env
plugins: *common_plugins
plugins: [$CI_TOOLKIT_PLUGIN]
depends_on:
- "test"
- "validate"
- "lint"
- test
- validate
- lint
if: build.tag != null
agents:
queue: "mac"
notify:
- github_commit_status:
context: Publish Aztec Podspec

#################
# Publish the Podspec (if we're building a tag)
#################
- label: "⬆️ Publish Editor Podspec"
key: "publish-editor"
- label: ⬆️ Publish Editor Podspec
key: publish-editor
command: .buildkite/publish-editor-pod.sh
env: *common_env
plugins: *common_plugins
plugins: [$CI_TOOLKIT_PLUGIN]
depends_on:
- "test"
- "validate"
- "lint"
- test
- validate
- lint
if: build.tag != null
agents:
queue: "mac"
notify:
- github_commit_status:
context: Publish WordPress-Editor Podspec
11 changes: 11 additions & 0 deletions .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used
# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it.

# The ~> modifier is not currently used, but we check for it just in case
XCODE_VERSION=$(sed -E 's/^~> ?//' .xcode-version)
CI_TOOLKIT_PLUGIN_VERSION="3.8.0"

export IMAGE_ID="xcode-$XCODE_VERSION-macos-14.7.1-v1"
export CI_TOOLKIT_PLUGIN="automattic/a8c-ci-toolkit#$CI_TOOLKIT_PLUGIN_VERSION"
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.4
3.2.2
1 change: 1 addition & 0 deletions .xcode-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.2
4 changes: 0 additions & 4 deletions Aztec.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,6 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Aztec/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.15.0;
PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.Aztec;
Expand All @@ -1947,7 +1946,6 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Aztec/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.15.0;
PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.Aztec;
Expand Down Expand Up @@ -2064,7 +2062,6 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Aztec/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.15.0;
PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.Aztec;
Expand Down Expand Up @@ -2172,7 +2169,6 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Aztec/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.15.0;
PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.Aztec;
Expand Down
4 changes: 2 additions & 2 deletions Aztec/Classes/EditorView/EditorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public class EditorView: UIView {
// MARK: - Initializers

public required init?(coder aDecoder: NSCoder) {
guard let htmlTextView = aDecoder.decodeObject(forKey: EditorView.htmlTextViewKey) as? UITextView,
let richTextView = aDecoder.decodeObject(forKey: EditorView.richTextViewKey) as? TextView else {
guard let htmlTextView = aDecoder.decodeObject(of: UITextView.self, forKey: EditorView.htmlTextViewKey),
let richTextView = aDecoder.decodeObject(of: TextView.self, forKey: EditorView.richTextViewKey) else {
return nil
}

Expand Down
5 changes: 3 additions & 2 deletions Aztec/Classes/Extensions/NSAttributedString+Archive.swift
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import Foundation
import UIKit

// MARK: - NSAttributedString Archive methods
//
extension NSAttributedString
{
static let pastesboardUTI = "com.wordpress.aztec.attributedString"
static let pasteboardUTI = UIPasteboard.UTType(identifier: "com.wordpress.aztec.attributedString")

func archivedData() throws -> Data {
return try NSKeyedArchiver.archivedData(withRootObject: self, requiringSecureCoding: false)
}

static func unarchive(with data: Data) throws -> NSAttributedString? {
return try NSKeyedUnarchiver.unarchivedObject(ofClass: NSAttributedString.self, from: data)
return try NSKeyedUnarchiver.unarchivedObject(ofClasses: [NSAttributedString.self, HTMLRepresentation.self], from: data) as? NSAttributedString
}

}
30 changes: 15 additions & 15 deletions Aztec/Classes/Extensions/NSAttributedString+Attachments.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extension NSAttributedString
static let lengthOfTextAttachment = NSAttributedString(attachment: NSTextAttachment()).length

// MARK: - Initializers

/// Helper Initializer: returns an Attributed String, with the specified attachment, styled with a given
/// collection of attributes.
///
Expand All @@ -21,24 +21,24 @@ extension NSAttributedString

self.init(.textAttachment, attributes: attributesWithAttachment)
}

public convenience init(attachment: NSTextAttachment, caption: NSAttributedString, attributes: [NSAttributedString.Key: Any]) {
let figure = Figure()
let figcaption = Figcaption(defaultFont: UIFont.systemFont(ofSize: 14), storing: nil)

let figureAttributes = attributes.appending(figure)
let finalString = NSMutableAttributedString(attachment: attachment, attributes: figureAttributes)

let mutableCaption = NSMutableAttributedString(attributedString: caption)
mutableCaption.append(paragraphProperty: figure)
mutableCaption.append(paragraphProperty: figcaption)

let paragraphSeparator = NSAttributedString(.paragraphSeparator, attributes: [:])

finalString.append(paragraphSeparator)
finalString.append(mutableCaption)
finalString.append(paragraphSeparator)

self.init(attributedString: finalString)
}

Expand Down Expand Up @@ -103,47 +103,47 @@ extension NSAttributedString
guard let captionRange = self.captionRange(for: attachment) else {
return nil
}

let string = attributedSubstring(from: captionRange).mutableCopy() as! NSMutableAttributedString

for character in Character.paragraphBreakingCharacters {
string.replaceOcurrences(of: String(character), with: "")
}

return NSAttributedString(attributedString: string)
}

public func captionRange(for attachment: NSTextAttachment) -> NSRange? {
guard let figureRange = self.figureRange(for: attachment) else {
return nil
}

return figcaptionRanges(within: figureRange).first
}

// MARK: - Captions: Figure and Figcaption property ranges

private func figcaptionRanges(within range: NSRange) -> [NSRange] {
var ranges = [NSRange]()

enumerateParagraphRanges(spanning: range) { (_, enclosingRange) in
guard let paragraphStyle = attribute(.paragraphStyle, at: enclosingRange.lowerBound, effectiveRange: nil) as? ParagraphStyle else {
return
}

if paragraphStyle.hasProperty(where: { $0 is Figcaption }) {
ranges.append(enclosingRange)
}
}

return ranges
}

private func figureRange(for attachment: NSTextAttachment) -> NSRange? {
guard let attachmentRange = ranges(forAttachment: attachment).first else {
return nil
}

let paragraphRange = self.paragraphRange(for: attachmentRange)

guard let paragraphStyle = self.attribute(.paragraphStyle, at: paragraphRange.lowerBound, effectiveRange: nil) as? ParagraphStyle,
Expand Down
Loading