Skip to content

Commit 14ae975

Browse files
committed
swift 4.2
1 parent 1c052b8 commit 14ae975

File tree

3 files changed

+5
-173
lines changed

3 files changed

+5
-173
lines changed

JSONSchema.xcodeproj/project.pbxproj

Lines changed: 3 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -8,54 +8,10 @@
88

99
/* Begin PBXBuildFile section */
1010
27B640C71AAB0EDC005C8641 /* JSONSchema.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B640C61AAB0EDC005C8641 /* JSONSchema.swift */; };
11-
27B640CD1AAB12CB005C8641 /* JSONSchemaCases.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B640CC1AAB12CB005C8641 /* JSONSchemaCases.swift */; };
12-
27B641281AAB13A8005C8641 /* additionalItems.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640ED1AAB13A8005C8641 /* additionalItems.json */; };
13-
27B641291AAB13A8005C8641 /* additionalProperties.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640EE1AAB13A8005C8641 /* additionalProperties.json */; };
14-
27B6412A1AAB13A8005C8641 /* allOf.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640EF1AAB13A8005C8641 /* allOf.json */; };
15-
27B6412B1AAB13A8005C8641 /* anyOf.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640F01AAB13A8005C8641 /* anyOf.json */; };
16-
27B6412C1AAB13A8005C8641 /* default.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640F11AAB13A8005C8641 /* default.json */; };
17-
27B6412D1AAB13A8005C8641 /* definitions.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640F21AAB13A8005C8641 /* definitions.json */; };
18-
27B6412E1AAB13A8005C8641 /* dependencies.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640F31AAB13A8005C8641 /* dependencies.json */; };
19-
27B6412F1AAB13A8005C8641 /* enum.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640F41AAB13A8005C8641 /* enum.json */; };
20-
27B641301AAB13A8005C8641 /* items.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640F51AAB13A8005C8641 /* items.json */; };
21-
27B641311AAB13A8005C8641 /* maximum.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640F61AAB13A8005C8641 /* maximum.json */; };
22-
27B641321AAB13A8005C8641 /* maxItems.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640F71AAB13A8005C8641 /* maxItems.json */; };
23-
27B641331AAB13A8005C8641 /* maxLength.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640F81AAB13A8005C8641 /* maxLength.json */; };
24-
27B641341AAB13A8005C8641 /* maxProperties.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640F91AAB13A8005C8641 /* maxProperties.json */; };
25-
27B641351AAB13A8005C8641 /* minimum.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640FA1AAB13A8005C8641 /* minimum.json */; };
26-
27B641361AAB13A8005C8641 /* minItems.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640FB1AAB13A8005C8641 /* minItems.json */; };
27-
27B641371AAB13A8005C8641 /* minLength.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640FC1AAB13A8005C8641 /* minLength.json */; };
28-
27B641381AAB13A8005C8641 /* minProperties.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640FD1AAB13A8005C8641 /* minProperties.json */; };
29-
27B641391AAB13A8005C8641 /* multipleOf.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640FE1AAB13A8005C8641 /* multipleOf.json */; };
30-
27B6413A1AAB13A8005C8641 /* not.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B640FF1AAB13A8005C8641 /* not.json */; };
31-
27B6413B1AAB13A8005C8641 /* oneOf.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B641001AAB13A8005C8641 /* oneOf.json */; };
32-
27B6413C1AAB13A8005C8641 /* bignum.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B641021AAB13A8005C8641 /* bignum.json */; };
33-
27B6413D1AAB13A8005C8641 /* format.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B641031AAB13A8005C8641 /* format.json */; };
34-
27B6413E1AAB13A8005C8641 /* zeroTerminatedFloats.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B641041AAB13A8005C8641 /* zeroTerminatedFloats.json */; };
35-
27B6413F1AAB13A8005C8641 /* pattern.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B641051AAB13A8005C8641 /* pattern.json */; };
36-
27B641401AAB13A8005C8641 /* patternProperties.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B641061AAB13A8005C8641 /* patternProperties.json */; };
37-
27B641411AAB13A8005C8641 /* properties.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B641071AAB13A8005C8641 /* properties.json */; };
38-
27B641421AAB13A8005C8641 /* ref.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B641081AAB13A8005C8641 /* ref.json */; };
39-
27B641431AAB13A8005C8641 /* refRemote.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B641091AAB13A8005C8641 /* refRemote.json */; };
40-
27B641441AAB13A8005C8641 /* required.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B6410A1AAB13A8005C8641 /* required.json */; };
41-
27B641451AAB13A8005C8641 /* type.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B6410B1AAB13A8005C8641 /* type.json */; };
42-
27B641461AAB13A8005C8641 /* uniqueItems.json in Resources */ = {isa = PBXBuildFile; fileRef = 27B6410C1AAB13A8005C8641 /* uniqueItems.json */; };
4311
27B641481AAB3CEB005C8641 /* Validators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B641471AAB3CEB005C8641 /* Validators.swift */; };
4412
27CF7EEF1A9B9EDA0063FDE4 /* JSONSchema.h in Headers */ = {isa = PBXBuildFile; fileRef = 27CF7EEE1A9B9EDA0063FDE4 /* JSONSchema.h */; settings = {ATTRIBUTES = (Public, ); }; };
45-
27CF7EF51A9B9EDA0063FDE4 /* JSONSchema.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27CF7EE91A9B9EDA0063FDE4 /* JSONSchema.framework */; };
46-
27CF7EFC1A9B9EDA0063FDE4 /* JSONSchemaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27CF7EFB1A9B9EDA0063FDE4 /* JSONSchemaTests.swift */; };
4713
/* End PBXBuildFile section */
4814

