Skip to content

Commit 1a2c361

Browse files
committed
Initial commit
0 parents  commit 1a2c361

38 files changed

+3844
-0
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[*.yml]
2+
indent_style = space
3+
indent_size = 2
4+
5+
[*.swift]
6+
indent_style = tab
7+
indent_size = 1

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- '*'
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
xcodebuild-test:
18+
name: xcodebuild-test
19+
if: |
20+
!contains(github.event.head_commit.message, '[ci skip]') &&
21+
!contains(github.event.head_commit.message, '[ci skip test]')
22+
runs-on: macos-latest
23+
env:
24+
ENABLE_ALL_TRAITS: "1"
25+
strategy:
26+
matrix:
27+
platform: [iOS, macOS, macCatalyst, tvOS, watchOS]
28+
xcode: ['26.2']
29+
timeout-minutes: 30
30+
steps:
31+
- uses: actions/checkout@v6
32+
- name: Test
33+
uses: capturecontext/swift-package-action/build@3.0-beta.13
34+
with:
35+
xcode: ${{ matrix.xcode }}
36+
cache-derived-data: true
37+
action: xcodebuild-test
38+
platform: ${{ matrix.platform }}
39+
scheme: swift-keypath-mappings-Package

.gitignore

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

.spi.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 1
2+
builder:
3+
configs:
4+
- platform: ios
5+
- platform: macos-spm
6+
- platform: macos-xcodebuild
7+
- platform: tvos
8+
- platform: watchos
9+
- platform: android
10+
11+
- platform: linux
12+
swift_version: '5.9'
13+
14+
- platform: linux
15+
swift_version: '6.0'
16+
17+
- platform: linux
18+
swift_version: '6.1'
19+
20+
- documentation_targets:
21+
- KeyPathMapping

.swiftpm/xcode/package.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: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "2640"
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 = "KeyPathMapping"
19+
BuildableName = "KeyPathMapping"
20+
BlueprintName = "KeyPathMapping"
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+
shouldAutocreateTestPlan = "YES">
32+
<Testables>
33+
<TestableReference
34+
skipped = "NO">
35+
<BuildableReference
36+
BuildableIdentifier = "primary"
37+
BlueprintIdentifier = "KeyPathMappingTests"
38+
BuildableName = "KeyPathMappingTests"
39+
BlueprintName = "KeyPathMappingTests"
40+
ReferencedContainer = "container:">
41+
</BuildableReference>
42+
</TestableReference>
43+
</Testables>
44+
</TestAction>
45+
<LaunchAction
46+
buildConfiguration = "Debug"
47+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
48+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49+
launchStyle = "0"
50+
useCustomWorkingDirectory = "NO"
51+
ignoresPersistentStateOnLaunch = "NO"
52+
debugDocumentVersioning = "YES"
53+
debugServiceExtension = "internal"
54+
allowLocationSimulation = "YES"
55+
queueDebuggingEnableBacktraceRecording = "Yes">
56+
</LaunchAction>
57+
<ProfileAction
58+
buildConfiguration = "Release"
59+
shouldUseLaunchSchemeArgsEnv = "YES"
60+
savedToolIdentifier = ""
61+
useCustomWorkingDirectory = "NO"
62+
debugDocumentVersioning = "YES">
63+
<MacroExpansion>
64+
<BuildableReference
65+
BuildableIdentifier = "primary"
66+
BlueprintIdentifier = "KeyPathMapping"
67+
BuildableName = "KeyPathMapping"
68+
BlueprintName = "KeyPathMapping"
69+
ReferencedContainer = "container:">
70+
</BuildableReference>
71+
</MacroExpansion>
72+
</ProfileAction>
73+
<AnalyzeAction
74+
buildConfiguration = "Debug">
75+
</AnalyzeAction>
76+
<ArchiveAction
77+
buildConfiguration = "Release"
78+
revealArchiveInOrganizer = "YES">
79+
</ArchiveAction>
80+
</Scheme>

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) 2026 CaptureContext
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.

