Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
80 changes: 80 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Nodes with values to reuse in the pipeline.
common_params:
plugins: &common_plugins
- &bash_cache automattic/bash-cache#2.0.0: ~
# Common environment values to use with the `env` key.
env: &common_env
IMAGE_ID: xcode-13

# This is the default pipeline – it will build and test the app
steps:
#################
# Build and Test
#################
- label: "🧪 Build and Test"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Muscle memory was going to make me suggest to use 🔬 but I don't know whether that's appropriate for a "Build and Test" step 🤔 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"🛠️ " ? 😇

key: "test"
command: |
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
gem install bundler:2.3.4

build_and_test_pod
env: *common_env
plugins: *common_plugins

#################
# Validate Podspecs
#################
- label: "🔬 Validate Podspecs"
key: "validate"
command: |
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
gem install bundler:2.3.4

validate_podspec
env: *common_env
plugins: *common_plugins

#################
# Lint
#################
- label: "🧹 Lint"
key: "lint"
command: |
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
gem install bundler:2.3.4

lint_pod
env: *common_env
plugins: *common_plugins

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

#################
# Publish the Podspec (if we're building a tag)
#################
- label: "⬆️ Publish Editor Podspec"
key: "publish-editor"
command: .buildkite/publish-editor-pod.sh
env: *common_env
plugins: *common_plugins
depends_on:
- "test"
- "validate"
- "lint"
if: build.tag != null
agents:
queue: "mac"
20 changes: 20 additions & 0 deletions .buildkite/publish-aztec-pod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -eu

PODSPEC_PATH="WordPress-Aztec-iOS.podspec"
SPECS_REPO="git@github.com:wordpress-mobile/cocoapods-specs.git"
SLACK_WEBHOOK=$PODS_SLACK_WEBHOOK

echo "--- :rubygems: Setting up Gems"
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
gem install bundler:2.3.4

install_gems

echo "--- :cocoapods: Publishing Pod to CocoaPods CDN"
publish_pod $PODSPEC_PATH

echo "--- :cocoapods: Publishing Pod to WP Specs Repo"
publish_private_pod $PODSPEC_PATH $SPECS_REPO "$SPEC_REPO_PUBLIC_DEPLOY_KEY"

echo "--- :slack: Notifying Slack"
slack_notify_pod_published $PODSPEC_PATH $SLACK_WEBHOOK
20 changes: 20 additions & 0 deletions .buildkite/publish-editor.pod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -eu

PODSPEC_PATH="WordPress-Editor-iOS.podspec"
SPECS_REPO="git@github.com:wordpress-mobile/cocoapods-specs.git"
SLACK_WEBHOOK=$PODS_SLACK_WEBHOOK

echo "--- :rubygems: Setting up Gems"
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
gem install bundler:2.3.4

install_gems

echo "--- :cocoapods: Publishing Pod to CocoaPods CDN"
publish_pod $PODSPEC_PATH

echo "--- :cocoapods: Publishing Pod to WP Specs Repo"
publish_private_pod $PODSPEC_PATH $SPECS_REPO "$SPEC_REPO_PUBLIC_DEPLOY_KEY"

echo "--- :slack: Notifying Slack"
slack_notify_pod_published $PODSPEC_PATH $SLACK_WEBHOOK
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Pods/
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/README.md
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
Expand Down
10 changes: 10 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Opt in to new cops by default
AllCops:
NewCops: enable

# Allow the Podspec filename to match the project
Naming/FileName:
Exclude:
- 'WordPress-Aztec-iOS.podspec'
- 'WordPress-Editor-iOS.podspec'
- 'Example/Carthage/Checkouts/Gridicons-iOS/Gridicons.podspec'
2 changes: 1 addition & 1 deletion Aztec.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 1230;
LastUpgradeCheck = 1310;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time to upgrade to Xcode 13.2 @jkmassel 😝

