Skip to content

Commit a131e8a

Browse files
committed
Convert into a Universal Framework
1 parent a02aa9c commit a131e8a

File tree

7 files changed

+87
-18
lines changed

7 files changed

+87
-18
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
language: objective-c
2-
osx_image: xcode61
32
before_install:
43
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
54
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
65
script:
7-
- xcodebuild -project QueryKit.xcodeproj -scheme QueryKit test | xcpretty -c; exit ${PIPESTATUS[0]}
6+
- set -o pipefail
7+
- xcodebuild -project QueryKit.xcodeproj -scheme QueryKit test -sdk macosx | xcpretty -c
8+
- xcodebuild -project QueryKit.xcodeproj -scheme QueryKit test -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c
89
- pod lib lint QueryKit.podspec
910

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// UniversalFramework_Base.xcconfig
3+
// QueryKit
4+
//
5+
// Created by Marius Rackwitz on 29/11/14.
6+
// Copyright (c) 2014 Marius Rackwitz. All rights reserved.
7+
//
8+
9+
// Make it universal
10+
SUPPORTED_PLATFORMS = iphonesimulator iphoneos macosx
11+
VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s
12+
VALID_ARCHS[sdk=iphonesimulator*] = arm64 armv7 armv7s
13+
VALID_ARCHS[sdk=macosx*] = i386 x86_64
14+
15+
// Dynamic linking uses different default copy paths
16+
LD_RUNPATH_SEARCH_PATHS[sdk=iphoneos*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
17+
LD_RUNPATH_SEARCH_PATHS[sdk=iphonesimulator*] = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
18+
LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// UniversalFramework_Framework.xcconfig
3+
// QueryKit
4+
//
5+
// Created by Marius Rackwitz on 29/11/14.
6+
// Copyright (c) 2014 Marius Rackwitz. All rights reserved.
7+
//
8+
9+
#include "UniversalFramework_Base.xcconfig"
10+
11+
// iOS-specific default settings
12+
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer
13+
TARGETED_DEVICE_FAMILY[sdk=iphonesimulator*] = 1,2
14+
TARGETED_DEVICE_FAMILY[sdk=iphone*] = 1,2
15+
16+
// OSX-specific default settings
17+
FRAMEWORK_VERSION[sdk=macosx*] = A
18+
COMBINE_HIDPI_IMAGES[sdk=macosx*] = YES
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// UniversalFramework_Test.xcconfig
3+
// QueryKit
4+
//
5+
// Created by Marius Rackwitz on 29/11/14.
6+
// Copyright (c) 2014 Marius Rackwitz. All rights reserved.
7+
//
8+
9+
#include "UniversalFramework_Base.xcconfig"
10+
11+
FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*] = $(inherited) '$(SDKROOT)/Developer/Library/Frameworks'
12+
FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*] = $(inherited) '$(SDKROOT)/Developer/Library/Frameworks'
13+
FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(inherited) '$(DEVELOPER_FRAMEWORKS_DIR)'
14+
15+
// Yep.
16+
LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = $(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks'

QueryKit.xcodeproj/project.pbxproj

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
279294E81A4B4C60009C52E1 /* UniversalFramework_Base.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 279294E51A4B4C60009C52E1 /* UniversalFramework_Base.xcconfig */; };
11+
279294E91A4B4C60009C52E1 /* UniversalFramework_Framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 279294E61A4B4C60009C52E1 /* UniversalFramework_Framework.xcconfig */; };
12+
279294EA1A4B4C60009C52E1 /* UniversalFramework_Test.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 279294E71A4B4C60009C52E1 /* UniversalFramework_Test.xcconfig */; };
1013
77007D7D19A95CDE007DC2BC /* QKQuerySetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77007D7C19A95CDE007DC2BC /* QKQuerySetTests.swift */; };
1114
77007D8119A95CE9007DC2BC /* QKQuerySet.h in Headers */ = {isa = PBXBuildFile; fileRef = 77007D7E19A95CE9007DC2BC /* QKQuerySet.h */; settings = {ATTRIBUTES = (Public, ); }; };
1215
77007D8219A95CE9007DC2BC /* QKQuerySet.m in Sources */ = {isa = PBXBuildFile; fileRef = 77007D7F19A95CE9007DC2BC /* QKQuerySet.m */; };
@@ -62,6 +65,9 @@
6265
/* End PBXContainerItemProxy section */
6366

