Skip to content

Commit f12c621

Browse files
committed
Merge branch release/1.2.0
2 parents fe83c7c + 51dd0fe commit f12c621

12 files changed

Lines changed: 251 additions & 37 deletions
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1520"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "AFAPIWrapper"
18+
BuildableName = "AFAPIWrapper"
19+
BlueprintName = "AFAPIWrapper"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
shouldAutocreateTestPlan = "YES">
31+
</TestAction>
32+
<LaunchAction
33+
buildConfiguration = "Debug"
34+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
36+
launchStyle = "0"
37+
useCustomWorkingDirectory = "NO"
38+
ignoresPersistentStateOnLaunch = "NO"
39+
debugDocumentVersioning = "YES"
40+
debugServiceExtension = "internal"
41+
allowLocationSimulation = "YES">
42+
</LaunchAction>
43+
<ProfileAction
44+
buildConfiguration = "Release"
45+
shouldUseLaunchSchemeArgsEnv = "YES"
46+
savedToolIdentifier = ""
47+
useCustomWorkingDirectory = "NO"
48+
debugDocumentVersioning = "YES">
49+
<MacroExpansion>
50+
<BuildableReference
51+
BuildableIdentifier = "primary"
52+
BlueprintIdentifier = "AFAPIWrapper"
53+
BuildableName = "AFAPIWrapper"
54+
BlueprintName = "AFAPIWrapper"
55+
ReferencedContainer = "container:">
56+
</BuildableReference>
57+
</MacroExpansion>
58+
</ProfileAction>
59+
<AnalyzeAction
60+
buildConfiguration = "Debug">
61+
</AnalyzeAction>
62+
<ArchiveAction
63+
buildConfiguration = "Release"
64+
revealArchiveInOrganizer = "YES">
65+
</ArchiveAction>
66+
</Scheme>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1520"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "APIWrapper"
18+
BuildableName = "APIWrapper"
19+
BlueprintName = "APIWrapper"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
shouldAutocreateTestPlan = "YES">
31+
</TestAction>
32+
<LaunchAction
33+
buildConfiguration = "Debug"
34+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
36+
launchStyle = "0"
37+
useCustomWorkingDirectory = "NO"
38+
ignoresPersistentStateOnLaunch = "NO"
39+
debugDocumentVersioning = "YES"
40+
debugServiceExtension = "internal"
41+
allowLocationSimulation = "YES">
42+
</LaunchAction>
43+
<ProfileAction
44+
buildConfiguration = "Release"
45+
shouldUseLaunchSchemeArgsEnv = "YES"
46+
savedToolIdentifier = ""
47+
useCustomWorkingDirectory = "NO"
48+
debugDocumentVersioning = "YES">
49+
<MacroExpansion>
50+
<BuildableReference
51+
BuildableIdentifier = "primary"
52+
BlueprintIdentifier = "APIWrapper"
53+
BuildableName = "APIWrapper"
54+
BlueprintName = "APIWrapper"
55+
ReferencedContainer = "container:">
56+
</BuildableReference>
57+
</MacroExpansion>
58+
</ProfileAction>
59+
<AnalyzeAction
60+
buildConfiguration = "Debug">
61+
</AnalyzeAction>
62+
<ArchiveAction
63+
buildConfiguration = "Release"
64+
revealArchiveInOrganizer = "YES">
65+
</ArchiveAction>
66+
</Scheme>

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
// swift-tools-version: 5.6
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
1+
// swift-tools-version: 5.1
32

43
import PackageDescription
54

65
let package = Package(
76
name: "APIWrapper",
87
platforms: [
9-
.macOS(.v10_13),
10-
.iOS(.v11),
11-
.tvOS(.v11),
12-
.watchOS(.v4)
8+
.iOS(.v12),
9+
.macOS(.v10_14),
10+
.tvOS(.v12),
11+
.watchOS(.v5),
1312
],
1413
products: [
1514
.library(name: "APIWrapper", targets: ["APIWrapper"]),
@@ -18,28 +17,21 @@ let package = Package(
1817
dependencies: [
1918
.package(
2019
url: "https://github.com/Alamofire/Alamofire.git",
21-
.upToNextMajor(from: "5.0.0")
22-
),
20+
.upToNextMajor(from: "5.0.0")),
2321
],
2422
targets: [
2523
.target(
2624
name: "APIWrapper",
27-
dependencies: ["Alamofire"],
28-
path: "Sources/Core"
29-
),
25+
path: "Sources/Core",
26+
resources: [.copy("PrivacyInfo.xcprivacy")]),
3027
.target(
3128
name: "AFAPIWrapper",
32-
dependencies: [
33-
"APIWrapper",
34-
.product(name: "Alamofire", package: "Alamofire")
35-
],
36-
path: "Sources/Alamofire"
37-
),
29+
dependencies: ["APIWrapper", "Alamofire"],
30+
path: "Sources/Alamofire"),
3831
.testTarget(
3932
name: "APIWrapperTests",
4033
dependencies: ["APIWrapper"],
41-
path: "Tests"
42-
),
34+
path: "Tests"),
4335
],
4436
swiftLanguageVersions: [.v5]
4537
)