ORGANIZATIONNAME = "Automattic Inc.";
TargetAttributes = {
5951CB8D1D8BC93600E1866F = {
Expand Down
13 changes: 12 additions & 1 deletion Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -56,6 +56,17 @@
BlueprintName = "AztecTests"
ReferencedContainer = "container:Aztec.xcodeproj">
</BuildableReference>
<SkippedTests>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests don't work under iOS 15, so they're disabled for now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to open a PR similar to wordpress-mobile/MediaEditor-iOS#29 here, but I'll wait for input on my question regarding the future of this library.

<Test
Identifier = "BlockquoteFormatterTests/testToggleBlockquoteTwiceLeavesReturnsIdenticalString()">
</Test>
<Test
Identifier = "UIImageResizeTests/testResizingImageWorks()">
</Test>
<Test
Identifier = "UIImageResizeTests/testResizingImageWorks2()">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
</TestAction>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -51,8 +49,6 @@
ReferencedContainer = "container:Aztec.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
2 changes: 1 addition & 1 deletion Aztec/Classes/TextKit/MediaAttachment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import UIKit

// MARK: - MediaAttachmentDelegate
//
protocol MediaAttachmentDelegate: class {
protocol MediaAttachmentDelegate: AnyObject {
func mediaAttachment(
_ mediaAttachment: MediaAttachment,
imageFor url: URL,
Expand Down
4 changes: 2 additions & 2 deletions Aztec/Classes/TextKit/RenderableAttachment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import UIKit

/// NSTextAttachment Renderable Delegate Helpers
///
public protocol RenderableAttachmentDelegate: class {
public protocol RenderableAttachmentDelegate: AnyObject {

/// Returns the Bounds that should be used to render a given attachment
///
Expand All @@ -29,7 +29,7 @@ public protocol RenderableAttachmentDelegate: class {

/// Protocol to mark attachments object that are renderable through the delegate interface.
///
public protocol RenderableAttachment: class {
public protocol RenderableAttachment: AnyObject {

var delegate: RenderableAttachmentDelegate? {get set}
}
2 changes: 1 addition & 1 deletion Aztec/Classes/TextKit/TextStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import UIKit

/// Implemented by a class taking care of handling attachments for the storage.
///
protocol TextStorageAttachmentsDelegate: class {
protocol TextStorageAttachmentsDelegate: AnyObject {

/// Provides images for attachments that are part of the storage
///
Expand Down
8 changes: 4 additions & 4 deletions Aztec/Classes/TextKit/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import CoreServices

// MARK: - TextViewAttachmentDelegate
//
public protocol TextViewAttachmentDelegate: class {
public protocol TextViewAttachmentDelegate: AnyObject {

/// This method requests from the delegate the image at the specified URL.
///
Expand Down Expand Up @@ -72,7 +72,7 @@ public protocol TextViewAttachmentDelegate: class {

// MARK: - TextViewAttachmentImageProvider
//
public protocol TextViewAttachmentImageProvider: class {
public protocol TextViewAttachmentImageProvider: AnyObject {

/// Indicates whether the current Attachment Renderer supports a given NSTextAttachment instance, or not.
///
Expand Down Expand Up @@ -110,7 +110,7 @@ public protocol TextViewAttachmentImageProvider: class {

// MARK: - TextViewFormattingDelegate
//
public protocol TextViewFormattingDelegate: class {
public protocol TextViewFormattingDelegate: AnyObject {

/// Called a text view command toggled a style.
///
Expand All @@ -121,7 +121,7 @@ public protocol TextViewFormattingDelegate: class {

// MARK: - TextViewPasteboardDelegate
//
public protocol TextViewPasteboardDelegate: class {
public protocol TextViewPasteboardDelegate: AnyObject {

/// Called by the TextView when it's attempting to paste the contents of the pasteboard.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
10 changes: 7 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
source 'https://rubygems.org' do
gem 'cocoapods', '1.7.5'
end
# frozen_string_literal: true

source 'https://rubygems.org'

gem 'cocoapods', '~> 1.8.0'
gem 'fastlane', '~> 2.189'
gem 'rubocop', '~> 1.18'
Loading