Skip to content
Merged

SPM #50

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
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/custom.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: oleghnidets

---

**Is your feature request related to a problem? Please describe.**
**Is your feature request related to a problem?**
<!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the solution you'd like**
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches: [ master ]

env:
DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer

jobs:
Generate:
runs-on: macos-latest
Expand All @@ -17,7 +14,7 @@ jobs:
xcodebuild docbuild \
-scheme 'OHMySQL' \
-derivedDataPath ./build \
-destination 'platform=iOS Simulator,OS=latest,name=iPhone 13'
-destination 'platform=iOS Simulator,OS=latest,name=iPhone 15'
- name: Generate pages
run: |
$(xcrun --find docc) process-archive transform-for-static-hosting \
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/ohmysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ on:
- master

jobs:
SPMValidation:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: SPM describe
run: swift package describe
- name: SPM resolve
run: swift package resolve
- name: SPM build all targets
run: swift package resolve
UnitTests:
runs-on: macos-latest
steps:
Expand All @@ -19,16 +29,10 @@ jobs:
mysql-version: 8.0
database: tests
- name: Run tests
run: xcodebuild -project OHMySQL.xcodeproj -scheme "OHMySQLTests" -parallel-testing-enabled NO -destination "platform=iOS Simulator,OS=latest,name=iPhone 14" test \
run: xcodebuild -project OHMySQL.xcodeproj -scheme "OHMySQLTests" -parallel-testing-enabled NO -destination "platform=iOS Simulator,OS=latest,name=iPhone 15" test \
USER_NAME='root' \
USER_PASSWORD='' \
DB_NAME='tests' \
DB_HOST='localhost' \
DB_PORT='3306' \
DB_SOCKET='/tmp/mysql.sock' | xcpretty
CocoaPodsValidation:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Cocoapods
run: pod lib lint --allow-warnings --verbose
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## Build generated
build/
.build/
DerivedData

## Various settings
Expand Down
16 changes: 6 additions & 10 deletions OHMySQL.docc/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ Learn the ways to integrate the framework in your application.

The framework can be installed in different ways.

### CocoaPods
### SPM

Open `Podfile` and declare the dependency:
```bash
pod 'OHMySQL'
```
Once you have your Swift package set up, adding `OHMySQL` as a dependency is as easy as adding it to the dependencies value of your Package.swift or the Package list in Xcode.

Then open Terminal, navigate to project folder and install the dependencies:
```swift
dependencies: [
.package(url: "https://github.com/oleghnidets/OHMySQL.git", .upToNextMajor(from: "3.4.1"))
]
```
pod install --repo-update
```

> Tip: Learn how to use [CocoaPods](https://guides.cocoapods.org/using/getting-started.html).

### Carthage

Expand Down
27 changes: 0 additions & 27 deletions OHMySQL.podspec

This file was deleted.

408 changes: 192 additions & 216 deletions OHMySQL.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions OHMySQL/Sources/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyTracking</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string></string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string></string>
</array>
</dict>
</array>
</dict>
</plist>
50 changes: 50 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "OHMySQL",
platforms: [
.iOS(.v14),
.macOS(.v11)
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "OHMySQL",
targets: ["OHMySQL"]
),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "OHMySQL",
dependencies: ["MySQL", "OpenSSL"],
path: "OHMySQL/Sources",
resources: [.process("PrivacyInfo.xcprivacy")],
publicHeadersPath: "",
cSettings: [
.define("SWIFT_PACKAGE")
]
),
.binaryTarget(
name: "MySQL",
path: "OHMySQL/lib/MySQL.xcframework"
),
.binaryTarget(
name: "OpenSSL",
path: "OHMySQL/lib/OpenSSL.xcframework"
),
.testTarget(
name: "OHMySQLTests",
dependencies: ["OHMySQL"],
path: "OHMySQL/Tests",

),
]
)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License][platform-image]][platform-url]
[![License][license-image]][license-url]
[![CocoaPods Compatible][cocoapods-image]][cocoapods-url]
[![SPM][spm-image]](spm-url)
[![Carthage Compatible][carthage-image]][carthage-url]
[![Documentation][docs-image]][docs-url]

Expand Down Expand Up @@ -168,12 +168,12 @@ try? context.save()

See [LICENSE](LICENSE).

[spm-image]: https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat-square
[spm-url]: Package.swift
[platform-image]: https://img.shields.io/badge/platforms-ios%20|%20macOS%20|%20catalyst%20-orange.svg
[platform-url]: https://oleghnidets.github.io/OHMySQL/documentation/ohmysql
[license-image]: https://img.shields.io/badge/License-MIT-green.svg
[license-url]: LICENSE
[cocoapods-image]: https://img.shields.io/cocoapods/v/OHMySQL.svg?style=flat-square
[cocoapods-url]: OHMySQL.podspec
[carthage-image]: https://img.shields.io/badge/carthage-compatible-blue.svg
[carthage-url]: https://github.com/Carthage/Carthage
[docs-image]: https://img.shields.io/badge/documentation-DocC-lightgrey.svg
Expand Down
Loading
Loading