Skip to content

Commit 7bdaf79

Browse files
Merge pull request #26 from yashigani/swift-package-manager
Support Swift Package Manager
2 parents 76c768e + a336aa9 commit 7bdaf79

File tree

18 files changed

+89
-783
lines changed

18 files changed

+89
-783
lines changed

DemoApp/SimpleBrowser.xcodeproj/project.pbxproj

Lines changed: 46 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,27 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 52;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
3F33CD6D1AA9705B00E56293 /* BrowserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F33CD6C1AA9705B00E56293 /* BrowserViewController.swift */; };
11-
3F33CD6E1AA9707F00E56293 /* WebKitPlus.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FE36BBF1AA91DCE005D06FE /* WebKitPlus.framework */; };
1211
3FE36B581AA902DD005D06FE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE36B571AA902DD005D06FE /* AppDelegate.swift */; };
1312
3FE36B5D1AA902DD005D06FE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3FE36B5B1AA902DD005D06FE /* Main.storyboard */; };
1413
3FE36B5F1AA902DD005D06FE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3FE36B5E1AA902DD005D06FE /* Images.xcassets */; };
1514
3FE36B621AA902DD005D06FE /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3FE36B601AA902DD005D06FE /* LaunchScreen.xib */; };
1615
3FE36B6E1AA902DD005D06FE /* SimpleBrowserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE36B6D1AA902DD005D06FE /* SimpleBrowserTests.swift */; };
17-
3FE36BC71AAAE67D005D06FE /* WebKitPlus.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 3FE36BBF1AA91DCE005D06FE /* WebKitPlus.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
16+
6DAEE79927A7CDE900FC7A97 /* WebKitPlus in Frameworks */ = {isa = PBXBuildFile; productRef = 6DAEE79827A7CDE900FC7A97 /* WebKitPlus */; };
1817
/* End PBXBuildFile section */
1918

2019
/* Begin PBXContainerItemProxy section */
21-
3F33CD6F1AA9708900E56293 /* PBXContainerItemProxy */ = {
22-
isa = PBXContainerItemProxy;
23-
containerPortal = 3FE36BB91AA91DCE005D06FE /* WebKitPlus.xcodeproj */;
24-
proxyType = 1;
25-
remoteGlobalIDString = 3FE36B1A1AA88E52005D06FE;
26-
remoteInfo = WebKitPlus;
27-
};
2820
3FE36B681AA902DD005D06FE /* PBXContainerItemProxy */ = {
2921
isa = PBXContainerItemProxy;
3022
containerPortal = 3FE36B4A1AA902DD005D06FE /* Project object */;
3123
proxyType = 1;
3224
remoteGlobalIDString = 3FE36B511AA902DD005D06FE;
3325
remoteInfo = SimpleBrowser;
3426
};
35-
3FE36BBE1AA91DCE005D06FE /* PBXContainerItemProxy */ = {
36-
isa = PBXContainerItemProxy;
37-
containerPortal = 3FE36BB91AA91DCE005D06FE /* WebKitPlus.xcodeproj */;
38-
proxyType = 2;
39-
remoteGlobalIDString = 3FE36B1B1AA88E52005D06FE;
40-
remoteInfo = WebKitPlus;
41-
};
42-
3FE36BC01AA91DCE005D06FE /* PBXContainerItemProxy */ = {
43-
isa = PBXContainerItemProxy;
44-
containerPortal = 3FE36BB91AA91DCE005D06FE /* WebKitPlus.xcodeproj */;
45-
proxyType = 2;
46-
remoteGlobalIDString = 3FE36B261AA88E52005D06FE;
47-
remoteInfo = WebKitPlusTests;
48-
};
4927
/* End PBXContainerItemProxy section */
5028

5129
/* Begin PBXCopyFilesBuildPhase section */
@@ -55,7 +33,6 @@
5533
dstPath = "";
5634
dstSubfolderSpec = 10;
5735
files = (
58-
3FE36BC71AAAE67D005D06FE /* WebKitPlus.framework in Copy Frameworks */,
5936
);
6037
name = "Copy Frameworks";
6138
runOnlyForDeploymentPostprocessing = 0;
@@ -73,17 +50,17 @@
7350
3FE36B671AA902DD005D06FE /* SimpleBrowserTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SimpleBrowserTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7451
3FE36B6C1AA902DD005D06FE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7552
3FE36B6D1AA902DD005D06FE /* SimpleBrowserTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleBrowserTests.swift; sourceTree = "<group>"; };
76-
3FE36BB91AA91DCE005D06FE /* WebKitPlus.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = WebKitPlus.xcodeproj; path = ../WebKitPlus.xcodeproj; sourceTree = "<group>"; };
7753
3FE36BC81AAAE926005D06FE /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
7854
3FE36BC91AAAE926005D06FE /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Main.strings; sourceTree = "<group>"; };
55+
6DAEE79627A7CDA000FC7A97 /* WebKitPlus */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = WebKitPlus; path = ..; sourceTree = "<group>"; };
7956
/* End PBXFileReference section */
8057

