Skip to content

Commit

Permalink
Add support for Swift package manager
Browse files Browse the repository at this point in the history
  • Loading branch information
invliD committed Sep 28, 2022
1 parent 19d92eb commit 9d3453d
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/*.xcworkspace/
/.build/
*.xcworkspace/
2 changes: 1 addition & 1 deletion BoardingPassKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ Pod::Spec.new do |s|

s.swift_version = '4.2'
s.source = { :git => "https://github.com/invliD/BoardingPassKit.git", :tag => "#{s.version}" }
s.source_files = "Source/**/*.swift"
s.source_files = "Sources/**/*.swift"
s.requires_arc = true
end
22 changes: 12 additions & 10 deletions BoardingPassKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
/* Begin PBXFileReference section */
2406548020E96A16007B3823 /* BPKDocumentNumber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BPKDocumentNumber.swift; sourceTree = "<group>"; };
244E150521978FBC00113995 /* RegressionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegressionTests.swift; sourceTree = "<group>"; };
2481F0F528E4133700890CC0 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
24AEAF892054D45A00311ED5 /* BoardingPassKit.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BoardingPassKit.podspec; sourceTree = "<group>"; };
24AEAF8B205514F200311ED5 /* BoardingPassExamplev4Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardingPassExamplev4Tests.swift; sourceTree = "<group>"; };
24AEAF8E205517F800311ED5 /* BoardingPassExamplev3Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardingPassExamplev3Tests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -75,8 +76,9 @@
isa = PBXGroup;
children = (
24AEAF892054D45A00311ED5 /* BoardingPassKit.podspec */,
24B3F5081FF3E06F002E489B /* Source */,
24B3F51D1FFE9075002E489B /* Test */,
2481F0F528E4133700890CC0 /* Package.swift */,
24B3F5081FF3E06F002E489B /* Sources */,
24B3F51D1FFE9075002E489B /* Tests */,
24B3F5071FF3E06F002E489B /* Products */,
);
sourceTree = "<group>";
Expand All @@ -91,15 +93,15 @@
name = Products;
sourceTree = "<group>";
};
24B3F5081FF3E06F002E489B /* Source */ = {
24B3F5081FF3E06F002E489B /* Sources */ = {
isa = PBXGroup;
children = (
24B3F51A1FF7C48E002E489B /* Parser */,
24B3F5121FF3E218002E489B /* Models */,
24B3F5091FF3E06F002E489B /* BoardingPassKit.h */,
24B3F50A1FF3E06F002E489B /* Info.plist */,
);
path = Source;
path = Sources;
sourceTree = "<group>";
};
24B3F5121FF3E218002E489B /* Models */ = {
Expand All @@ -122,7 +124,7 @@
path = Parser;
sourceTree = "<group>";
};
24B3F51D1FFE9075002E489B /* Test */ = {
24B3F51D1FFE9075002E489B /* Tests */ = {
isa = PBXGroup;
children = (
24B3F5311FFFCAEB002E489B /* BaggageTagRangeExampleTests.swift */,
Expand All @@ -132,7 +134,7 @@
244E150521978FBC00113995 /* RegressionTests.swift */,
24B3F5271FFE90C0002E489B /* Info.plist */,
);
path = Test;
path = Tests;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -407,7 +409,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.invlid.BoardingPassKit;
Expand All @@ -431,7 +433,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.invlid.BoardingPassKit;
Expand All @@ -448,7 +450,7 @@
buildSettings = {
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = F3N5B69H2L;
INFOPLIST_FILE = Test/Info.plist;
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.invlid.BoardingPassKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -463,7 +465,7 @@
buildSettings = {
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = F3N5B69H2L;
INFOPLIST_FILE = Test/Info.plist;
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.invlid.BoardingPassKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
22 changes: 22 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// swift-tools-version: 5.7
import PackageDescription

let package = Package(
name: "BoardingPassKit",
products: [
.library(
name: "BoardingPassKit",
targets: ["BoardingPassKit"]),
],
dependencies: [],
targets: [
.target(
name: "BoardingPassKit",
dependencies: [],
path: "Sources"),
.testTarget(
name: "BoardingPassKitTests",
dependencies: ["BoardingPassKit"],
path: "Tests"),
]
)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

public class BPKBaggageTagRange {
public var type: UInt32
public var airlineNumeric: UInt32
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

public class BPKBoardingPass {
public var baggageTagRanges: [BPKBaggageTagRange] = []
public var boardingPassIssueYear: UInt32?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

public class BPKDocumentNumber {
public static let numericFormatter: NumberFormatter = {
let formatter = NumberFormatter()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

public class BPKFlightSegment {
public var airlineData: Data?
public var cabinCode: String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

public enum BPKError: Error {
case cannotParseBool(String)
case cannotParseNumber(String)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

class BPKParser {
private var cursor = 0
private var data: Data
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9d3453d

Please sign in to comment.