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
27 changes: 27 additions & 0 deletions .github/workflows/carthage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Carthage
on: [push, workflow_dispatch]

jobs:
build:
name: Build
runs-on: macOS-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Install Carthage
run: |
brew update
brew install carthage

- name: Create Cartfile
run: |
# Delete all of the old tags (if any) and create a new tag for building
git tag | xargs git tag -d
git tag 1.0

echo "git \"file://$(pwd)\"" > ./Cartfile

- name: Build
run: |
./scripts/carthage.sh update
23 changes: 23 additions & 0 deletions .github/workflows/cocoapods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Cocoapods
on: [push, workflow_dispatch]

jobs:
lint:
name: Lint
runs-on: macOS-11
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: latest

- name: Lint (Dynamic Library)
run: |
pod lib lint

- name: Lint (Static Library)
run: |
pod lib lint --use-libraries --skip-tests
42 changes: 42 additions & 0 deletions .github/workflows/swift-pacakge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Swift Package
on: [push, workflow_dispatch]

jobs:
build:
name: Build
runs-on: macOS-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Build
run: |
swift --version
swift build -v

test:
name: Test
runs-on: macOS-latest
needs: build

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Test
run: |
swift test -v --enable-code-coverage

- name: Generate Code Coverage File
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
xcrun llvm-cov export --instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata .build/x86_64-apple-macosx/debug/MethodNotificationCenterPackageTests.xctest/Contents/MacOS/MethodNotificationCenterPackageTests > ./info.lcov

- name: Upload Code Coverage
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./info.lcov
verbose: true
24 changes: 0 additions & 24 deletions .github/workflows/swift.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/upload-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Upload Assets
on:
release:
types: [published]

jobs:
build:
name: Upload Assets
runs-on: macOS-latest
env:
TMPDIR: /tmp/.methodnotificationcenter.xcframework.build

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Build
run: |
./scripts/xcframework.sh -output ${TMPDIR}/MethodNotificationCenter.xcframework

- name: Create Zip
run: |
cd ${TMPDIR}
zip -rX MethodNotificationCenter.xcframework.zip MethodNotificationCenter.xcframework

- name: Upload Zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.TMPDIR }}/MethodNotificationCenter.xcframework.zip
asset_name: MethodNotificationCenter.xcframework.zip
asset_content_type: application/zip

- name: Create Tar
run: |
cd ${TMPDIR}
tar -zcvf MethodNotificationCenter.xcframework.tar.gz MethodNotificationCenter.xcframework

- name: Upload Tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.TMPDIR }}/MethodNotificationCenter.xcframework.tar.gz
asset_name: MethodNotificationCenter.xcframework.tar.gz
asset_content_type: application/gzip
17 changes: 17 additions & 0 deletions .github/workflows/xcframework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: XCFramework
on: [push, workflow_dispatch]

jobs:
build:
name: Build
runs-on: macOS-latest
env:
TMPDIR: /tmp/.methodnotificationcenter.xcframework.build

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Build
run: |
./scripts/xcframework.sh -output ${TMPDIR}/MethodNotificationCenter.xcframework
110 changes: 110 additions & 0 deletions .github/workflows/xcodebuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Xcode Project
on: [push, workflow_dispatch]

jobs:
ios:
name: iOS
runs-on: macOS-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Build iOS
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter" -destination "generic/platform=iOS" -configuration Debug

- name: Build iOS Simulator
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter" -destination "generic/platform=iOS Simulator" -configuration Debug

- name: Test
run: |
IOS_SIM="$(xcrun simctl list devices available | grep "iPhone [0-9]" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#IOS_SIM}" == "0" ]; then
IOS_SIM = "iPhone 12 Pro" # Fallback Simulator
fi

xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter" -testPlan "MethodNotificationCenterTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test

maccatalyst:
name: Mac Catalyst
runs-on: macOS-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Build
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug

- name: Test
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter" -testPlan "MethodNotificationCenterTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug ONLY_ACTIVE_ARCH=YES test

macos:
name: macOS
runs-on: macOS-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Build
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter macOS" -destination "generic/platform=macOS" -configuration Debug