49-
/* Begin PBXContainerItemProxy section */
50-
27CF7EF61A9B9EDA0063FDE4 /* PBXContainerItemProxy */ = {
51-
isa = PBXContainerItemProxy;
52-
containerPortal = 27CF7EE01A9B9EDA0063FDE4 /* Project object */;
53-
proxyType = 1;
54-
remoteGlobalIDString = 27CF7EE81A9B9EDA0063FDE4;
55-
remoteInfo = JSONSchema;
56-
};
57-
/* End PBXContainerItemProxy section */
58-
5915
/* Begin PBXFileReference section */
6016
27B640C61AAB0EDC005C8641 /* JSONSchema.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONSchema.swift; sourceTree = "<group>"; };
6117
27B640C91AAB1080005C8641 /* UniversalFramework_Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = UniversalFramework_Base.xcconfig; sourceTree = "<group>"; };
@@ -97,7 +53,6 @@
9753
27CF7EE91A9B9EDA0063FDE4 /* JSONSchema.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JSONSchema.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9854
27CF7EED1A9B9EDA0063FDE4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9955
27CF7EEE1A9B9EDA0063FDE4 /* JSONSchema.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSONSchema.h; sourceTree = "<group>"; };
100-
27CF7EF41A9B9EDA0063FDE4 /* JSONSchemaTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JSONSchemaTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
10156
27CF7EFA1A9B9EDA0063FDE4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
10257
27CF7EFB1A9B9EDA0063FDE4 /* JSONSchemaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONSchemaTests.swift; sourceTree = "<group>"; };
10358
/* End PBXFileReference section */
@@ -110,14 +65,6 @@
11065
);
11166
runOnlyForDeploymentPostprocessing = 0;
11267
};
113-
27CF7EF11A9B9EDA0063FDE4 /* Frameworks */ = {
114-
isa = PBXFrameworksBuildPhase;
115-
buildActionMask = 2147483647;
116-
files = (
117-
27CF7EF51A9B9EDA0063FDE4 /* JSONSchema.framework in Frameworks */,
118-
);
119-
runOnlyForDeploymentPostprocessing = 0;
120-
};
12168
/* End PBXFrameworksBuildPhase section */
12269

