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

Fix xcode 15 warnings #433

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6a49953
Fix Xcode 15 warnings by using Int instead of NSString for KVO context.
ZevEisenberg Aug 15, 2023
35de049
Stop using conditional compilation where the true and false branches …
ZevEisenberg Aug 15, 2023
7b990e2
Bump to Xcode 14 and 15. Drop Carthage build.
ZevEisenberg Dec 25, 2023
1c7030e
Update ruby version and gems.
ZevEisenberg Dec 25, 2023
84d0b94
Build on Apple Silicon.
ZevEisenberg Dec 25, 2023
4857ad3
Use updated method of configuring bundler path.
ZevEisenberg Dec 25, 2023
d0a7abc
Stop gathering coverage and running danger because I did not set it u…
ZevEisenberg Dec 25, 2023
f84ac60
Simplify ruby setup per latest CircleCI docs at https://circleci.com/…
ZevEisenberg Dec 25, 2023
34db0e0
Bump supported Swift versions.
ZevEisenberg Dec 25, 2023
fe1c7f2
Stop requiring circleci_artifact in Fastfile.
ZevEisenberg Dec 25, 2023
40c2f08
Update Ruby.
ZevEisenberg Dec 25, 2023
e0831a9
Update Bundler.
ZevEisenberg Dec 25, 2023
47dc8a3
Update fastlane readme.
ZevEisenberg Dec 25, 2023
0123bdc
Update simulators to match ones installed on CircleCI by default.
ZevEisenberg Dec 25, 2023
de3acfe
Add nkf to Gemfile.
ZevEisenberg Dec 25, 2023
4970a4d
Add abbrev to Gemfile.
ZevEisenberg Dec 25, 2023
0478b4d
Update destination devices. Stop generating asset catalog images.
ZevEisenberg Dec 25, 2023
31e75ee
Update things. Bump versions.
ZevEisenberg Dec 25, 2023
2183589
Refine platform-specific stuff and enable testing on watchOS.
ZevEisenberg Dec 26, 2023
19ee372
Eschew fastlane in favor of a Makefile. Restructure project to emphas…
ZevEisenberg Dec 26, 2023
64c8ded
Naming things.
ZevEisenberg Dec 26, 2023
53ce849
Make test_all work.
ZevEisenberg Dec 26, 2023
1a9bcc4
Install xcbeautify.
ZevEisenberg Dec 26, 2023
82696a2
Separate make steps so we can see which pass and which fail more easily.
ZevEisenberg Dec 26, 2023
f521904
Update badges.
ZevEisenberg Dec 26, 2023
7d35f5c
Change how we return XML parser errors to better indicate where failu…
ZevEisenberg Mar 30, 2024
31dfcf6
Modernize and improve snapshot testing.
ZevEisenberg Mar 31, 2024
f3f564a
Fail on CI if tests fail.
ZevEisenberg Mar 31, 2024
c58ee66
Store test results.
ZevEisenberg Mar 31, 2024
db1648c
Make directory to store test results.
ZevEisenberg Mar 31, 2024
92b6d59
Add supported Swift version to Podspec.
ZevEisenberg Mar 30, 2024
a95da15
Update gems.
ZevEisenberg Apr 1, 2024
6a897b3
Display-resolution-independent snapshot tests for images.
ZevEisenberg Apr 1, 2024
e336982
Fix snapshot scale.
ZevEisenberg Apr 1, 2024
4bd62f1
Use xcpretty instead of xcbeautify to output junit test format for us…
ZevEisenberg Apr 6, 2024
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
172 changes: 65 additions & 107 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,115 +1,90 @@
version: 2.1