Package@swift-5.9.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// swift-tools-version: 5.9
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "APIWrapper",
7+
platforms: [
8+
.iOS(.v12),
9+
.macOS(.v10_14),
10+
.tvOS(.v12),
11+
.watchOS(.v5),
12+
.visionOS(.v1)
13+
],
14+
products: [
15+
.library(name: "APIWrapper", targets: ["APIWrapper"]),
16+
.library(name: "AFAPIWrapper", targets: ["AFAPIWrapper"]),
17+
],
18+
dependencies: [
19+
.package(
20+
url: "https://github.com/Alamofire/Alamofire.git",
21+
.upToNextMajor(from: "5.8.0")),
22+
],
23+
targets: [
24+
.target(
25+
name: "APIWrapper",
26+
path: "Sources/Core"),
27+
.target(
28+
name: "AFAPIWrapper",
29+
dependencies: ["APIWrapper", "Alamofire"],
30+
path: "Sources/Alamofire"),
31+
.testTarget(
32+
name: "APIWrapperTests",
33+
dependencies: ["APIWrapper"]),
34+
],
35+
swiftLanguageVersions: [.v5]
36+
)

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# RaAPIWrapper
22

33
<p align="center">
4-
<a><img src="https://img.shields.io/badge/language-swift-ffac45.svg"></a>
5-
<a href="https://github.com/RakuyoKit/RaAPIWrapper/releases"><img src="https://img.shields.io/cocoapods/v/RaAPIWrapper.svg"></a>
6-
<a href="https://github.com/RakuyoKit/RaAPIWrapper/blob/main/LICENSE"><img src="https://img.shields.io/cocoapods/l/RaAPIWrapper.svg?style=flat"></a>
4+
<a href="https://swiftpackageindex.com/RakuyoKit/RaAPIWrapper"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FRakuyoKit%2FRaAPIWrapper%2Fbadge%3Ftype%3Dswift-versions"></a>
5+
<a href="https://swiftpackageindex.com/RakuyoKit/RaAPIWrapper"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FRakuyoKit%2FRaAPIWrapper%2Fbadge%3Ftype%3Dplatforms"></a>
6+
</p>
7+
<p align="center">
8+
<a href="https://cocoapods.org/pods/RaAPIWrapper"><img src="https://img.shields.io/github/v/tag/RakuyoKit/RaAPIWrapper.svg?include_prereleases=&sort=semver"></a>
9+
<a href="https://raw.githubusercontent.com/RakuyoKit/RaAPIWrapper/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-black"></a>
710
</p>
811

