Skip to content

Commit ee7012c

Browse files
authored
Merge pull request #231 from mac-cain13/feature/swift-2.3
Feature/swift 2.3
2 parents d49c00d + 210a026 commit ee7012c

File tree

12 files changed

+59
-22
lines changed

12 files changed

+59
-22
lines changed

Podfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
use_frameworks!
22

33
workspace 'R.swift'
4-
xcodeproj 'ResourceApp/ResourceApp'
4+
project 'ResourceApp/ResourceApp'
55

66
target 'ResourceApp' do
77

88
pod 'R.swift.Library', :path => './R.swift.Library'
99

1010
end
11+
12+
post_install do |installer|
13+
installer.pods_project.targets.each do |target|
14+
target.build_configurations.each do |config|
15+
config.build_settings['SWIFT_VERSION'] = '2.3'
16+
end
17+
end
18+
end

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ EXTERNAL SOURCES:
1111
SPEC CHECKSUMS:
1212
R.swift.Library: e5e077ed04f6867a95676af491650091b23518e9
1313

14-
PODFILE CHECKSUM: 9b36d458fc7d86e4195dd7d7a184ba971f24e516
14+
PODFILE CHECKSUM: 697c63af0dc7653faabb61448736a02bcb692198
1515

16-
COCOAPODS: 1.0.0
16+
COCOAPODS: 1.0.1

R.swift.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,11 @@
380380
TargetAttributes = {
381381
D5C4227C1B711FDF004EA9B9 = {
382382
CreatedOnToolsVersion = 7.0;
383+
LastSwiftMigration = 0800;
383384
};
384385
D5EA0DF31A3DF45600FFEBC4 = {
385386
CreatedOnToolsVersion = 6.1.1;
387+
LastSwiftMigration = 0800;
386388
};
387389
};
388390
};
@@ -562,6 +564,7 @@
562564
PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.rswiftTests;
563565
PRODUCT_NAME = "$(TARGET_NAME)";
564566
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
567+
SWIFT_VERSION = 2.3;
565568
};
566569
name = Debug;
567570
};
@@ -576,6 +579,7 @@
576579
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
577580
PRODUCT_BUNDLE_IDENTIFIER = nl.mathijskadijk.rswiftTests;
578581
PRODUCT_NAME = "$(TARGET_NAME)";
582+
SWIFT_VERSION = 2.3;
579583
};
580584
name = Release;
581585
};
@@ -659,13 +663,15 @@
659663
isa = XCBuildConfiguration;
660664
buildSettings = {
661665
PRODUCT_NAME = "$(TARGET_NAME)";
666+
SWIFT_VERSION = 2.3;
662667
};
663668
name = Debug;
664669
};
665670
D5EA0DFD1A3DF45600FFEBC4 /* Release */ = {
666671
isa = XCBuildConfiguration;
667672
buildSettings = {
668673
PRODUCT_NAME = "$(TARGET_NAME)";
674+
SWIFT_VERSION = 2.3;
669675
};
670676
name = Release;
671677
};

R.swift.xcodeproj/xcshareddata/xcschemes/rswift.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0700"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "NO"