8158
/* Begin PBXFrameworksBuildPhase section */
8259
3FE36B4F1AA902DD005D06FE /* Frameworks */ = {
8360
isa = PBXFrameworksBuildPhase;
8461
buildActionMask = 2147483647;
8562
files = (
86-
3F33CD6E1AA9707F00E56293 /* WebKitPlus.framework in Frameworks */,
63+
6DAEE79927A7CDE900FC7A97 /* WebKitPlus in Frameworks */,
8764
);
8865
runOnlyForDeploymentPostprocessing = 0;
8966
};
@@ -100,10 +77,11 @@
10077
3FE36B491AA902DD005D06FE = {
10178
isa = PBXGroup;
10279
children = (
103-
3FE36BB91AA91DCE005D06FE /* WebKitPlus.xcodeproj */,
80+
6DAEE79527A7CDA000FC7A97 /* Packages */,
10481
3FE36B541AA902DD005D06FE /* SimpleBrowser */,
10582
3FE36B6A1AA902DD005D06FE /* SimpleBrowserTests */,
10683
3FE36B531AA902DD005D06FE /* Products */,
84+
6DAEE79727A7CDE900FC7A97 /* Frameworks */,
10785
);
10886
sourceTree = "<group>";
10987
};
@@ -154,13 +132,19 @@
154132
name = "Supporting Files";
155133
sourceTree = "<group>";
156134
};
157-
3FE36BBA1AA91DCE005D06FE /* Products */ = {
135+
6DAEE79527A7CDA000FC7A97 /* Packages */ = {
158136
isa = PBXGroup;
159137
children = (
160-
3FE36BBF1AA91DCE005D06FE /* WebKitPlus.framework */,
161-
3FE36BC11AA91DCE005D06FE /* WebKitPlusTests.xctest */,
138+
6DAEE79627A7CDA000FC7A97 /* WebKitPlus */,
162139
);
163-
name = Products;
140+
name = Packages;
141+
sourceTree = "<group>";
142+
};
143+
6DAEE79727A7CDE900FC7A97 /* Frameworks */ = {
144+
isa = PBXGroup;
145+
children = (
146+
);
147+
name = Frameworks;
164148
sourceTree = "<group>";
165149
};
166150
/* End PBXGroup section */
@@ -178,9 +162,11 @@
178162
buildRules = (
179163
);
180164
dependencies = (
181-
3F33CD701AA9708900E56293 /* PBXTargetDependency */,
182165
);
183166
name = SimpleBrowser;
167+
packageProductDependencies = (
168+
6DAEE79827A7CDE900FC7A97 /* WebKitPlus */,
169+
);
184170
productName = SimpleBrowser;
185171
productReference = 3FE36B521AA902DD005D06FE /* SimpleBrowser.app */;
186172
productType = "com.apple.product-type.application";
@@ -236,12 +222,6 @@
236222
mainGroup = 3FE36B491AA902DD005D06FE;
237223
productRefGroup = 3FE36B531AA902DD005D06FE /* Products */;
238224
projectDirPath = "";
239-
projectReferences = (
240-
{
241-
ProductGroup = 3FE36BBA1AA91DCE005D06FE /* Products */;
242-
ProjectRef = 3FE36BB91AA91DCE005D06FE /* WebKitPlus.xcodeproj */;
243-
},
244-
);
245225
projectRoot = "";
246226
targets = (
247227
3FE36B511AA902DD005D06FE /* SimpleBrowser */,
@@ -250,23 +230,6 @@
250230
};
251231
/* End PBXProject section */
252232

253-
/* Begin PBXReferenceProxy section */
254-
3FE36BBF1AA91DCE005D06FE /* WebKitPlus.framework */ = {
255-
isa = PBXReferenceProxy;
256-
fileType = wrapper.framework;
257-
path = WebKitPlus.framework;
258-
remoteRef = 3FE36BBE1AA91DCE005D06FE /* PBXContainerItemProxy */;
259-
sourceTree = BUILT_PRODUCTS_DIR;
260-
};
261-
3FE36BC11AA91DCE005D06FE /* WebKitPlusTests.xctest */ = {
262-
isa = PBXReferenceProxy;
263-
fileType = wrapper.cfbundle;
264-
path = WebKitPlusTests.xctest;
265-
remoteRef = 3FE36BC01AA91DCE005D06FE /* PBXContainerItemProxy */;
266-
sourceTree = BUILT_PRODUCTS_DIR;
267-
};
268-
/* End PBXReferenceProxy section */
269-
270233
/* Begin PBXResourcesBuildPhase section */
271234
3FE36B501AA902DD005D06FE /* Resources */ = {
272235
isa = PBXResourcesBuildPhase;
@@ -308,11 +271,6 @@
308271
/* End PBXSourcesBuildPhase section */
309272

310273
/* Begin PBXTargetDependency section */
311-
3F33CD701AA9708900E56293 /* PBXTargetDependency */ = {
312-
isa = PBXTargetDependency;
313-
name = WebKitPlus;
314-
targetProxy = 3F33CD6F1AA9708900E56293 /* PBXContainerItemProxy */;
315-
};
316274
3FE36B691AA902DD005D06FE /* PBXTargetDependency */ = {
317275
isa = PBXTargetDependency;
318276
target = 3FE36B511AA902DD005D06FE /* SimpleBrowser */;
@@ -443,7 +401,8 @@
443401
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
444402
MTL_ENABLE_DEBUG_INFO = NO;
445403
SDKROOT = iphoneos;
446-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
404+
SWIFT_COMPILATION_MODE = wholemodule;
405+
SWIFT_OPTIMIZATION_LEVEL = "-O";
447406
SWIFT_VERSION = 5.0;
448407
VALIDATE_PRODUCT = YES;
449408
};
@@ -454,7 +413,10 @@
454413
buildSettings = {
455414
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
456415
INFOPLIST_FILE = SimpleBrowser/Info.plist;
457-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
416+
LD_RUNPATH_SEARCH_PATHS = (
417+
"$(inherited)",
418+
"@executable_path/Frameworks",
419+
);
458420
PRODUCT_BUNDLE_IDENTIFIER = "jp.yashigani.$(PRODUCT_NAME:rfc1034identifier)";
459421
PRODUCT_NAME = "$(TARGET_NAME)";
460422
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
@@ -468,7 +430,10 @@
468430
buildSettings = {
469431
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
470432
INFOPLIST_FILE = SimpleBrowser/Info.plist;
471-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
433+
LD_RUNPATH_SEARCH_PATHS = (
434+
"$(inherited)",
435+
"@executable_path/Frameworks",
436+
);
472437
PRODUCT_BUNDLE_IDENTIFIER = "jp.yashigani.$(PRODUCT_NAME:rfc1034identifier)";
473438
PRODUCT_NAME = "$(TARGET_NAME)";
474439
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
@@ -490,7 +455,11 @@
490455
"$(inherited)",
491456
);
492457
INFOPLIST_FILE = SimpleBrowserTests/Info.plist;
493-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
458+
LD_RUNPATH_SEARCH_PATHS = (
459+
"$(inherited)",
460+
"@executable_path/Frameworks",
461+
"@loader_path/Frameworks",
462+
);
494463
PRODUCT_BUNDLE_IDENTIFIER = "jp.yashigani.$(PRODUCT_NAME:rfc1034identifier)";
495464
PRODUCT_NAME = "$(TARGET_NAME)";
496465
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
@@ -508,7 +477,11 @@
508477
"$(inherited)",
509478
);
510479
INFOPLIST_FILE = SimpleBrowserTests/Info.plist;
511-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
480+
LD_RUNPATH_SEARCH_PATHS = (
481+
"$(inherited)",
482+
"@executable_path/Frameworks",
483+
"@loader_path/Frameworks",
484+
);
512485
PRODUCT_BUNDLE_IDENTIFIER = "jp.yashigani.$(PRODUCT_NAME:rfc1034identifier)";
513486
PRODUCT_NAME = "$(TARGET_NAME)";
514487
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
@@ -548,6 +521,13 @@
548521
defaultConfigurationName = Release;
549522
};
550523
/* End XCConfigurationList section */
524+
525+
/* Begin XCSwiftPackageProductDependency section */
526+
6DAEE79827A7CDE900FC7A97 /* WebKitPlus */ = {
527+
isa = XCSwiftPackageProductDependency;
528+
productName = WebKitPlus;
529+
};
530+
/* End XCSwiftPackageProductDependency section */
551531
};
552532
rootObject = 3FE36B4A1AA902DD005D06FE /* Project object */;
553533
}

