Skip to content

Commit c05d245

Browse files
committed
Initial commit
0 parents  commit c05d245

37 files changed

+3986
-0
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "**"
10+
schedule:
11+
- cron: "3 3 * * 2" # 3:03 AM, every Tuesday
12+
13+
concurrency:
14+
group: ci-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
macOS:
19+
name: ${{ matrix.platform }} (Swift ${{ matrix.swift }})
20+
runs-on: macos-15
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
platform:
25+
- iOS
26+
- macOS
27+
- tvOS
28+
- watchOS
29+
swift:
30+
- "6.0"
31+
- "6.1"
32+
include:
33+
- action: test
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: mxcl/xcodebuild@v3
37+
with:
38+
action: ${{ matrix.action }}
39+
platform: ${{ matrix.platform }}
40+
swift: ~${{ matrix.swift }}
41+
workspace: ObjCRuntimeTools.xcworkspace
42+
scheme: ObjCRuntimeTools

.github/workflows/format.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Format
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: format-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
format:
14+
name: swiftformat
15+
runs-on: macos-15
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Format
19+
run: swiftformat .
20+
- uses: stefanzweifel/git-auto-commit-action@v5
21+
with:
22+
commit_message: Run SwiftFormat
23+
branch: main
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/.swiftpm
5+
xcuserdata/
6+
DerivedData/
7+
.netrc

.swift-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.0

.swiftformat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
--disable redundantNilInit,redundantSelf,redundantType,redundantBackticks,unusedArguments,extensionAccessControl,hoistPatternLet,redundantLetError
2+
3+
--header ignore
4+
--indent tab
5+
--ifdef no-indent
6+
--ranges preserve

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 David Roman
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

ObjCRuntimeTools.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"originHash" : "c1cd20fbe4daf1809abedc8daa370747225248baac76f8fc65be17b46837e992",
3+
"pins" : [
4+
{
5+
"identity" : "swift-custom-dump",
6+
"kind" : "remoteSourceControl",
7+
"location" : "https://github.com/pointfreeco/swift-custom-dump",
8+
"state" : {
9+
"revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1",
10+
"version" : "1.3.3"
11+
}
12+
},
13+
{
14+
"identity" : "swift-macro-testing",
15+
"kind" : "remoteSourceControl",
16+
"location" : "https://github.com/pointfreeco/swift-macro-testing",
17+
"state" : {
18+
"revision" : "cfe474c7e97d429ea31eefed2e9ab8c7c74260f9",
19+
"version" : "0.6.2"
20+
}
21+
},
22+
{
23+
"identity" : "swift-snapshot-testing",
24+
"kind" : "remoteSourceControl",
25+
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
26+
"state" : {
27+
"revision" : "1be8144023c367c5de701a6313ed29a3a10bf59b",
28+
"version" : "1.18.3"
29+
}
30+
},
31+
{
32+
"identity" : "swift-syntax",
33+
"kind" : "remoteSourceControl",
34+
"location" : "https://github.com/swiftlang/swift-syntax",
35+
"state" : {
36+
"revision" : "f99ae8aa18f0cf0d53481901f88a0991dc3bd4a2",
37+
"version" : "601.0.1"
38+
}
39+
},
40+
{
41+
"identity" : "xctest-dynamic-overlay",
42+
"kind" : "remoteSourceControl",
43+
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
44+
"state" : {
45+
"revision" : "39de59b2d47f7ef3ca88a039dff3084688fe27f4",
46+
"version" : "1.5.2"
47+
}
48+
}
49+
],
50+
"version" : 3
51+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1640"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "ObjCRuntimeTools"
19+
BuildableName = "ObjCRuntimeTools"
20+
BlueprintName = "ObjCRuntimeTools"
21+
ReferencedContainer = "container:">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
</BuildActionEntries>
25+
</BuildAction>
26+
<TestAction
27+
buildConfiguration = "Debug"
28+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
29+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
31+
<TestPlans>
32+
<TestPlanReference
33+
reference = "container:Tests/TestPlans/ObjCRuntimeTools.xctestplan"
34+
default = "YES">
35+
</TestPlanReference>
36+
</TestPlans>
37+
</TestAction>
38+
<LaunchAction
39+
buildConfiguration = "Debug"
40+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
41+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
42+
launchStyle = "0"
43+
useCustomWorkingDirectory = "NO"
44+
ignoresPersistentStateOnLaunch = "NO"
45+
debugDocumentVersioning = "YES"
46+
debugServiceExtension = "internal"
47+
allowLocationSimulation = "YES">
48+
</LaunchAction>
49+
<ProfileAction
50+
buildConfiguration = "Release"
51+
shouldUseLaunchSchemeArgsEnv = "YES"
52+
savedToolIdentifier = ""
53+
useCustomWorkingDirectory = "NO"
54+
debugDocumentVersioning = "YES">
55+
<MacroExpansion>
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "ObjCRuntimeTools"
59+
BuildableName = "ObjCRuntimeTools"
60+
BlueprintName = "ObjCRuntimeTools"
61+
ReferencedContainer = "container:">
62+
</BuildableReference>
63+
</MacroExpansion>
64+
</ProfileAction>
65+
<AnalyzeAction
66+
buildConfiguration = "Debug">
67+
</AnalyzeAction>
68+
<ArchiveAction
69+
buildConfiguration = "Release"
70+
revealArchiveInOrganizer = "YES">
71+
</ArchiveAction>
72+
</Scheme>

