Skip to content

Commit

Permalink
Support swift package manager (#6)
Browse files Browse the repository at this point in the history
* add package

* add  swift-tools-version:5.0

* add swift package manager support to readme

* update readme file

* edit document

---------

Co-authored-by: Abdulrahman Qasem <Abdulrahman.qasem@baaz.com>
  • Loading branch information
AbdulrahmanQasem95 and Abdulrahman Qasem authored Nov 15, 2023
1 parent 059fd53 commit b3d31f5
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
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>SchemeUserState</key>
<dict>
<key>DynamicMapper-Package.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>DynamicMapper.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>DynamicMapper</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
2 changes: 2 additions & 0 deletions Example/DynamicMapper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
F919D4972AF78D9600B7D4D4 /* ValueTypeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValueTypeModel.swift; sourceTree = "<group>"; };
F919D49B2AFA50B900B7D4D4 /* Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helper.swift; sourceTree = "<group>"; };
F919D49D2AFA540700B7D4D4 /* CustomInsertModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomInsertModel.swift; sourceTree = "<group>"; };
F939F7122B04E07600D182C1 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Package.swift; path = ../Package.swift; sourceTree = "<group>"; };
F9BA4A4D2ACDA0ED00EBABA8 /* jsonExample.JSON */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = jsonExample.JSON; sourceTree = "<group>"; };
F9BA4A512ACEA3CF00EBABA8 /* NestedPropertiesModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NestedPropertiesModel.swift; sourceTree = "<group>"; };
F9BA4A532ACEA72C00EBABA8 /* JsonReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JsonReader.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -165,6 +166,7 @@
F91543CD2AB9B1E700340D63 /* DynamicMapper.podspec */,
A63DC6B17E973832F0363680 /* README.md */,
B85E5EA26BE1EF7E3E4D5FC8 /* LICENSE */,
F939F7122B04E07600D182C1 /* Package.swift */,
);
name = "Podspec Metadata";
sourceTree = "<group>";
Expand Down
Binary file not shown.
23 changes: 23 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// swift-tools-version:5.0
// package.swift
// DynamicMapper
//
// Created by Abdulrahman Qasem on 17/09/2023.
//
import PackageDescription

let package = Package(
name: "DynamicMapper",
platforms: [.macOS(.v10_10),
.iOS(.v10),
.tvOS(.v9),
.watchOS(.v2)],
products: [.library(name: "DynamicMapper",
targets: ["DynamicMapper"])],
targets: [
.target(
name: "DynamicMapper",
path: "Classes")
],
swiftLanguageVersions: [.v5]
)
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,27 @@ DynamicMapper is a framework written in Swift for dynamically decoding and encod
- [Author](#author)
- [License](#license)

## Example
# Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Installation

# Installation
### Cocoapods
DynamicMapper is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'DynamicMapper', '~> 2.0.0' (check releases to make sure this is the latest version)
```

### Swift Package Manager
To add DynamicMapper to a [Swift Package Manager](https://swift.org/package-manager/) based project, add:

```swift
.package(url: "https://github.com/AbdulrahmanQasem95/DynamicMapper.git", .upToNextMajor(from: "2.0.0")),
```
to your `Package.swift` files `dependencies` array.

# Features:
- Decoding and encoding using native `JSONDecoder` and `JSONEncoder`
- Has the full functionality of `Codable = Decodable & Encodable` protocols
Expand Down

0 comments on commit b3d31f5

Please sign in to comment.