Package.swift

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// swift-tools-version:5.5
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "WebKitPlus",
8+
defaultLocalization: "en",
9+
platforms: [
10+
.iOS(.v12),
11+
],
12+
products: [
13+
// Products define the executables and libraries a package produces, and make them visible to other packages.
14+
.library(
15+
name: "WebKitPlus",
16+
targets: ["WebKitPlus"]),
17+
],
18+
dependencies: [
19+
// Dependencies declare other packages that this package depends on.
20+
// .package(url: /* package url */, from: "1.0.0"),
21+
],
22+
targets: [
23+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
24+
// Targets can depend on other targets in this package, and on products in packages this package depends on.
25+
.target(
26+
name: "WebKitPlus",
27+
dependencies: []),
28+
.testTarget(
29+
name: "WebKitPlusTests",
30+
dependencies: ["WebKitPlus"]),
31+
]
32+
)
File renamed without changes.

WebKitPlus/WKUIDelegatePlus.swift renamed to Sources/WebKitPlus/WKUIDelegatePlus.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class WKUIDelegatePlus: NSObject {
1111
vc?.present(alert, animated: true, completion: nil)
1212
}
1313
}
14-
14+
1515
}
1616

1717
extension WKUIDelegatePlus: WKUIDelegate {
File renamed without changes.
File renamed without changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import XCTest
2+
@testable import WebKitPlus
3+
4+
final class WebKitPlusTests: XCTestCase {
5+
func testExample() throws {
6+
XCTAssert(true, "Pass")
7+
}
8+
}

0 commit comments

Comments
 (0)