12370
/* Begin PBXGroup section */
@@ -202,7 +149,6 @@
202149
isa = PBXGroup;
203150
children = (
204151
27CF7EE91A9B9EDA0063FDE4 /* JSONSchema.framework */,
205-
27CF7EF41A9B9EDA0063FDE4 /* JSONSchemaTests.xctest */,
206152
);
207153
name = Products;
208154
sourceTree = "<group>";
@@ -279,24 +225,6 @@
279225
productReference = 27CF7EE91A9B9EDA0063FDE4 /* JSONSchema.framework */;
280226
productType = "com.apple.product-type.framework";
281227
};
282-
27CF7EF31A9B9EDA0063FDE4 /* JSONSchemaTests */ = {
283-
isa = PBXNativeTarget;
284-
buildConfigurationList = 27CF7F021A9B9EDA0063FDE4 /* Build configuration list for PBXNativeTarget "JSONSchemaTests" */;
285-
buildPhases = (
286-
27CF7EF01A9B9EDA0063FDE4 /* Sources */,
287-
27CF7EF11A9B9EDA0063FDE4 /* Frameworks */,
288-
27CF7EF21A9B9EDA0063FDE4 /* Resources */,
289-
);
290-
buildRules = (
291-
);
292-
dependencies = (
293-
27CF7EF71A9B9EDA0063FDE4 /* PBXTargetDependency */,
294-
);
295-
name = JSONSchemaTests;
296-
productName = JSONSchemaTests;
297-
productReference = 27CF7EF41A9B9EDA0063FDE4 /* JSONSchemaTests.xctest */;
298-
productType = "com.apple.product-type.bundle.unit-test";
299-
};
300228
/* End PBXNativeTarget section */
301229

302230
/* Begin PBXProject section */
@@ -312,17 +240,14 @@
312240
CreatedOnToolsVersion = 6.1.1;
313241
LastSwiftMigration = 0800;
314242
};
315-
27CF7EF31A9B9EDA0063FDE4 = {
316-
CreatedOnToolsVersion = 6.1.1;
317-
LastSwiftMigration = 0800;
318-
};
319243
};
320244
};
321245
buildConfigurationList = 27CF7EE31A9B9EDA0063FDE4 /* Build configuration list for PBXProject "JSONSchema" */;
322246
compatibilityVersion = "Xcode 3.2";
323247
developmentRegion = English;
324248
hasScannedForEncodings = 0;
325249
knownRegions = (
250+
English,
326251
en,
327252
);
328253
mainGroup = 27CF7EDF1A9B9EDA0063FDE4;
@@ -331,7 +256,6 @@
331256
projectRoot = "";
332257
targets = (
333258
27CF7EE81A9B9EDA0063FDE4 /* JSONSchema */,
334-
27CF7EF31A9B9EDA0063FDE4 /* JSONSchemaTests */,
335259
);
336260
};
337261
/* End PBXProject section */
@@ -344,44 +268,6 @@
344268
);
345269
runOnlyForDeploymentPostprocessing = 0;
346270
};
347-
27CF7EF21A9B9EDA0063FDE4 /* Resources */ = {
348-
isa = PBXResourcesBuildPhase;
349-
buildActionMask = 2147483647;
350-
files = (
351-
27B641311AAB13A8005C8641 /* maximum.json in Resources */,
352-
27B6413F1AAB13A8005C8641 /* pattern.json in Resources */,
353-
27B6413A1AAB13A8005C8641 /* not.json in Resources */,
354-
27B641321AAB13A8005C8641 /* maxItems.json in Resources */,
355-
27B641331AAB13A8005C8641 /* maxLength.json in Resources */,
356-
27B6413B1AAB13A8005C8641 /* oneOf.json in Resources */,
357-
27B641381AAB13A8005C8641 /* minProperties.json in Resources */,
358-
27B641301AAB13A8005C8641 /* items.json in Resources */,
359-
27B641431AAB13A8005C8641 /* refRemote.json in Resources */,
360-
27B641361AAB13A8005C8641 /* minItems.json in Resources */,
361-
27B6412A1AAB13A8005C8641 /* allOf.json in Resources */,
362-
27B6412D1AAB13A8005C8641 /* definitions.json in Resources */,
363-
27B641391AAB13A8005C8641 /* multipleOf.json in Resources */,
364-
27B641401AAB13A8005C8641 /* patternProperties.json in Resources */,
365-
27B641291AAB13A8005C8641 /* additionalProperties.json in Resources */,
366-
27B641371AAB13A8005C8641 /* minLength.json in Resources */,
367-
27B6413E1AAB13A8005C8641 /* zeroTerminatedFloats.json in Resources */,
368-
27B6412F1AAB13A8005C8641 /* enum.json in Resources */,
369-
27B641451AAB13A8005C8641 /* type.json in Resources */,
370-
27B6413C1AAB13A8005C8641 /* bignum.json in Resources */,
371-
27B641411AAB13A8005C8641 /* properties.json in Resources */,
372-
27B6412C1AAB13A8005C8641 /* default.json in Resources */,
373-
27B6412B1AAB13A8005C8641 /* anyOf.json in Resources */,
374-
27B6412E1AAB13A8005C8641 /* dependencies.json in Resources */,
375-
27B641441AAB13A8005C8641 /* required.json in Resources */,
376-
27B641351AAB13A8005C8641 /* minimum.json in Resources */,
377-
27B641461AAB13A8005C8641 /* uniqueItems.json in Resources */,
378-
27B641281AAB13A8005C8641 /* additionalItems.json in Resources */,
379-
27B641421AAB13A8005C8641 /* ref.json in Resources */,
380-
27B6413D1AAB13A8005C8641 /* format.json in Resources */,
381-
27B641341AAB13A8005C8641 /* maxProperties.json in Resources */,
382-
);
383-
runOnlyForDeploymentPostprocessing = 0;
384-
};
385271
/* End PBXResourcesBuildPhase section */
386272