912
> [中文](https://github.com/RakuyoKit/RaAPIWrapper/blob/main/README_CN.md)
@@ -18,9 +21,9 @@ When you have a large number of network request apis in the same file `RaAPIWrap
1821

1922
The good thing is that you can easily integrate `RaAPIWrapper` into your existing project with few or no code changes, and `RaAPIWrapper` can coexist very well with the existing web framework in your project.
2023

21-
## Prerequisites
24+
## Requirements
2225

23-
- **iOS 11****macOS 10.13****watchOS 4.0****tvOS 11** or later.
26+
- **iOS 12****macOS 10.14****watchOS 5.0****tvOS 12** or later.
2427
- **Xcode 14** or later required.
2528
- **Swift 5.7** or later required.
2629

README_CN.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# RaAPIWrapper
22

33
<p align="center">
4-
<a><img src="https://img.shields.io/badge/language-swift-ffac45.svg"></a>
5-
<a href="https://github.com/RakuyoKit/RaAPIWrapper/releases"><img src="https://img.shields.io/cocoapods/v/RaAPIWrapper.svg"></a>
6-
<a href="https://github.com/RakuyoKit/RaAPIWrapper/blob/main/LICENSE"><img src="https://img.shields.io/cocoapods/l/RaAPIWrapper.svg?style=flat"></a>
4+
<a href="https://swiftpackageindex.com/RakuyoKit/RaAPIWrapper"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FRakuyoKit%2FRaAPIWrapper%2Fbadge%3Ftype%3Dswift-versions"></a>
5+
<a href="https://swiftpackageindex.com/RakuyoKit/RaAPIWrapper"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FRakuyoKit%2FRaAPIWrapper%2Fbadge%3Ftype%3Dplatforms"></a>
6+
</p>
7+
<p align="center">
8+
<a href="https://cocoapods.org/pods/RaAPIWrapper"><img src="https://img.shields.io/github/v/tag/RakuyoKit/RaAPIWrapper.svg?include_prereleases=&sort=semver"></a>
9+
<a href="https://raw.githubusercontent.com/RakuyoKit/RaAPIWrapper/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-black"></a>
710
</p>
811

912
`RaAPIWrapper` 利用 `@propertyWrapper` 来实现类似于 Android `Retrofit` 库中定义网络请求的效果。
@@ -18,7 +21,7 @@
1821

1922
## 基本要求
2023

21-
- 运行 **iOS 11****macOS 10.13****watchOS 4.0****tvOS 11** 及以上版本的设备。
24+
- 运行 **iOS 12****macOS 10.14****watchOS 5.0****tvOS 12** 及以上版本的设备。
2225
- 使用 **Xcode 14** 及以上版本编译运行。
2326
- **Swift 5.7** 及以上版本。
2427

RaAPIWrapper.podspec

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Pod::Spec.new do |s|
55

66
s.name = 'RaAPIWrapper'
77

8-
s.version = '1.1.1'
8+
s.version = '1.2.0'
99

1010
s.summary = 'Makes it easier to define a network request.'
1111

@@ -21,10 +21,10 @@ Pod::Spec.new do |s|
2121

2222
s.requires_arc = true
2323

24-
s.ios.deployment_target = '11.0'
25-
s.osx.deployment_target = '10.13'
26-
s.tvos.deployment_target = '11.0'
27-
s.watchos.deployment_target = '4.0'
24+
s.ios.deployment_target = '12.0'
25+
s.osx.deployment_target = '10.14'
26+
s.tvos.deployment_target = '12.0'
27+
s.watchos.deployment_target = '5.0'
2828

2929
s.swift_versions = ['5']
3030

@@ -34,13 +34,15 @@ Pod::Spec.new do |s|
3434

3535
s.subspec "Core" do |cs|
3636
cs.source_files = 'Sources/Core/**/*'
37+
38+
cs.resource_bundles = { 'RaAPIWrapper' => ['Sources/Core/PrivacyInfo.xcprivacy'] }
3739
end
3840

3941
s.subspec "AF" do |cs|
4042
cs.source_files = 'Sources/Alamofire/*'
4143

4244
cs.dependency "RaAPIWrapper/Core"
43-
cs.dependency "Alamofire", "~> 5.0"
45+
cs.dependency "Alamofire", "~> 5.8.0"
4446
end
4547

4648
end

Sources/Core/PrivacyInfo.xcprivacy

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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>NSPrivacyAccessedAPITypes</key>
6+
<array>
7+
</array>
8+
<key>NSPrivacyTracking</key>
9+
<false/>
10+
<key>NSPrivacyTrackingDomains</key>
11+
<array>
12+
</array>
13+
<key>NSPrivacyCollectedDataTypes</key>
14+
<array>
15+
</array>
16+
</dict>
17+
</plist>

Sources/Core/Wrapper/APIParameterConvertible.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ extension Dictionary: APIParameterConvertible where Key == String {
4545
if let value = $0 as? AnyAPIParameter { return value }
4646
if let value = $0 as? (any APIParameter) { return .init(value) }
4747
if let value = $0 as? APIParameterConvertible { return value.toParameters }
48+
49+
if let value = $0 as? (any RawRepresentable) {
50+
return mapAnyObjectToEncodable(value.rawValue as AnyObject)
51+
}
4852
return mapAnyObjectToEncodable($0 as AnyObject)
4953
}
5054

0 commit comments

Comments
 (0)