R.swift/ResourceTypes/Font.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ struct Font: WhiteListedExtensionsResourceType {
1616
init(url: NSURL) throws {
1717
try Font.throwIfUnsupportedExtension(url.pathExtension)
1818

19-
let dataProvider = CGDataProviderCreateWithURL(url)
19+
guard let dataProvider = CGDataProviderCreateWithURL(url) else {
20+
throw ResourceParsingError.ParsingFailed("Unable to create data provider for font at \(url)")
21+
}
2022
let font = CGFontCreateWithDataProvider(dataProvider)
2123

2224
guard let postScriptName = CGFontCopyPostScriptName(font) else {

R.swift/input.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ struct CallInformation {
142142
let outputURL = NSURL(fileURLWithPath: outputPath)
143143

144144
var resourceValue: AnyObject?
145-
try! outputURL.getResourceValue(&resourceValue, forKey: NSURLIsDirectoryKey)
145+
try outputURL.getResourceValue(&resourceValue, forKey: NSURLIsDirectoryKey)
146146
if let isDirectory = (resourceValue as? NSNumber)?.boolValue where isDirectory {
147-
self.outputURL = outputURL.URLByAppendingPathComponent(ResourceFilename, isDirectory: false)
147+
self.outputURL = outputURL.URLByAppendingPathComponent(ResourceFilename, isDirectory: false)!
148148
} else {
149149
self.outputURL = outputURL
150150
}
@@ -203,7 +203,7 @@ private func getFirstArgumentFromOptionData(options: [Option:[String]], helpStri
203203
}
204204
}
205205

206-
func pathResolverWithSourceTreeFolderToURLConverter(URLForSourceTreeFolder: SourceTreeFolder -> NSURL) -> (path: Path) -> NSURL {
206+
func pathResolverWithSourceTreeFolderToURLConverter(URLForSourceTreeFolder: SourceTreeFolder -> NSURL) -> (path: Path) -> NSURL? {
207207
return { path in
208208
switch path {
209209
case let .Absolute(absolutePath):

R.swift/main.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ do {
2424
let xcodeproj = try Xcodeproj(url: callInformation.xcodeprojURL)
2525
let resourceURLs = try xcodeproj.resourcePathsForTarget(callInformation.targetName)
2626
.map(pathResolverWithSourceTreeFolderToURLConverter(callInformation.URLForSourceTreeFolder))
27+
.flatMap { $0 }
2728

2829
let resources = Resources(resourceURLs: resourceURLs, fileManager: NSFileManager.defaultManager())
2930

ResourceApp/ResourceApp.xcodeproj/project.pbxproj

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,13 @@
448448
isa = PBXNativeTarget;
449449
buildConfigurationList = D55C6CD91B5D757300301B0D /* Build configuration list for PBXNativeTarget "ResourceApp" */;
450450
buildPhases = (
451-
978E4B8123C372F370555011 /* 📦 Check Pods Manifest.lock */,
451+
978E4B8123C372F370555011 /* [CP] Check Pods Manifest.lock */,
452452
D55C6CED1B5E172900301B0D /* R.swift */,
453453
D55C6CB41B5D757300301B0D /* Sources */,
454454
D55C6CB51B5D757300301B0D /* Frameworks */,
455455
D55C6CB61B5D757300301B0D /* Resources */,
456-
89BF8D4EC08D38DB6564C369 /* 📦 Embed Pods Frameworks */,
457-
ADB91CF666C6624CD5A00F13 /* 📦 Copy Pods Resources */,
456+
89BF8D4EC08D38DB6564C369 /* [CP] Embed Pods Frameworks */,
457+
ADB91CF666C6624CD5A00F13 /* [CP] Copy Pods Resources */,
458458
);
459459
buildRules = (
460460
);
@@ -527,21 +527,25 @@
527527
attributes = {
528528
LastSwiftMigration = 0700;
529529
LastSwiftUpdateCheck = 0730;
530-
LastUpgradeCheck = 0700;
530+
LastUpgradeCheck = 0800;
531531
ORGANIZATIONNAME = "Mathijs Kadijk";
532532
TargetAttributes = {
533533
D55C6CB71B5D757300301B0D = {
534534
CreatedOnToolsVersion = 6.4;
535+
LastSwiftMigration = 0800;
535536
};
536537
D55C6CCE1B5D757300301B0D = {
537538
CreatedOnToolsVersion = 6.4;
539+
LastSwiftMigration = 0800;
538540
TestTargetID = D55C6CB71B5D757300301B0D;
539541
};
540542
DEF559961CA4873D009B8C51 = {
541543
CreatedOnToolsVersion = 7.3;
544+
LastSwiftMigration = 0800;
542545
};
543546
DEF559AA1CA48892009B8C51 = {
544547
CreatedOnToolsVersion = 7.3;
548+
LastSwiftMigration = 0800;
545549
TestTargetID = DEF559961CA4873D009B8C51;
546550
};
547551
};
@@ -655,44 +659,44 @@
655659
/* End PBXResourcesBuildPhase section */
656660

657661
/* Begin PBXShellScriptBuildPhase section */
658-
89BF8D4EC08D38DB6564C369 /* 📦 Embed Pods Frameworks */ = {
662+
89BF8D4EC08D38DB6564C369 /* [CP] Embed Pods Frameworks */ = {
659663
isa = PBXShellScriptBuildPhase;
660664
buildActionMask = 2147483647;
661665
files = (
662666
);
663667
inputPaths = (
664668
);
665-
name = "📦 Embed Pods Frameworks";
669+
name = "[CP] Embed Pods Frameworks";
666670
outputPaths = (
667671
);
668672
runOnlyForDeploymentPostprocessing = 0;
669673
shellPath = /bin/sh;
670674
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-ResourceApp/Pods-ResourceApp-frameworks.sh\"\n";
671675
showEnvVarsInLog = 0;
672676
};
673-
978E4B8123C372F370555011 /* 📦 Check Pods Manifest.lock */ = {
677+
978E4B8123C372F370555011 /* [CP] Check Pods Manifest.lock */ = {
674678
isa = PBXShellScriptBuildPhase;
675679
buildActionMask = 2147483647;
676680
files = (
677681
);
678682
inputPaths = (
679683
);
680-
name = "📦 Check Pods Manifest.lock";
684+
name = "[CP] Check Pods Manifest.lock";
681685
outputPaths = (
682686
);
683687
runOnlyForDeploymentPostprocessing = 0;
684688
shellPath = /bin/sh;
685689
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
686690
showEnvVarsInLog = 0;
687691
};
688-
ADB91CF666C6624CD5A00F13 /* 📦 Copy Pods Resources */ = {
692+
ADB91CF666C6624CD5A00F13 /* [CP] Copy Pods Resources */ = {
689693
isa = PBXShellScriptBuildPhase;
690694
buildActionMask = 2147483647;
691695
files = (
692696
);
693697
inputPaths = (
694698
);
695-
name = "📦 Copy Pods Resources";
699+
name = "[CP] Copy Pods Resources";
696700
outputPaths = (
697701
);
698702
runOnlyForDeploymentPostprocessing = 0;
@@ -859,6 +863,7 @@
859863
isa = XCBuildConfiguration;
860864
buildSettings = {
861865
ALWAYS_SEARCH_USER_PATHS = NO;
866+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
862867
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
863868
CLANG_CXX_LIBRARY = "libc++";
864869
CLANG_ENABLE_MODULES = YES;
@@ -906,6 +911,7 @@
906911
isa = XCBuildConfiguration;
907912
buildSettings = {
908913
ALWAYS_SEARCH_USER_PATHS = NO;
914+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
909915
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
910916
CLANG_CXX_LIBRARY = "libc++";
911917
CLANG_ENABLE_MODULES = YES;
@@ -945,25 +951,30 @@
945951
isa = XCBuildConfiguration;
946952
baseConfigurationReference = 277C3D45ECA1EEF6F7DAF957 /* Pods-ResourceApp.debug.xcconfig */;
947953
buildSettings = {
954+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
948955
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
949956
INFOPLIST_FILE = ResourceApp/Info.plist;
950957
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
951958
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
952959
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
953960
PRODUCT_NAME = "$(TARGET_NAME)";
961+
SWIFT_VERSION = 2.3;
954962
};
955963
name = Debug;
956964
};
957965
D55C6CDB1B5D757300301B0D /* Release */ = {
958966
isa = XCBuildConfiguration;
959967
baseConfigurationReference = 9BB33190FE04C23E506646C2 /* Pods-ResourceApp.release.xcconfig */;
960968
buildSettings = {
969+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
961970
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
962971
INFOPLIST_FILE = ResourceApp/Info.plist;
963972
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
964973
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
965974
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
966975
PRODUCT_NAME = "$(TARGET_NAME)";
976+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
977+
SWIFT_VERSION = 2.3;
967978
};
968979
name = Release;
969980
};
@@ -980,6 +991,7 @@
980991
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
981992
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
982993
PRODUCT_NAME = "$(TARGET_NAME)";
994+
SWIFT_VERSION = 2.3;
983995
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ResourceApp.app/ResourceApp";
984996
};
985997
name = Debug;
@@ -993,6 +1005,8 @@
9931005
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
9941006
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.$(PRODUCT_NAME:rfc1034identifier)";
9951007
PRODUCT_NAME = "$(TARGET_NAME)";
1008+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1009+
SWIFT_VERSION = 2.3;
9961010
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ResourceApp.app/ResourceApp";
9971011
};
9981012
name = Release;
@@ -1008,6 +1022,7 @@
10081022
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.ResourceApp-tvOS";
10091023
PRODUCT_NAME = "$(TARGET_NAME)";
10101024
SDKROOT = appletvos;
1025+
SWIFT_VERSION = 2.3;
10111026
TARGETED_DEVICE_FAMILY = 3;
10121027
};
10131028
name = Debug;
@@ -1022,6 +1037,8 @@
10221037
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.ResourceApp-tvOS";
10231038
PRODUCT_NAME = "$(TARGET_NAME)";
10241039
SDKROOT = appletvos;
1040+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1041+
SWIFT_VERSION = 2.3;
10251042
TARGETED_DEVICE_FAMILY = 3;
10261043
};
10271044
name = Release;
@@ -1037,6 +1054,7 @@
10371054
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.ResourceAppTests-tvOS";
10381055
PRODUCT_NAME = "$(TARGET_NAME)";
10391056
SDKROOT = appletvos;
1057+
SWIFT_VERSION = 2.3;
10401058
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ResourceApp-tvOS.app/ResourceApp-tvOS";
10411059
};
10421060
name = Debug;
@@ -1051,6 +1069,8 @@
10511069
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.ResourceAppTests-tvOS";
10521070
PRODUCT_NAME = "$(TARGET_NAME)";
10531071
SDKROOT = appletvos;
1072+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1073+
SWIFT_VERSION = 2.3;
10541074
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ResourceApp-tvOS.app/ResourceApp-tvOS";
10551075
};
10561076
name = Release;

ResourceApp/ResourceApp.xcodeproj/xcshareddata/xcschemes/ResourceApp-tvOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0730"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "NO"

0 commit comments

Comments
 (0)