From fcef9a75b5618cf2b9cfc451b2aebdfb201933df Mon Sep 17 00:00:00 2001 From: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Thu, 3 Feb 2022 21:59:45 -0700 Subject: [PATCH 1/9] Add Buildkite --- .buildkite/pipeline.yml | 80 ++++++++++++++++++++++++++++++++ .buildkite/publish-aztec-pod.sh | 20 ++++++++ .buildkite/publish-editor.pod.sh | 20 ++++++++ Gemfile.lock | 5 +- 4 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 .buildkite/pipeline.yml create mode 100644 .buildkite/publish-aztec-pod.sh create mode 100644 .buildkite/publish-editor.pod.sh diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 000000000..bc33a6bc9 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -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" + 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" diff --git a/.buildkite/publish-aztec-pod.sh b/.buildkite/publish-aztec-pod.sh new file mode 100644 index 000000000..2343776da --- /dev/null +++ b/.buildkite/publish-aztec-pod.sh @@ -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 diff --git a/.buildkite/publish-editor.pod.sh b/.buildkite/publish-editor.pod.sh new file mode 100644 index 000000000..f6534c70f --- /dev/null +++ b/.buildkite/publish-editor.pod.sh @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 376b79767..ca01ef9b6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,6 @@ +GEM + specs: + GEM remote: https://rubygems.org/ specs: @@ -73,4 +76,4 @@ DEPENDENCIES cocoapods (= 1.7.5)! BUNDLED WITH - 2.0.2 + 2.2.33 From 44761b5a6a67d34c6943a7a144b165f0dfd9b3d6 Mon Sep 17 00:00:00 2001 From: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Thu, 3 Feb 2022 22:02:55 -0700 Subject: [PATCH 2/9] Fix Gems --- Gemfile | 9 ++++--- Gemfile.lock | 73 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 56 insertions(+), 26 deletions(-) diff --git a/Gemfile b/Gemfile index 652ca282c..db7494eb5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,6 @@ -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 'rubocop', '~> 1.18' diff --git a/Gemfile.lock b/Gemfile.lock index ca01ef9b6..782ae0dee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,27 +1,29 @@ -GEM - specs: - GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.1) - activesupport (4.2.11.1) + CFPropertyList (3.0.5) + rexml + activesupport (4.2.11.3) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + ast (2.4.2) atomos (0.1.3) - claide (1.0.3) - cocoapods (1.7.5) + claide (1.1.0) + cocoapods (1.8.4) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.7.5) + cocoapods-core (= 1.8.4) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.3.1, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -30,50 +32,75 @@ GEM molinillo (~> 0.6.6) nap (~> 1.0) ruby-macho (~> 1.4) - xcodeproj (>= 1.10.0, < 2.0) - cocoapods-core (1.7.5) + xcodeproj (>= 1.11.1, < 2.0) + cocoapods-core (1.8.4) activesupport (>= 4.0.2, < 6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) - cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.2.2) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (1.5.1) cocoapods-plugins (1.0.0) nap - cocoapods-search (1.0.0) + cocoapods-search (1.0.1) cocoapods-stats (1.1.0) - cocoapods-trunk (1.4.0) + cocoapods-trunk (1.6.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) - cocoapods-try (1.1.0) + cocoapods-try (1.2.0) colored2 (3.1.2) - concurrent-ruby (1.1.5) + concurrent-ruby (1.1.9) escape (0.0.4) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) + httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - minitest (5.12.0) + json (2.6.1) + minitest (5.15.0) molinillo (0.6.6) - nanaimo (0.2.6) + nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) + parallel (1.21.0) + parser (3.1.0.0) + ast (~> 2.4.1) + rainbow (3.1.1) + regexp_parser (2.2.0) + rexml (3.2.5) + rubocop (1.25.1) + parallel (~> 1.10) + parser (>= 3.1.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.15.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.15.1) + parser (>= 3.0.1.1) ruby-macho (1.4.0) + ruby-progressbar (1.11.0) thread_safe (0.3.6) - tzinfo (1.2.5) + tzinfo (1.2.9) thread_safe (~> 0.1) - xcodeproj (1.12.0) + unicode-display_width (2.1.0) + xcodeproj (1.21.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.6) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.7.5)! + cocoapods (~> 1.8.0) + rubocop (~> 1.18) BUNDLED WITH 2.2.33 From b219483d353af6e3427e6ec239b4d3e6245d586a Mon Sep 17 00:00:00 2001 From: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Thu, 3 Feb 2022 22:08:34 -0700 Subject: [PATCH 3/9] Address Rubocop Concerns --- .rubocop.yml | 10 ++++++++++ WordPress-Aztec-iOS.podspec | 12 +++++++----- WordPress-Editor-iOS.podspec | 14 ++++++++------ 3 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 000000000..a38e86800 --- /dev/null +++ b/.rubocop.yml @@ -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' diff --git a/WordPress-Aztec-iOS.podspec b/WordPress-Aztec-iOS.podspec index 8eacfefaa..28aa8fa57 100644 --- a/WordPress-Aztec-iOS.podspec +++ b/WordPress-Aztec-iOS.podspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Pod::Spec.new do |s| s.name = 'WordPress-Aztec-iOS' s.version = '1.19.7' @@ -7,21 +9,21 @@ Pod::Spec.new do |s| The native HTML Editor by Automattic Inc. This library provides a UITextView subclass with HTML visual editing capabilities. - DESC + DESC s.homepage = 'https://github.com/wordpress-mobile/AztecEditor-iOS' - s.license = { :type => 'MPLv2', :file => 'LICENSE.md' } + s.license = { type: 'MPLv2', file: 'LICENSE.md' } s.author = { 'The WordPress Mobile Team' => 'mobile@wordpress.org' } s.ios.deployment_target = '11.0' s.swift_version = '5.0' - s.source = { :git => 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', :tag => s.version.to_s } - s.module_name = "Aztec" + s.source = { git: 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', tag: s.version.to_s } + s.module_name = 'Aztec' s.source_files = 'Aztec/Classes/**/*' s.resource_bundles = { 'WordPress-Aztec-iOS': [ - "Aztec/Assets/**/*" + 'Aztec/Assets/**/*' ] } s.xcconfig = { diff --git a/WordPress-Editor-iOS.podspec b/WordPress-Editor-iOS.podspec index 729a5c3b1..a4fa51852 100644 --- a/WordPress-Editor-iOS.podspec +++ b/WordPress-Editor-iOS.podspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Pod::Spec.new do |s| s.name = 'WordPress-Editor-iOS' s.version = '1.19.7' @@ -8,17 +10,17 @@ Pod::Spec.new do |s| This library provides a UITextView subclass with HTML visual editing capabilities. Use this library if you want to create an App that interacts with WordPress HTML content. - DESC + DESC s.homepage = 'https://github.com/wordpress-mobile/AztecEditor-iOS' - s.license = { :type => 'MPLv2', :file => 'LICENSE.md' } + s.license = { type: 'MPLv2', file: 'LICENSE.md' } s.author = { 'The WordPress Mobile Team' => 'mobile@wordpress.org' } s.ios.deployment_target = '11.0' s.swift_version = '5.0' - - s.source = { :git => 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', :tag => s.version.to_s } - s.module_name = "WordPressEditor" + + s.source = { git: 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', tag: s.version.to_s } + s.module_name = 'WordPressEditor' s.source_files = 'WordPressEditor/WordPressEditor/Classes/**/*' s.resources = 'WordPressEditor/WordPressEditor/Assets/**/*' s.xcconfig = { @@ -26,5 +28,5 @@ Pod::Spec.new do |s| 'HEADER_SEARCH_PATHS' => '/usr/include/libxml2' } - s.dependency "WordPress-Aztec-iOS", s.version.to_s + s.dependency 'WordPress-Aztec-iOS', s.version.to_s end From 6bde7545b3af7544fbe34a897006ac98b8203c97 Mon Sep 17 00:00:00 2001 From: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Thu, 3 Feb 2022 23:17:42 -0700 Subject: [PATCH 4/9] Add Fastlane Fix Rubocop Issue --- .gitignore | 1 + Gemfile | 1 + Gemfile.lock | 188 ++++++++++++++++++++++++++++++++++++++++++++++ fastlane/Fastfile | 21 ++++++ 4 files changed, 211 insertions(+) create mode 100644 fastlane/Fastfile diff --git a/.gitignore b/.gitignore index 4b226e631..15268ca39 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Gemfile b/Gemfile index db7494eb5..298568a74 100644 --- a/Gemfile +++ b/Gemfile @@ -3,4 +3,5 @@ source 'https://rubygems.org' gem 'cocoapods', '~> 1.8.0' +gem 'fastlane', '~> 2.189' gem 'rubocop', '~> 1.18' diff --git a/Gemfile.lock b/Gemfile.lock index 782ae0dee..bd7465897 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,11 +8,31 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) + artifactory (3.0.15) ast (2.4.2) atomos (0.1.3) + aws-eventstream (1.2.0) + aws-partitions (1.552.0) + aws-sdk-core (3.126.0) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.525.0) + aws-sigv4 (~> 1.1) + jmespath (~> 1.0) + aws-sdk-kms (1.54.0) + aws-sdk-core (~> 3, >= 3.126.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.112.0) + aws-sdk-core (~> 3, >= 3.126.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.4) + aws-sigv4 (1.4.0) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) claide (1.1.0) cocoapods (1.8.4) activesupport (>= 4.0.2, < 5) @@ -49,27 +69,166 @@ GEM nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.2.0) + colored (1.2) colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) concurrent-ruby (1.1.9) + declarative (0.0.20) + digest-crc (0.6.4) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + dotenv (2.7.6) + emoji_regex (3.2.3) escape (0.0.4) + excon (0.91.0) + faraday (1.9.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.3) + multipart-post (>= 1.2, < 3) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fastimage (2.2.6) + fastlane (2.204.2) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.3, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored + commander (~> 4.6) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 1.0) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 1.0) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + json (< 3.0.0) + jwt (>= 2.1.0, < 3) + mini_magick (>= 4.9.4, < 5.0.0) + multipart-post (~> 2.0.0) + naturally (~> 2.2) + optparse (~> 0.1.1) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 2.0.0, < 3.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (>= 1.4.5, < 2.0.0) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) + google-apis-androidpublisher_v3 (0.16.0) + google-apis-core (>= 0.4, < 2.a) + google-apis-core (0.4.2) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-apis-iamcredentials_v1 (0.10.0) + google-apis-core (>= 0.4, < 2.a) + google-apis-playcustomapp_v1 (0.7.0) + google-apis-core (>= 0.4, < 2.a) + google-apis-storage_v1 (0.11.0) + google-apis-core (>= 0.4, < 2.a) + google-cloud-core (1.6.0) + google-cloud-env (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-env (1.5.0) + faraday (>= 0.17.3, < 2.0) + google-cloud-errors (1.2.0) + google-cloud-storage (1.36.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.1) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + googleauth (1.1.0) + faraday (>= 0.17.3, < 2.0) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.4) + domain_name (~> 0.5) httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) + jmespath (1.5.0) json (2.6.1) + jwt (2.3.0) + memoist (0.16.2) + mini_magick (4.11.0) + mini_mime (1.1.2) minitest (5.15.0) molinillo (0.6.6) + multi_json (1.15.0) + multipart-post (2.0.0) nanaimo (0.3.0) nap (1.1.0) + naturally (2.2.1) netrc (0.11.0) + optparse (0.1.1) + os (1.1.4) parallel (1.21.0) parser (3.1.0.0) ast (~> 2.4.1) + plist (3.6.0) + public_suffix (4.0.6) rainbow (3.1.1) + rake (13.0.6) regexp_parser (2.2.0) + representable (3.1.1) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) rexml (3.2.5) + rouge (2.0.7) rubocop (1.25.1) parallel (~> 1.10) parser (>= 3.1.0.0) @@ -83,10 +242,34 @@ GEM parser (>= 3.0.1.1) ruby-macho (1.4.0) ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + security (0.1.3) + signet (0.16.0) + addressable (~> 2.8) + faraday (>= 0.17.3, < 2.0) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.8) + CFPropertyList + naturally + terminal-notifier (2.0.0) + terminal-table (1.6.0) thread_safe (0.3.6) + trailblazer-option (0.1.2) + tty-cursor (0.7.1) + tty-screen (0.8.1) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) tzinfo (1.2.9) thread_safe (~> 0.1) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.8) unicode-display_width (2.1.0) + webrick (1.7.0) + word_wrap (1.0.0) xcodeproj (1.21.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) @@ -94,12 +277,17 @@ GEM colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) PLATFORMS ruby DEPENDENCIES cocoapods (~> 1.8.0) + fastlane (~> 2.189) rubocop (~> 1.18) BUNDLED WITH diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 000000000..325162e90 --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +default_platform(:ios) + +IOS_VERSION = '15.0' +TEST_DEVICES = ['iPhone 11'].freeze + +platform :ios do + desc 'Builds the project and runs tests' + lane :test do + run_tests( + workspace: 'Aztec.xcworkspace', + scheme: 'Aztec', + devices: TEST_DEVICES, + deployment_target_version: IOS_VERSION, + prelaunch_simulator: true, + buildlog_path: File.join(__dir__, '.build', 'logs'), + derived_data_path: File.join(__dir__, '.build', 'derived-data') + ) + end +end From a0b5b18f6b470d80cbc42e9cb5201fb47bcf9005 Mon Sep 17 00:00:00 2001 From: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Thu, 3 Feb 2022 23:18:45 -0700 Subject: [PATCH 5/9] Xcode Upgrade More Xcode stuff --- Aztec.xcodeproj/project.pbxproj | 18 +++++++++--------- .../xcshareddata/xcschemes/Aztec.xcscheme | 2 +- .../xcschemes/Carthage Update.xcscheme | 6 +----- Aztec/Classes/TextKit/MediaAttachment.swift | 2 +- .../Classes/TextKit/RenderableAttachment.swift | 4 ++-- Aztec/Classes/TextKit/TextStorage.swift | 2 +- Aztec/Classes/TextKit/TextView.swift | 8 ++++---- .../xcschemes/AztecExample.xcscheme | 2 +- .../WordPressEditor.xcodeproj/project.pbxproj | 14 +++++++------- 9 files changed, 27 insertions(+), 31 deletions(-) diff --git a/Aztec.xcodeproj/project.pbxproj b/Aztec.xcodeproj/project.pbxproj index fe4bc7aa0..7552693e4 100644 --- a/Aztec.xcodeproj/project.pbxproj +++ b/Aztec.xcodeproj/project.pbxproj @@ -1456,7 +1456,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 1230; + LastUpgradeCheck = 1310; ORGANIZATIONNAME = "Automattic Inc."; TargetAttributes = { 5951CB8D1D8BC93600E1866F = { @@ -1832,7 +1832,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-lxml2"; @@ -1894,7 +1894,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = "-lxml2"; SDKROOT = iphoneos; @@ -1922,7 +1922,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + 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; @@ -1949,7 +1949,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + 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; @@ -2038,7 +2038,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-lxml2"; @@ -2066,7 +2066,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + 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; @@ -2145,7 +2145,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-lxml2"; @@ -2174,7 +2174,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + 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; diff --git a/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme b/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme index 1cf5571d4..145e4df89 100644 --- a/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme +++ b/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme @@ -1,6 +1,6 @@ - - - - Date: Fri, 4 Feb 2022 20:28:00 -0700 Subject: [PATCH 6/9] Disable Tests that are broken on iOS 15 --- Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme b/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme index 145e4df89..6be491f86 100644 --- a/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme +++ b/Aztec.xcodeproj/xcshareddata/xcschemes/Aztec.xcscheme @@ -56,6 +56,17 @@ BlueprintName = "AztecTests" ReferencedContainer = "container:Aztec.xcodeproj"> + + + + + + + + From 53a91715b5520cb2c04865e2f039182c805c6601 Mon Sep 17 00:00:00 2001 From: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Fri, 4 Feb 2022 20:33:23 -0700 Subject: [PATCH 7/9] Move the iOS Deployment Target back to 11.0 --- Aztec.xcodeproj/project.pbxproj | 16 ++++++++-------- .../WordPressEditor.xcodeproj/project.pbxproj | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Aztec.xcodeproj/project.pbxproj b/Aztec.xcodeproj/project.pbxproj index 7552693e4..5042b71ff 100644 --- a/Aztec.xcodeproj/project.pbxproj +++ b/Aztec.xcodeproj/project.pbxproj @@ -1832,7 +1832,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-lxml2"; @@ -1894,7 +1894,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = "-lxml2"; SDKROOT = iphoneos; @@ -1922,7 +1922,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.15.0; PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.Aztec; @@ -1949,7 +1949,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.15.0; PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.Aztec; @@ -2038,7 +2038,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-lxml2"; @@ -2066,7 +2066,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.15.0; PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.Aztec; @@ -2145,7 +2145,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = /usr/include/libxml2; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-lxml2"; @@ -2174,7 +2174,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Aztec/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.15.0; PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.Aztec; diff --git a/WordPressEditor/WordPressEditor.xcodeproj/project.pbxproj b/WordPressEditor/WordPressEditor.xcodeproj/project.pbxproj index ddbd321d9..b13f3dcb5 100644 --- a/WordPressEditor/WordPressEditor.xcodeproj/project.pbxproj +++ b/WordPressEditor/WordPressEditor.xcodeproj/project.pbxproj @@ -763,7 +763,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -789,7 +789,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = WordPressEditor/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -876,7 +876,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -936,7 +936,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -962,7 +962,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = WordPressEditor/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -990,7 +990,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = WordPressEditor/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", From f6e73aedb345fa09d01c2989e9a11fba936be5d3 Mon Sep 17 00:00:00 2001 From: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Fri, 4 Feb 2022 21:29:18 -0700 Subject: [PATCH 8/9] Also test WordPressEditor Test Add runtime validation Make Rubocop Happy --- .../xcschemes/WordPressEditor.xcscheme | 77 +++++++++++++++++++ fastlane/Fastfile | 63 +++++++++++++-- 2 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 WordPressEditor/WordPressEditor.xcodeproj/xcshareddata/xcschemes/WordPressEditor.xcscheme diff --git a/WordPressEditor/WordPressEditor.xcodeproj/xcshareddata/xcschemes/WordPressEditor.xcscheme b/WordPressEditor/WordPressEditor.xcodeproj/xcshareddata/xcschemes/WordPressEditor.xcscheme new file mode 100644 index 000000000..63824d665 --- /dev/null +++ b/WordPressEditor/WordPressEditor.xcodeproj/xcshareddata/xcschemes/WordPressEditor.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 325162e90..cae5d8e68 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -2,20 +2,73 @@ default_platform(:ios) -IOS_VERSION = '15.0' -TEST_DEVICES = ['iPhone 11'].freeze +TEST_RUNTIME = 'iOS 14.0' +TEST_DEVICE = 'iPhone 11' platform :ios do desc 'Builds the project and runs tests' lane :test do + device = create_simulator(TEST_RUNTIME, TEST_DEVICE) + run_tests( workspace: 'Aztec.xcworkspace', scheme: 'Aztec', - devices: TEST_DEVICES, - deployment_target_version: IOS_VERSION, + device: device.name, prelaunch_simulator: true, buildlog_path: File.join(__dir__, '.build', 'logs'), - derived_data_path: File.join(__dir__, '.build', 'derived-data') + derived_data_path: File.join(__dir__, '.build', 'derived-data'), + ensure_devices_found: true ) + + run_tests( + workspace: 'Aztec.xcworkspace', + scheme: 'WordPressEditor', + device: device.name, + prelaunch_simulator: true, + buildlog_path: File.join(__dir__, '.build', 'logs'), + derived_data_path: File.join(__dir__, '.build', 'derived-data'), + ensure_devices_found: true + ) + + destroy_simulator(device) + end +end + +def create_simulator(runtime, device) + fastlane_require 'simctl' + fastlane_require 'securerandom' + + validate_runtime_exists(runtime) + + simulator = SimCtl.create_device( + SecureRandom.uuid, + SimCtl.devicetype(name: device), + SimCtl.runtime(name: runtime) + ) + + UI.success "Successfully created an #{runtime} #{device} labelled #{simulator.name}" + + simulator +end + +def validate_runtime_exists(runtime) + fastlane_require 'simctl' + + begin + SimCtl.runtime({ name: runtime }) + rescue StandardError + SimCtl.list_runtimes.each do |existing_runtime| + puts existing_runtime.name + end + + UI.user_error! "#{runtime} is not available. Available runtimes are listed above." end end + +def destroy_simulator(simulator) + runtime = simulator.runtime.name + device_type_name = simulator.devicetype.name + + simulator.delete + UI.success "Successfully deleted #{runtime} #{device_type_name}" +end From 9a6375423d25aa9a64f8703c830728e4baa8ff28 Mon Sep 17 00:00:00 2001 From: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Fri, 4 Feb 2022 22:00:24 -0700 Subject: [PATCH 9/9] Use 15.0 --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index cae5d8e68..252f581a6 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -2,7 +2,7 @@ default_platform(:ios) -TEST_RUNTIME = 'iOS 14.0' +TEST_RUNTIME = 'iOS 15.0' TEST_DEVICE = 'iPhone 11' platform :ios do