Package.resolved

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"originHash" : "c1cd20fbe4daf1809abedc8daa370747225248baac76f8fc65be17b46837e992",
3+
"pins" : [
4+
{
5+
"identity" : "swift-custom-dump",
6+
"kind" : "remoteSourceControl",
7+
"location" : "https://github.com/pointfreeco/swift-custom-dump",
8+
"state" : {
9+
"revision" : "82645ec760917961cfa08c9c0c7104a57a0fa4b1",
10+
"version" : "1.3.3"
11+
}
12+
},
13+
{
14+
"identity" : "swift-macro-testing",
15+
"kind" : "remoteSourceControl",
16+
"location" : "https://github.com/pointfreeco/swift-macro-testing",
17+
"state" : {
18+
"revision" : "cfe474c7e97d429ea31eefed2e9ab8c7c74260f9",
19+
"version" : "0.6.2"
20+
}
21+
},
22+
{
23+
"identity" : "swift-snapshot-testing",
24+
"kind" : "remoteSourceControl",
25+
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
26+
"state" : {
27+
"revision" : "1be8144023c367c5de701a6313ed29a3a10bf59b",
28+
"version" : "1.18.3"
29+
}
30+
},
31+
{
32+
"identity" : "swift-syntax",
33+
"kind" : "remoteSourceControl",
34+
"location" : "https://github.com/swiftlang/swift-syntax",
35+
"state" : {
36+
"revision" : "f99ae8aa18f0cf0d53481901f88a0991dc3bd4a2",
37+
"version" : "601.0.1"
38+
}
39+
},
40+
{
41+
"identity" : "xctest-dynamic-overlay",
42+
"kind" : "remoteSourceControl",
43+
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
44+
"state" : {
45+
"revision" : "39de59b2d47f7ef3ca88a039dff3084688fe27f4",
46+
"version" : "1.5.2"
47+
}
48+
}
49+
],
50+
"version" : 3
51+
}

Package.swift

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// swift-tools-version: 6.0
2+
3+
import CompilerPluginSupport
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "objc-runtime-tools",
8+
platforms: [
9+
.iOS(.v13),
10+
.macOS(.v10_15),
11+
.tvOS(.v13),
12+
.watchOS(.v6),
13+
],
14+
products: [
15+
.library(name: "ObjCRuntimeTools", targets: ["ObjCRuntimeTools"]),
16+
],
17+
targets: [
18+
.target(
19+
name: "ObjCRuntimeTools",
20+
dependencies: [
21+
"Association",
22+
"Swizzling",
23+
]
24+
),
25+
],
26+
swiftLanguageModes: [.v5] // disable strict concurrency checks for now
27+
)
28+
29+
// MARK: Association
30+
31+
package.products += [
32+
.library(name: "Association", targets: ["Association"]),
33+
]
34+
35+
package.targets += [
36+
.target(name: "Association", dependencies: ["AssociationMacro"]),
37+
.macro(
38+
name: "AssociationMacro",
39+
dependencies: [
40+
.product(name: "SwiftSyntax", package: "swift-syntax"),
41+
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
42+
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
43+
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
44+
.product(name: "SwiftParserDiagnostics", package: "swift-syntax"),
45+
]
46+
),
47+
48+
.testTarget(
49+
name: "AssociationTests",
50+
dependencies: [
51+
"Association",
52+
"AssociationMacro",
53+
.product(name: "MacroTesting", package: "swift-macro-testing"),
54+
]
55+
),
56+
]
57+
58+
// MARK: Swizzling
59+
60+
package.products += [
61+
.library(name: "Swizzling", targets: ["Swizzling"]),
62+
]
63+
64+
package.targets += [
65+
.target(name: "Swizzling", dependencies: ["SwizzlingMacro"]),
66+
.macro(
67+
name: "SwizzlingMacro",
68+
dependencies: [
69+
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
70+
.product(name: "SwiftSyntax", package: "swift-syntax"),
71+
.product(name: "SwiftSyntaxMacros", package: "swift-syntax"),
72+
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
73+
.product(name: "SwiftParserDiagnostics", package: "swift-syntax"),
74+
]
75+
),
76+
77+
.testTarget(
78+
name: "SwizzlingTests",
79+
dependencies: [
80+
"Swizzling",
81+
"SwizzlingMacro",
82+
.product(name: "MacroTesting", package: "swift-macro-testing"),
83+
]
84+
),
85+
]
86+
87+
package.dependencies += [
88+
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.6.0"),
89+
.package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"602.0.0"),
90+
]

0 commit comments

Comments
 (0)