jobs:
danger:
executor: xcode-12
steps:
- setup
- run:
name: Install xchtmlreport
command: |
curl -O https://raw.githubusercontent.com/TitouanVanBelle/XCTestHTMLReport/develop/xchtmlreport.rb
brew install --HEAD --build-from-source xchtmlreport.rb
- run:
name: Install xcparse
when: always
command: |
brew install chargepoint/xcparse/xcparse
- run:
name: Tests & Code Coverage
when: always
command: |
bundle exec fastlane coverage_all
# Store xcov Code Coverage HTML report artifact
- store_artifacts:
path: build/BonMot-iOS/xcov
destination: xcov
- store_artifacts:
path: build/BonMot-iOS/slather
destination: slather
- store_artifacts:
path: build/BonMot-iOS/scan
destination: scan
- run:
name: Rename CircleCI JUnit XML
when: always
command: |
mkdir -p build/test-results/danger
cp build/BonMot-iOS/scan/BonMot-iOS.xcresult/report.junit build/test-results/danger/results.xml
- store_test_results:
path: build/test-results
# Install SwiftLint only before Danger because otherwise it fails the build
- run:
name: Install SwiftLint
when: always
command: |
brew install swiftlint
- run:
name: Danger
when: always
command: |
if [ -n "$DANGER_GITHUB_API_TOKEN" ]; then bundle exec danger; else echo "Skipping Danger for forked pull request."; fi
- run:
name: Upload to Codecov
when: always
command: bash <(curl -s https://codecov.io/bash) -f build/BonMot-iOS/slather/cobertura.xml -X coveragepy -X gcov -X xcode
orbs:
macos: circleci/macos@2

jobs:
swift-package:
executor: xcode-12
executor: xcode-14
steps:
- setup
- run: mkdir test-results-swift
- run: swift build
- run: swift test
- store_test_results:
path: test-results-swift

lint-pod:
executor: xcode-12
executor: xcode-14
steps:
- setup
- lint-pod

fastlane-tests:
executor: xcode-12
steps:
- setup
- run: bundle exec fastlane test_all
# Docs for store_test_results: https://circleci.com/docs/configuration-reference/#storetestresults

fastlane-tests-xcode-13:
executor: xcode-13
tests-xcode-14:
executor: xcode-14
steps:
- setup
- run: bundle exec fastlane test_all
- run: mkdir test-results-macos
- run: make test_macos
- store_test_results:
path: test-results-macos
- run: mkdir test-results-ios
- run: make test_ios
- store_test_results:
path: test-results-ios
- run: mkdir test-results-tvos
- run: make test_tvos
- store_test_results:
path: test-results-tvos
- run: mkdir test-results-watchos
- run: make test_watchos
- store_test_results:
path: test-results-watchos

carthage-build:
executor: xcode-12
tests-xcode-15:
executor: xcode-15
steps:
- checkout
- run:
name: Update homebrew dependencies
command: brew update 1> /dev/null 2> /dev/null
- run:
name: Update Carthage
command: brew outdated carthage || (brew uninstall carthage --force; brew install carthage --force-bottle)
# Carthage does not work on Xcode 12 https://github.com/Carthage/Carthage/issues/3019
# - run: carthage build --no-skip-current && for platform in Mac iOS tvOS watchOS; do test -d Carthage/Build/${platform}/BonMot.framework || exit 1; done
- setup
- run: mkdir test-results-macos
- run: make test_macos
- run: mkdir test-results-macos
- store_test_results:
path: test-results-macos
- run: mkdir test-results-ios
- run: make test_ios
- store_test_results:
path: test-results-ios
- run: mkdir test-results-tvos
- run: make test_tvos
- store_test_results:
path: test-results-tvos
- run: mkdir test-results-watchos
- run: make test_watchos
- store_test_results:
path: test-results-watchos

deploy-to-cocoapods:
executor: xcode-12
executor: xcode-15
steps:
- setup
- run: bundle exec pod trunk push

executors:
xcode-12:
xcode-14:
macos:
xcode: "12.5.1"
xcode: "14.3.1"
resource_class: macos.m1.large.gen1
environment:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
HOMEBREW_NO_AUTO_UPDATE: 1
shell: /bin/bash --login -eo pipefail
xcode-13:
xcode-15:
macos:
xcode: "13.0.0"
xcode: "15.1.0"
resource_class: macos.m1.large.gen1
environment:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
Expand All @@ -121,68 +96,51 @@ commands:
description: "Shared setup"
steps:
- checkout
- restore-gems
- switch-ruby

restore-gems:
description: "Restore Ruby Gems"
switch-ruby:
description: "Switch Ruby"
steps:
- run:
name: Set Ruby Version
command: echo "ruby-2.5" > ~/.ruby-version
- restore_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
- run: bundle check || bundle install --path vendor/bundle
- save_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- macos/switch-ruby:
version: "3.1.4" # must match version in .ruby-version
- run: bundle install

lint-pod:
description: "Lints podspec with specified Swift version"
parameters:
swift-version:
type: string
default: "5.0"
default: "5.8"
steps:
- run: bundle exec pod lib lint --swift-version=<< parameters.swift-version >>

workflows:
version: 2
build-test-deploy:
jobs:
- danger:
filters:
tags:
only: /.*/
- swift-package:
filters:
tags:
only: /.*/
- fastlane-tests:
- tests-xcode-14:
filters:
tags:
only: /.*/
- fastlane-tests-xcode-13:
- tests-xcode-15:
filters:
tags:
only: /.*/
- lint-pod:
filters:
tags:
only: /.*/
- carthage-build:
filters:
tags:
only: /.*/
- deploy-to-cocoapods:
context: CocoaPods
requires:
- danger
- swift-package
- fastlane-tests
- fastlane-tests-xcode-13
- tests-xcode-14
- tests-xcode-15
- lint-pod
- carthage-build
filters:
tags:
only: /\d+(\.\d+)*(-.*)*/
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
test-results-*

# Created by https://www.gitignore.io/api/swift,macos,swiftpm,swiftpackagemanager
# Edit at https://www.gitignore.io/?templates=swift,macos,swiftpm,swiftpackagemanager

Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.4
2 changes: 0 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ disabled_rules: # rule identifiers to exclude from running
- file_length
- function_body_length
- identifier_name
- implicit_return # Re-enable when we drop support for Swift 4.2
- large_tuple
- line_length
- nesting
Expand All @@ -13,7 +12,6 @@ statement_position:
statement_mode: uncuddled_else

opt_in_rules:
- anyobject_protocol
- identical_operands
- implicit_return
- last_where
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
LastUpgradeVersion = "1510"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand All @@ -14,10 +14,24 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB8497DA1DA45B9C00FE3414"
BuildableName = "AllTheThings"
BlueprintName = "AllTheThings"
ReferencedContainer = "container:BonMot.xcodeproj">
BlueprintIdentifier = "BonMot"
BuildableName = "BonMot"
BlueprintName = "BonMot"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BonMotTests"
BuildableName = "BonMotTests"
BlueprintName = "BonMotTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -27,8 +41,18 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BonMotTests"
BuildableName = "BonMotTests"
BlueprintName = "BonMotTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand All @@ -41,15 +65,6 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB8497DA1DA45B9C00FE3414"
BuildableName = "AllTheThings"
BlueprintName = "AllTheThings"
ReferencedContainer = "container:BonMot.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -60,10 +75,10 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AB8497DA1DA45B9C00FE3414"
BuildableName = "AllTheThings"
BlueprintName = "AllTheThings"
ReferencedContainer = "container:BonMot.xcodeproj">
BlueprintIdentifier = "BonMot"
BuildableName = "BonMot"
BlueprintName = "BonMot"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
Expand Down
10 changes: 5 additions & 5 deletions BonMot.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |s|
s.name = "BonMot"
s.version = "6.1.3"
s.summary = "Beautiful, easy attributed strings in Swift"
s.swift_versions = ["5.0"]
s.swift_versions = ["5.8", "5.9", "5.10"]
s.description = <<-DESC
BonMot removes all the mystery from creating beautiful, powerful attributed strings in Swift.
DESC
Expand All @@ -14,16 +14,16 @@ Pod::Spec.new do |s|
# s.social_media_url = 'https://twitter.com/ZevEisenberg'
s.requires_arc = true

s.ios.deployment_target = '11.0'
s.ios.deployment_target = '12.0'
s.ios.source_files = 'Sources/**/*.swift'

s.tvos.deployment_target = '11.0'
s.tvos.deployment_target = '12.0'
s.tvos.source_files = 'Sources/**/*.swift'

s.osx.deployment_target = '10.11'
s.osx.deployment_target = '10.15'
s.osx.source_files = 'Sources/*.swift'

s.watchos.deployment_target = '2.2'
s.watchos.deployment_target = '4.0'
s.watchos.source_files = 'Sources/*.swift'

end
Loading