Package.swift

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// swift-tools-version: 6.1
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "swift-keypath-mapping",
7+
products: [
8+
.library(
9+
name: "KeyPathMapping",
10+
targets: ["KeyPathMapping"]
11+
)
12+
],
13+
traits: [
14+
.trait(
15+
name: "PredefinedConversions",
16+
description: "Enables predefined conversions"
17+
),
18+
],
19+
dependencies: [
20+
.package(
21+
url: "https://github.com/capturecontext/swift-marker-protocols.git",
22+
.upToNextMajor(from: "1.5.1")
23+
),
24+
],
25+
targets: [
26+
.target(
27+
name: "KeyPathMapping",
28+
dependencies: [
29+
.product(
30+
name: "SwiftMarkerProtocols",
31+
package: "swift-marker-protocols"
32+
),
33+
]
34+
),
35+
.testTarget(
36+
name: "KeyPathMappingTests",
37+
dependencies: ["KeyPathMapping"]
38+
)
39+
],
40+
swiftLanguageModes: [.v6]
41+
)
42+
43+
44+
#if canImport(FoundationEssentials)
45+
import FoundationEssentials
46+
#else
47+
import Foundation
48+
#endif
49+
50+
// Workaround to ensure that all traits are included in documentation. Swift Package Index adds
51+
// SPI_GENERATE_DOCS (https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/2336)
52+
// when building documentation, so only tweak the default traits in this condition.
53+
let spiGenerateDocs = ProcessInfo.processInfo.environment["SPI_GENERATE_DOCS"] != nil
54+
55+
// Enable all traits for other CI actions.
56+
let enableAllTraitsExplicit = ProcessInfo.processInfo.environment["ENABLE_ALL_TRAITS"] != nil
57+
58+
let enableAllTraits = spiGenerateDocs || enableAllTraitsExplicit
59+
60+
package.traits.insert(.default(
61+
enabledTraits: Set(enableAllTraits ? package.traits.map(\.name) : ["PredefinedConversions"])
62+
))

Package@swift-5.9.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// swift-tools-version: 5.9
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "swift-keypath-mapping",
7+
products: [
8+
.library(
9+
name: "KeyPathMapping",
10+
targets: ["KeyPathMapping"]
11+
)
12+
],
13+
dependencies: [
14+
.package(
15+
url: "https://github.com/capturecontext/swift-marker-protocols.git",
16+
.upToNextMajor(from: "1.5.1")
17+
),
18+
],
19+
targets: [
20+
.target(
21+
name: "KeyPathMapping",
22+
dependencies: [
23+
.product(
24+
name: "SwiftMarkerProtocols",
25+
package: "swift-marker-protocols"
26+
)
27+
]
28+
),
29+
.testTarget(
30+
name: "KeyPathMappingTests",
31+
dependencies: ["KeyPathMapping"]
32+
)
33+
]
34+
)

Package@swift-6.0.swift

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// swift-tools-version: 6.0
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "swift-keypath-mapping",
7+
products: [
8+
.library(
9+
name: "KeyPathMapping",
10+
targets: ["KeyPathMapping"]
11+
)
12+
],
13+
dependencies: [
14+
.package(
15+
url: "https://github.com/capturecontext/swift-marker-protocols.git",
16+
.upToNextMajor(from: "1.5.1")
17+
),
18+
],
19+
targets: [
20+
.target(
21+
name: "KeyPathMapping",
22+
dependencies: [
23+
.product(
24+
name: "SwiftMarkerProtocols",
25+
package: "swift-marker-protocols"
26+
)
27+
]
28+
),
29+
.testTarget(
30+
name: "KeyPathMappingTests",
31+
dependencies: ["KeyPathMapping"]
32+
)
33+
],
34+
swiftLanguageModes: [.v6]
35+
)

0 commit comments

Comments
 (0)