- name: Test
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter macOS" -testPlan "MethodNotificationCenter macOS Tests" -configuration Debug ONLY_ACTIVE_ARCH=YES test

tvos:
name: tvOS
runs-on: macOS-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Build tvOS
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter tvOS" -destination "generic/platform=tvOS" -configuration Debug

- name: Build tvOS Simulator
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug

- name: Test
run: |
TVOS_SIM="$(xcrun simctl list devices available | grep "Apple TV" | sort -V | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#TVOS_SIM}" == "0" ]; then
TVOS_SIM = "Apple TV" # Fallback Simulator
fi

xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter tvOS" -testPlan "MethodNotificationCenter tvOS Tests" -destination "platform=tvOS Simulator,name=$TVOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test

watchos:
name: watchOS
runs-on: macOS-11

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Build watchOS
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter watchOS" -destination "generic/platform=watchOS" -configuration Debug

- name: Build watchOS Simulator
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug

- name: Test
run: |
WATCHOS_SIM="$(xcrun simctl list devices available | grep "Apple Watch" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#WATCHOS_SIM}" == "0" ]; then
WATCHOS_SIM = "Apple Watch Series 6 - 44mm" # Fallback Simulator
fi

xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter watchOS" -testPlan "MethodNotificationCenter watchOS Tests" -destination "platform=watchOS Simulator,name=$WATCHOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.swiftpm
IDEWorkspaceChecks.plist
MethodNotificationCenter.xcodeproj/project.xcworkspace/xcuserdata
MethodNotificationCenter.xcodeproj/project.xcworkspace
MethodNotificationCenter.xcodeproj/xcuserdata

.build
.swiftpm
scripts/build
12 changes: 4 additions & 8 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
disabled_rules:
- file_length
- line_length
- cyclomatic_complexity
- type_body_length
- function_body_length
- type_name

opt_in_rules:
- anyobject_protocol
Expand Down Expand Up @@ -41,6 +42,7 @@ opt_in_rules:
- multiple_closures_with_trailing_closure
- nesting
- notification_center_detachment
- number_separator
- object_literal
- operator_usage_whitespace
- override_in_extension
Expand All @@ -57,12 +59,6 @@ opt_in_rules:

reporter: "xcode"

excluded:
- Tests/LinuxMain.swift
- Tests/HalfTests/XCTestManifests.swift
- Tests/CHalfTests/XCTestManifests.swift

identifier_name:
excluded:
- pi
- _value
- i
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2020 Joseph Newton <somerandomiosdev@gmail.com>
Copyright (c) 2021 Joe Newton <somerandomiosdev@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 8 additions & 6 deletions MethodNotificationCenter.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MethodNotificationCenter"
s.version = "0.1.0"
s.version = "0.1.1"
s.summary = "Simple Objective-C Runtime Injection"
s.description = <<-DESC
A lightweight framework enabling easy snooping on Objective-C methods for iOS, macOS, and tvOS.
Expand All @@ -11,21 +11,23 @@ Pod::Spec.new do |s|
s.license = "MIT"
s.author = { "Joseph Newton" => "somerandomiosdev@gmail.com" }

s.ios.deployment_target = '11.0'
s.ios.deployment_target = '9.0'
s.macos.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'

s.source = { :git => "https://github.com/SomeRandomiOSDev/MethodNotificationCenter.git", :tag => s.version.to_s }
s.source_files = 'Sources/**/*.{h,m,s}'
s.swift_versions = ['4.0', '4.2', '5.0']
s.cocoapods_version = '>= 1.7.3'

s.test_spec 'Tests' do |ts|
ts.ios.deployment_target = '11.0'
ts.macos.deployment_target = '10.10'
ts.tvos.deployment_target = '9.0'
ts.ios.deployment_target = '9.0'
ts.macos.deployment_target = '10.10'
ts.tvos.deployment_target = '9.0'
ts.watchos.deployment_target = '2.0'

ts.source_files = 'Tests/**/*.{m,swift}'
ts.source_files = 'Tests/**/*.{m,swift}'
end

end
Loading