Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Commit 907760f

Browse files
authored
Merge pull request #50 from jinSasaki/support-swift-package-manager
Supported Swift PM
2 parents c2f31f1 + 88ff267 commit 907760f

13 files changed

Lines changed: 56 additions & 30 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ fastlane/report.xml
6565
fastlane/Preview.html
6666
fastlane/screenshots
6767
fastlane/test_output
68+
69+
.DS_Store

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2
1+
5.3.2

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
language: objective-c
22
xcode_project: InAppPurchase.xcodeproj
33
xcode_scheme: InAppPurchaseTests
4-
osx_image: xcode10.2
4+
osx_image: xcode12.2
55
xcode_sdk: iphonesimulator
66

77
before_install:
88
- brew update && brew bundle
9-
- SIMULATOR_UUID_9=`xcrun simctl create "iPhone 4s" com.apple.CoreSimulator.SimDeviceType.iPhone-4s com.apple.CoreSimulator.SimRuntime.iOS-9-3`
10-
- SIMULATOR_UUID_12=`xcrun simctl create "iPhone Xs" com.apple.CoreSimulator.SimDeviceType.iPhone-XS com.apple.CoreSimulator.SimRuntime.iOS-12-2`
9+
- SIMULATOR_UUID_14=`xcrun simctl create "iPhone Xs" com.apple.CoreSimulator.SimDeviceType.iPhone-XS com.apple.CoreSimulator.SimRuntime.iOS-14-2`
1110
script:
1211
- set -o pipefail
13-
- xcodebuild build-for-testing test-without-building -scheme InAppPurchaseTests -configuration Debug -sdk iphonesimulator -destination "id=$SIMULATOR_UUID_9" ENABLE_TESTABILITY=YES | xcpretty
14-
- xcodebuild build-for-testing test-without-building -scheme InAppPurchaseTests -configuration Debug -sdk iphonesimulator -destination "id=$SIMULATOR_UUID_12" ENABLE_TESTABILITY=YES | xcpretty
12+
- xcodebuild build-for-testing test-without-building -scheme InAppPurchaseTests -configuration Debug -sdk iphonesimulator -destination "id=$SIMULATOR_UUID_14" ENABLE_TESTABILITY=YES | xcpretty
1513
after_success:
1614
- bash <(curl -s https://codecov.io/bash)

InAppPurchase.xcodeproj/project.pbxproj

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
930FAD861FEA89D3003181D8 /* InAppPurchaseIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 930FAD851FEA89D3003181D8 /* InAppPurchaseIntegrationTests.swift */; };
1414
93396ACC25820F8B006ABE59 /* ReceiptRefreshProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93396ACB25820F8B006ABE59 /* ReceiptRefreshProvider.swift */; };
1515
93396AD0258217BF006ABE59 /* ReceiptRefreshProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93396ACF258217BF006ABE59 /* ReceiptRefreshProviderTests.swift */; };
16-
93396AD225821808006ABE59 /* StubReceiptRefreshRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93396AD125821808006ABE59 /* StubReceiptRefreshRequest.swift */; };
17-
93396AD42582191A006ABE59 /* StubReceiptRefreshProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93396AD32582191A006ABE59 /* StubReceiptRefreshProvider.swift */; };
1816
93396AEA25825467006ABE59 /* InAppPurchaseStubs.h in Headers */ = {isa = PBXBuildFile; fileRef = 93396ADC25825467006ABE59 /* InAppPurchaseStubs.h */; settings = {ATTRIBUTES = (Public, ); }; };
1917
93396AF225825585006ABE59 /* InAppPurchase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 938BFA701F5E8411006A4C2A /* InAppPurchase.framework */; };
2018
93396AF325825585006ABE59 /* InAppPurchase.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 938BFA701F5E8411006A4C2A /* InAppPurchase.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -37,8 +35,10 @@
3735
938BFA9B1F5E856D006A4C2A /* InAppPurchase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 938BFA971F5E856D006A4C2A /* InAppPurchase.swift */; };
3836
938BFAA01F5E8697006A4C2A /* PaymentProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 938BFA9D1F5E8697006A4C2A /* PaymentProviderTests.swift */; };
3937
938BFAA11F5E8697006A4C2A /* ProductProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 938BFA9E1F5E8697006A4C2A /* ProductProviderTests.swift */; };
40-
938BFAAD1F5E86ED006A4C2A /* StubPaymentProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 938BFAA51F5E86ED006A4C2A /* StubPaymentProvider.swift */; };
41-
938BFAB11F5E86ED006A4C2A /* StubProductProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 938BFAA91F5E86ED006A4C2A /* StubProductProvider.swift */; };
38+
93BCD5B325CA4B590072EEB1 /* StubProductProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BCD5AF25CA4B590072EEB1 /* StubProductProvider.swift */; };
39+
93BCD5B425CA4B590072EEB1 /* StubPaymentProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BCD5B025CA4B590072EEB1 /* StubPaymentProvider.swift */; };
40+
93BCD5B525CA4B590072EEB1 /* StubReceiptRefreshProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BCD5B125CA4B590072EEB1 /* StubReceiptRefreshProvider.swift */; };
41+
93BCD5B625CA4B590072EEB1 /* StubReceiptRefreshRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BCD5B225CA4B590072EEB1 /* StubReceiptRefreshRequest.swift */; };
4242
93C329721F5E8D0800F7A5E7 /* ProductTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C329711F5E8D0800F7A5E7 /* ProductTests.swift */; };
4343
93C329741F5E8D1D00F7A5E7 /* PaymentTransactionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C329731F5E8D1D00F7A5E7 /* PaymentTransactionTests.swift */; };
4444
93C329761F5E8D6100F7A5E7 /* Product.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C329751F5E8D6100F7A5E7 /* Product.swift */; };
@@ -84,8 +84,6 @@
8484
930FAD851FEA89D3003181D8 /* InAppPurchaseIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InAppPurchaseIntegrationTests.swift; sourceTree = "<group>"; };
8585
93396ACB25820F8B006ABE59 /* ReceiptRefreshProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReceiptRefreshProvider.swift; sourceTree = "<group>"; };
8686
93396ACF258217BF006ABE59 /* ReceiptRefreshProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReceiptRefreshProviderTests.swift; sourceTree = "<group>"; };
87-
93396AD125821808006ABE59 /* StubReceiptRefreshRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StubReceiptRefreshRequest.swift; sourceTree = "<group>"; };
88-
93396AD32582191A006ABE59 /* StubReceiptRefreshProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StubReceiptRefreshProvider.swift; sourceTree = "<group>"; };
8987
93396ADA25825467006ABE59 /* InAppPurchaseStubs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = InAppPurchaseStubs.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9088
93396ADC25825467006ABE59 /* InAppPurchaseStubs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InAppPurchaseStubs.h; sourceTree = "<group>"; };
9189
93396ADD25825467006ABE59 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -104,13 +102,15 @@
104102
938BFA9D1F5E8697006A4C2A /* PaymentProviderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaymentProviderTests.swift; sourceTree = "<group>"; };
105103
938BFA9E1F5E8697006A4C2A /* ProductProviderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductProviderTests.swift; sourceTree = "<group>"; };
106104
938BFAA41F5E86ED006A4C2A /* StubPayment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubPayment.swift; sourceTree = "<group>"; };
107-
938BFAA51F5E86ED006A4C2A /* StubPaymentProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubPaymentProvider.swift; sourceTree = "<group>"; };
108105
938BFAA61F5E86ED006A4C2A /* StubPaymentQueue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubPaymentQueue.swift; sourceTree = "<group>"; };
109106
938BFAA71F5E86ED006A4C2A /* StubPaymentTransaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubPaymentTransaction.swift; sourceTree = "<group>"; };
110107
938BFAA81F5E86ED006A4C2A /* StubProduct.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubProduct.swift; sourceTree = "<group>"; };
111-
938BFAA91F5E86ED006A4C2A /* StubProductProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubProductProvider.swift; sourceTree = "<group>"; };
112108
938BFAAA1F5E86ED006A4C2A /* StubProductsRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubProductsRequest.swift; sourceTree = "<group>"; };
113109
938BFAAB1F5E86ED006A4C2A /* StubProductsResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubProductsResponse.swift; sourceTree = "<group>"; };
110+
93BCD5AF25CA4B590072EEB1 /* StubProductProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubProductProvider.swift; sourceTree = "<group>"; };
111+
93BCD5B025CA4B590072EEB1 /* StubPaymentProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubPaymentProvider.swift; sourceTree = "<group>"; };
112+
93BCD5B125CA4B590072EEB1 /* StubReceiptRefreshProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubReceiptRefreshProvider.swift; sourceTree = "<group>"; };
113+
93BCD5B225CA4B590072EEB1 /* StubReceiptRefreshRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StubReceiptRefreshRequest.swift; sourceTree = "<group>"; };
114114
93C329711F5E8D0800F7A5E7 /* ProductTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductTests.swift; sourceTree = "<group>"; };
115115
93C329731F5E8D1D00F7A5E7 /* PaymentTransactionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaymentTransactionTests.swift; sourceTree = "<group>"; };
116116
93C329751F5E8D6100F7A5E7 /* Product.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Product.swift; sourceTree = "<group>"; };
@@ -177,17 +177,6 @@
177177
name = Frameworks;
178178
sourceTree = "<group>";
179179
};
180-
93396AF7258255EF006ABE59 /* InternalStubs */ = {
181-
isa = PBXGroup;
182-
children = (
183-
938BFAA51F5E86ED006A4C2A /* StubPaymentProvider.swift */,
184-
938BFAA91F5E86ED006A4C2A /* StubProductProvider.swift */,
185-
93396AD32582191A006ABE59 /* StubReceiptRefreshProvider.swift */,
186-
93396AD125821808006ABE59 /* StubReceiptRefreshRequest.swift */,
187-
);
188-
path = InternalStubs;
189-
sourceTree = "<group>";
190-
};
191180
938BFA661F5E8411006A4C2A = {
192181
isa = PBXGroup;
193182
children = (
@@ -222,7 +211,6 @@
222211
938BFA7D1F5E8411006A4C2A /* InAppPurchaseTests */ = {
223212
isa = PBXGroup;
224213
children = (
225-
93396AF7258255EF006ABE59 /* InternalStubs */,
226214
938BFA9C1F5E8697006A4C2A /* Tests */,
227215
938BFA801F5E8411006A4C2A /* Info.plist */,
228216
);
@@ -245,6 +233,7 @@
245233
938BFA9C1F5E8697006A4C2A /* Tests */ = {
246234
isa = PBXGroup;
247235
children = (
236+
93BCD5AE25CA4B590072EEB1 /* InternalStubs */,
248237
930FAD851FEA89D3003181D8 /* InAppPurchaseIntegrationTests.swift */,
249238
93C329791F5E8E0C00F7A5E7 /* InAppPurchaseTests.swift */,
250239
938BFA9D1F5E8697006A4C2A /* PaymentProviderTests.swift */,
@@ -272,6 +261,17 @@
272261
path = Stubs;
273262
sourceTree = "<group>";
274263
};
264+
93BCD5AE25CA4B590072EEB1 /* InternalStubs */ = {
265+
isa = PBXGroup;
266+
children = (
267+
93BCD5AF25CA4B590072EEB1 /* StubProductProvider.swift */,
268+
93BCD5B025CA4B590072EEB1 /* StubPaymentProvider.swift */,
269+
93BCD5B125CA4B590072EEB1 /* StubReceiptRefreshProvider.swift */,
270+
93BCD5B225CA4B590072EEB1 /* StubReceiptRefreshRequest.swift */,
271+
);
272+
path = InternalStubs;
273+
sourceTree = "<group>";
274+
};
275275
/* End PBXGroup section */
276276

277277
/* Begin PBXHeadersBuildPhase section */
@@ -492,17 +492,17 @@
492492
isa = PBXSourcesBuildPhase;
493493
buildActionMask = 2147483647;
494494
files = (
495+
93BCD5B625CA4B590072EEB1 /* StubReceiptRefreshRequest.swift in Sources */,
496+
93BCD5B525CA4B590072EEB1 /* StubReceiptRefreshProvider.swift in Sources */,
495497
930FAD861FEA89D3003181D8 /* InAppPurchaseIntegrationTests.swift in Sources */,
498+
93BCD5B425CA4B590072EEB1 /* StubPaymentProvider.swift in Sources */,
496499
93C3297A1F5E8E0C00F7A5E7 /* InAppPurchaseTests.swift in Sources */,
497500
938BFAA01F5E8697006A4C2A /* PaymentProviderTests.swift in Sources */,
498501
93C329741F5E8D1D00F7A5E7 /* PaymentTransactionTests.swift in Sources */,
499502
938BFAA11F5E8697006A4C2A /* ProductProviderTests.swift in Sources */,
500503
93C329721F5E8D0800F7A5E7 /* ProductTests.swift in Sources */,
504+
93BCD5B325CA4B590072EEB1 /* StubProductProvider.swift in Sources */,
501505
93396AD0258217BF006ABE59 /* ReceiptRefreshProviderTests.swift in Sources */,
502-
938BFAAD1F5E86ED006A4C2A /* StubPaymentProvider.swift in Sources */,
503-
938BFAB11F5E86ED006A4C2A /* StubProductProvider.swift in Sources */,
504-
93396AD42582191A006ABE59 /* StubReceiptRefreshProvider.swift in Sources */,
505-
93396AD225821808006ABE59 /* StubReceiptRefreshRequest.swift in Sources */,
506506
);
507507
runOnlyForDeploymentPostprocessing = 0;
508508
};

Package.swift

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// swift-tools-version:5.3
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "InAppPurchase",
7+
platforms: [
8+
.iOS(.v9),
9+
.macOS(.v10_15)
10+
],
11+
products: [
12+
.library(name: "InAppPurchase", targets: ["InAppPurchase"]),
13+
.library(name: "InAppPurchaseStubs", targets: ["InAppPurchaseStubs"]),
14+
],
15+
targets: [
16+
.target(name: "InAppPurchase", path: "Sources"),
17+
.target(name: "InAppPurchaseStubs", dependencies: ["InAppPurchase"], path: "InAppPurchaseStubs"),
18+
.testTarget(name: "InAppPurchaseTests", dependencies: ["InAppPurchase", "InAppPurchaseStubs"], path: "Tests"),
19+
],
20+
swiftLanguageVersions: [.v5]
21+
)

Sources/Internal/Internal+InAppPurchase.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2018年 Jin Sasaki. All rights reserved.
77
//
88

9+
import Foundation
910
import StoreKit
1011

1112
internal typealias ProductHandler = (_ result: Result<[SKProduct], InAppPurchase.Error>) -> Void

Sources/Internal/Internal+Product.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2018年 Jin Sasaki. All rights reserved.
77
//
88

9+
import Foundation
910
import StoreKit
1011

1112
extension Internal {

Sources/PaymentTransaction.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2017年 Jin Sasaki. All rights reserved.
77
//
88

9+
import Foundation
910
import StoreKit
1011

1112
public typealias TransactionState = SKPaymentTransactionState

Sources/Product.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright © 2017年 Jin Sasaki. All rights reserved.
77
//
88

9+
import Foundation
10+
911
public protocol Product {
1012
var productIdentifier: String { get }
1113
var price: Decimal { get }
File renamed without changes.

0 commit comments

Comments
 (0)