387273
/* Begin PBXSourcesBuildPhase section */
@@ -394,25 +280,8 @@
394280
);
395281
runOnlyForDeploymentPostprocessing = 0;
396282
};
397-
27CF7EF01A9B9EDA0063FDE4 /* Sources */ = {
398-
isa = PBXSourcesBuildPhase;
399-
buildActionMask = 2147483647;
400-
files = (
401-
27B640CD1AAB12CB005C8641 /* JSONSchemaCases.swift in Sources */,
402-
27CF7EFC1A9B9EDA0063FDE4 /* JSONSchemaTests.swift in Sources */,
403-
);
404-
runOnlyForDeploymentPostprocessing = 0;
405-
};
406283
/* End PBXSourcesBuildPhase section */
407284

408-
/* Begin PBXTargetDependency section */
409-
27CF7EF71A9B9EDA0063FDE4 /* PBXTargetDependency */ = {
410-
isa = PBXTargetDependency;
411-
target = 27CF7EE81A9B9EDA0063FDE4 /* JSONSchema */;
412-
targetProxy = 27CF7EF61A9B9EDA0063FDE4 /* PBXContainerItemProxy */;
413-
};
414-
/* End PBXTargetDependency section */
415-
416285
/* Begin XCBuildConfiguration section */
417286
27CF7EFD1A9B9EDA0063FDE4 /* Debug */ = {
418287
isa = XCBuildConfiguration;
@@ -458,6 +327,7 @@
458327
ONLY_ACTIVE_ARCH = YES;
459328
SDKROOT = macosx;
460329
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
330+
SWIFT_VERSION = 4.2;
461331
VERSIONING_SYSTEM = "apple-generic";
462332
VERSION_INFO_PREFIX = "";
463333
};
@@ -500,6 +370,7 @@
500370
MTL_ENABLE_DEBUG_INFO = NO;
501371
SDKROOT = macosx;
502372
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
373+
SWIFT_VERSION = 4.2;
503374
VERSIONING_SYSTEM = "apple-generic";
504375
VERSION_INFO_PREFIX = "";
505376
};
@@ -522,7 +393,6 @@
522393
PRODUCT_NAME = "$(TARGET_NAME)";
523394
SKIP_INSTALL = YES;
524395
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
525-
SWIFT_VERSION = 3.0;
526396
};
527397
name = Debug;
528398
};
@@ -542,35 +412,6 @@
542412
PRODUCT_BUNDLE_IDENTIFIER = "org.cocode.$(PRODUCT_NAME:rfc1034identifier)";
543413
PRODUCT_NAME = "$(TARGET_NAME)";
544414
SKIP_INSTALL = YES;
545-
SWIFT_VERSION = 3.0;
546-
};
547-
name = Release;
548-
};
549-
27CF7F031A9B9EDA0063FDE4 /* Debug */ = {
550-
isa = XCBuildConfiguration;
551-
baseConfigurationReference = 27B640CB1AAB1080005C8641 /* UniversalFramework_Test.xcconfig */;
552-
buildSettings = {
553-
COMBINE_HIDPI_IMAGES = YES;
554-
GCC_PREPROCESSOR_DEFINITIONS = (
555-
"DEBUG=1",
556-
"$(inherited)",
557-
);
558-
INFOPLIST_FILE = Tests/Info.plist;
559-
PRODUCT_BUNDLE_IDENTIFIER = "org.cocode.$(PRODUCT_NAME:rfc1034identifier)";
560-
PRODUCT_NAME = "$(TARGET_NAME)";
561-
SWIFT_VERSION = 3.0;
562-
};
563-
name = Debug;
564-
};
565-
27CF7F041A9B9EDA0063FDE4 /* Release */ = {
566-
isa = XCBuildConfiguration;
567-
baseConfigurationReference = 27B640CB1AAB1080005C8641 /* UniversalFramework_Test.xcconfig */;
568-
buildSettings = {
569-
COMBINE_HIDPI_IMAGES = YES;
570-
INFOPLIST_FILE = Tests/Info.plist;
571-
PRODUCT_BUNDLE_IDENTIFIER = "org.cocode.$(PRODUCT_NAME:rfc1034identifier)";
572-
PRODUCT_NAME = "$(TARGET_NAME)";
573-
SWIFT_VERSION = 3.0;
574415
};
575416
name = Release;
576417
};
@@ -595,15 +436,6 @@
595436
defaultConfigurationIsVisible = 0;
596437
defaultConfigurationName = Release;
597438
};
598-
27CF7F021A9B9EDA0063FDE4 /* Build configuration list for PBXNativeTarget "JSONSchemaTests" */ = {
599-
isa = XCConfigurationList;
600-
buildConfigurations = (
601-
27CF7F031A9B9EDA0063FDE4 /* Debug */,
602-
27CF7F041A9B9EDA0063FDE4 /* Release */,
603-
);
604-
defaultConfigurationIsVisible = 0;
605-
defaultConfigurationName = Release;
606-
};
607439
/* End XCConfigurationList section */
608440
};
609441
rootObject = 27CF7EE01A9B9EDA0063FDE4 /* Project object */;

Sources/Validators.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func validateUniqueItems(_ value: Any) -> ValidationResult {
279279

280280
let numbers = value.filter { value in value is NSNumber } as! [NSNumber]
281281
let numerBooleans = numbers.filter(isBoolean)
282-
let booleans = numerBooleans as [Bool]
282+
let booleans: [Bool] = numerBooleans.map { Bool($0) }
283283
let nonBooleans = numbers.filter { number in !isBoolean(number) }
284284
let hasTrueAndOne = booleans.filter { v in v }.count > 0 && nonBooleans.filter { v in v == 1 }.count > 0
285285
let hasFalseAndZero = booleans.filter { v in !v }.count > 0 && nonBooleans.filter { v in v == 0 }.count > 0

Tests/JSONSchemaCases.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import XCTest
1111
import JSONSchema
1212

1313
func fixture(_ named:String, forObject:Any) -> Data {
14-
let bundle = Bundle(for:object_getClass(forObject))
14+
let bundle = Bundle(for: type(of: forObject.self) as! AnyClass)
1515
let path = bundle.url(forResource: named, withExtension: nil)!
1616
let data = try! Data(contentsOf: path)
1717
return data

0 commit comments

Comments
 (0)