Swift package
* Added the Keychain package * Added a Makefile to easily build the package * Added a Gitea pull request action * Updated the README with additional information Co-authored-by: Bram Kolkman <bramkolkman@thinkerium.com> Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
18
.gitea/workflows/pr.yml
Normal file
18
.gitea/workflows/pr.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Resolve dependencies
|
||||||
|
run: make resolve
|
||||||
|
|
||||||
|
- name: Build package
|
||||||
|
run: make build
|
||||||
15
Keychain/Package.resolved
Normal file
15
Keychain/Package.resolved
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"originHash" : "60d3d428473214be2374da47614464243c913251a95cfad9c1f8331314114aba",
|
||||||
|
"pins" : [
|
||||||
|
{
|
||||||
|
"identity" : "swiftlintplugins",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/SimplyDanny/SwiftLintPlugins",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "8a4640d14777685ba8f14e832373160498fbab92",
|
||||||
|
"version" : "0.63.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version" : 3
|
||||||
|
}
|
||||||
29
Keychain/Package.swift
Normal file
29
Keychain/Package.swift
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// swift-tools-version: 6.2
|
||||||
|
|
||||||
|
import PackageDescription
|
||||||
|
|
||||||
|
let package = Package(
|
||||||
|
name: "Keychain",
|
||||||
|
platforms: [
|
||||||
|
.macOS(.v12)
|
||||||
|
],
|
||||||
|
products: [
|
||||||
|
.library(
|
||||||
|
name: "Keychain",
|
||||||
|
targets: [
|
||||||
|
"Keychain"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
.package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.63.2")
|
||||||
|
],
|
||||||
|
targets: [
|
||||||
|
.target(
|
||||||
|
name: "Keychain",
|
||||||
|
plugins: [
|
||||||
|
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins")
|
||||||
|
]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
6
Keychain/Sources/Keychain/Keychain.swift
Normal file
6
Keychain/Sources/Keychain/Keychain.swift
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
//
|
||||||
|
// Keychain.swift
|
||||||
|
// Keychain
|
||||||
|
//
|
||||||
|
// Created by Bram Kolkman on 20/02/2026.
|
||||||
|
//
|
||||||
13
Makefile
Normal file
13
Makefile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
.PHONY: build resolve clean
|
||||||
|
|
||||||
|
build:
|
||||||
|
@echo "Building Swift package 'Keychain'"
|
||||||
|
@swift build --package-path Keychain --scratch-path .build
|
||||||
|
|
||||||
|
resolve:
|
||||||
|
@echo "Resolving Swift package dependencies..."
|
||||||
|
@swift package resolve --package-path Keychain --scratch-path .build
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@echo "Cleaning build artifacts..."
|
||||||
|
@rm -rf .build Keychain/.swiftpm
|
||||||
38
README.md
38
README.md
@@ -1,3 +1,39 @@
|
|||||||
# Keychain
|
# Keychain
|
||||||
|
|
||||||
A Swift package for the Keychain
|
A Swift package for interacting with the Keychain.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- macOS 12+
|
||||||
|
- Swift 6.2+
|
||||||
|
|
||||||
|
## Package Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
Keychain/
|
||||||
|
├── Package.swift
|
||||||
|
├── Package.resolved
|
||||||
|
└── Sources/
|
||||||
|
└── Keychain/
|
||||||
|
└── Keychain.swift
|
||||||
|
```
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
- [SwiftLintPlugins](https://github.com/SimplyDanny/SwiftLintPlugins) (≥ 0.63.2) — enforces Swift style and conventions at build time.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Add the package to your `Package.swift` dependencies and import `Keychain` in your Swift files.
|
||||||
|
|
||||||
|
## Makefile
|
||||||
|
|
||||||
|
A `Makefile` is provided at the root of the repository to simplify common tasks.
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
|----------------|------------------------------------------|
|
||||||
|
| `make build` | Builds the Swift package |
|
||||||
|
| `make resolve` | Resolves package dependencies |
|
||||||
|
| `make clean` | Removes build artifacts and `.swiftpm` |
|
||||||
|
|
||||||
|
Build artifacts are placed in `.build/` at the repository root (outside the package directory).
|
||||||
|
|||||||
Reference in New Issue
Block a user