6467
/* Begin PBXFileReference section */
68+
279294E51A4B4C60009C52E1 /* UniversalFramework_Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = UniversalFramework_Base.xcconfig; sourceTree = "<group>"; };
69+
279294E61A4B4C60009C52E1 /* UniversalFramework_Framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = UniversalFramework_Framework.xcconfig; sourceTree = "<group>"; };
70+
279294E71A4B4C60009C52E1 /* UniversalFramework_Test.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = UniversalFramework_Test.xcconfig; sourceTree = "<group>"; };
6571
77007D7C19A95CDE007DC2BC /* QKQuerySetTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QKQuerySetTests.swift; sourceTree = "<group>"; };
6672
77007D7E19A95CE9007DC2BC /* QKQuerySet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QKQuerySet.h; sourceTree = "<group>"; };
6773
77007D7F19A95CE9007DC2BC /* QKQuerySet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QKQuerySet.m; sourceTree = "<group>"; };
@@ -108,11 +114,22 @@
108114
/* End PBXFrameworksBuildPhase section */
109115

110116
/* Begin PBXGroup section */
117+
279294E41A4B4C60009C52E1 /* Configurations */ = {
118+
isa = PBXGroup;
119+
children = (
120+
279294E51A4B4C60009C52E1 /* UniversalFramework_Base.xcconfig */,
121+
279294E61A4B4C60009C52E1 /* UniversalFramework_Framework.xcconfig */,
122+
279294E71A4B4C60009C52E1 /* UniversalFramework_Test.xcconfig */,
123+
);
124+
path = Configurations;
125+
sourceTree = "<group>";
126+
};
111127
77A9B66D1953742F0016654E = {
112128
isa = PBXGroup;
113129
children = (
114130
77A9B67B195374490016654E /* QueryKit */,
115131
77A9B688195374490016654E /* QueryKitTests */,
132+
279294E41A4B4C60009C52E1 /* Configurations */,
116133
77A9B67A195374490016654E /* Products */,
117134
);
118135
sourceTree = "<group>";
@@ -290,6 +307,9 @@
290307
isa = PBXResourcesBuildPhase;
291308
buildActionMask = 2147483647;
292309
files = (
310+
279294EA1A4B4C60009C52E1 /* UniversalFramework_Test.xcconfig in Resources */,
311+
279294E91A4B4C60009C52E1 /* UniversalFramework_Framework.xcconfig in Resources */,
312+
279294E81A4B4C60009C52E1 /* UniversalFramework_Base.xcconfig in Resources */,
293313
);
294314
runOnlyForDeploymentPostprocessing = 0;
295315
};
@@ -376,6 +396,7 @@
376396
};
377397
77A9B68E195374490016654E /* Debug */ = {
378398
isa = XCBuildConfiguration;
399+
baseConfigurationReference = 279294E71A4B4C60009C52E1 /* UniversalFramework_Test.xcconfig */;
379400
buildSettings = {
380401
ALWAYS_SEARCH_USER_PATHS = NO;
381402
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -416,7 +437,6 @@
416437
GCC_WARN_UNUSED_VARIABLE = YES;
417438
INFOPLIST_FILE = QueryKit/Info.plist;
418439
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
419-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
420440
MACOSX_DEPLOYMENT_TARGET = 10.9;
421441
METAL_ENABLE_DEBUG_INFO = YES;
422442
ONLY_ACTIVE_ARCH = YES;
@@ -431,6 +451,7 @@
431451
};
432452
77A9B68F195374490016654E /* Release */ = {
433453
isa = XCBuildConfiguration;
454+
baseConfigurationReference = 279294E61A4B4C60009C52E1 /* UniversalFramework_Framework.xcconfig */;
434455
buildSettings = {
435456
ALWAYS_SEARCH_USER_PATHS = NO;
436457
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -466,7 +487,6 @@
466487
GCC_WARN_UNUSED_VARIABLE = YES;
467488
INFOPLIST_FILE = QueryKit/Info.plist;
468489
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
469-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
470490
MACOSX_DEPLOYMENT_TARGET = 10.9;
471491
METAL_ENABLE_DEBUG_INFO = NO;
472492
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -479,6 +499,7 @@
479499
};
480500
77A9B691195374490016654E /* Debug */ = {
481501
isa = XCBuildConfiguration;
502+
baseConfigurationReference = 279294E71A4B4C60009C52E1 /* UniversalFramework_Test.xcconfig */;
482503
buildSettings = {
483504
ALWAYS_SEARCH_USER_PATHS = NO;
484505
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -497,10 +518,6 @@
497518
COMBINE_HIDPI_IMAGES = YES;
498519
COPY_PHASE_STRIP = NO;
499520
ENABLE_STRICT_OBJC_MSGSEND = YES;
500-
FRAMEWORK_SEARCH_PATHS = (
501-
"$(DEVELOPER_FRAMEWORKS_DIR)",
502-
"$(inherited)",
503-
);
504521
GCC_C_LANGUAGE_STANDARD = gnu99;
505522
GCC_DYNAMIC_NO_PIC = NO;
506523
GCC_OPTIMIZATION_LEVEL = 0;
@@ -516,7 +533,6 @@
516533
GCC_WARN_UNUSED_FUNCTION = YES;
517534
GCC_WARN_UNUSED_VARIABLE = YES;
518535
INFOPLIST_FILE = QueryKitTests/Info.plist;
519-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
520536
MACOSX_DEPLOYMENT_TARGET = 10.10;
521537
METAL_ENABLE_DEBUG_INFO = YES;
522538
ONLY_ACTIVE_ARCH = YES;
@@ -529,6 +545,7 @@
529545
};
530546
77A9B692195374490016654E /* Release */ = {
531547
isa = XCBuildConfiguration;
548+
baseConfigurationReference = 279294E61A4B4C60009C52E1 /* UniversalFramework_Framework.xcconfig */;
532549
buildSettings = {
533550
ALWAYS_SEARCH_USER_PATHS = NO;
534551
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -549,10 +566,6 @@
549566
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
550567
ENABLE_NS_ASSERTIONS = NO;
551568
ENABLE_STRICT_OBJC_MSGSEND = YES;
552-
FRAMEWORK_SEARCH_PATHS = (
553-
"$(DEVELOPER_FRAMEWORKS_DIR)",
554-
"$(inherited)",
555-
);
556569
GCC_C_LANGUAGE_STANDARD = gnu99;
557570
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
558571
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@@ -561,7 +574,6 @@
561574
GCC_WARN_UNUSED_FUNCTION = YES;
562575
GCC_WARN_UNUSED_VARIABLE = YES;
563576
INFOPLIST_FILE = QueryKitTests/Info.plist;
564-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
565577
MACOSX_DEPLOYMENT_TARGET = 10.10;
566578
METAL_ENABLE_DEBUG_INFO = NO;
567579
PRODUCT_NAME = "$(TARGET_NAME)";

QueryKitTests/QueryKitTests.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@ import QueryKit
1111

1212
@objc(Person) class Person : NSManagedObject {
1313
@NSManaged var name:String
14+
15+
class var entityName:String {
16+
return "Person"
17+
}
1418
}
1519

1620
extension Person {
1721
class func create(context:NSManagedObjectContext) -> Person {
18-
return NSEntityDescription.insertNewObjectForEntityForName(Person.className(), inManagedObjectContext: context) as Person
22+
return NSEntityDescription.insertNewObjectForEntityForName(Person.entityName, inManagedObjectContext: context) as Person
1923
}
2024
}
2125

2226
func managedObjectModel() -> NSManagedObjectModel {
2327
let personEntity = NSEntityDescription()
24-
personEntity.name = Person.className()
25-
personEntity.managedObjectClassName = Person.className()
28+
personEntity.name = Person.entityName
29+
personEntity.managedObjectClassName = "Person"
2630

2731
let personNameAttribute = NSAttributeDescription()
2832
personNameAttribute.name = "name"

QueryKitTests/QuerySetTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class QuerySetTests: XCTestCase {
106106

107107
let fetchRequest = qs.fetchRequest
108108

109-
XCTAssertEqual(fetchRequest.entityName!, Person.className())
109+
XCTAssertEqual(fetchRequest.entityName!, "Person")
110110
XCTAssertEqual(fetchRequest.predicate!, predicate)
111111
// XCTAssertEqual(fetchRequest.sortDescriptors!, [sortDescriptor])
112112
XCTAssertEqual(fetchRequest.fetchOffset, 2)

0 commit comments

Comments
 (0)