Skip to content

Commit 9b105c3

Browse files
author
Justin Magnini
committed
Create additional iOS 14.4 tests target
1 parent 628c9b1 commit 9b105c3

File tree

3 files changed

+198
-22
lines changed

3 files changed

+198
-22
lines changed

Example/Swiftilities.xcodeproj/project.pbxproj

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
0050C1C61EDDA02700665F74 /* LifecycleBehaviorsListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0050C1C51EDDA02700665F74 /* LifecycleBehaviorsListViewController.swift */; };
1313
04CD173B1AB7C4F6286F8FA1 /* Pods_Swiftilities_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 849AC9425E95C2FF6F694A7F /* Pods_Swiftilities_Example.framework */; };
1414
2340A5BD1E8CC67A00572417 /* TestModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 2340A5BA1E8CC3B500572417 /* TestModel.xcdatamodeld */; };
15+
521859AF265EF84E00C819D3 /* ValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD74F57D1E2FC4D3005E59FF /* ValidatorTests.swift */; };
16+
521859B0265EF84E00C819D3 /* LicenseFormatterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDF471521DDFB20100D4D5A2 /* LicenseFormatterTests.swift */; };
17+
521859B1265EF84E00C819D3 /* TestModel.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 2340A5BA1E8CC3B500572417 /* TestModel.xcdatamodeld */; };
18+
521859B2265EF84E00C819D3 /* RootViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72E281A61E5DDE59000D0C9D /* RootViewControllerTests.swift */; };
19+
521859B3265EF84E00C819D3 /* TableViewHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDCBBA9C1EA7D95D00610F47 /* TableViewHelperTests.swift */; };
20+
521859B4265EF84E00C819D3 /* LogTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDF3429D1EA02B5100E6328B /* LogTests.swift */; };
21+
521859B5265EF84E00C819D3 /* MathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD32DE731CEA1EC600FC0C7E /* MathTests.swift */; };
22+
521859B6265EF84E00C819D3 /* CoreDataStackTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D98569CA23E8C54D007EF367 /* CoreDataStackTests.swift */; };
23+
521859B8265EF84E00C819D3 /* Pods_Swiftilities_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F294762325B4901AA48D27B1 /* Pods_Swiftilities_Tests.framework */; };
1524
722099011E5F46EE0098229D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 722098FF1E5F46EE0098229D /* Main.storyboard */; };
1625
722099061E5F470D0098229D /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 722099031E5F470D0098229D /* LaunchScreen.xib */; };
1726
722099071E5F470D0098229D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 722099051E5F470D0098229D /* Images.xcassets */; };
@@ -37,6 +46,13 @@
3746
/* End PBXBuildFile section */
3847

3948
/* Begin PBXContainerItemProxy section */
49+
521859AC265EF84E00C819D3 /* PBXContainerItemProxy */ = {
50+
isa = PBXContainerItemProxy;
51+
containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
52+
proxyType = 1;
53+
remoteGlobalIDString = 607FACCF1AFB9204008FA782;
54+
remoteInfo = Swiftilities_Example;
55+
};
4056
D909A58020DAE3E7007BCA07 /* PBXContainerItemProxy */ = {
4157
isa = PBXContainerItemProxy;
4258
containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
@@ -52,6 +68,7 @@
5268
0050C1C51EDDA02700665F74 /* LifecycleBehaviorsListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LifecycleBehaviorsListViewController.swift; sourceTree = "<group>"; };
5369
2340A5BB1E8CC3B500572417 /* TestModel.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = TestModel.xcdatamodel; sourceTree = "<group>"; };
5470
3ED95507725D28046957F181 /* Pods-Swiftilities_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Swiftilities_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Swiftilities_Tests/Pods-Swiftilities_Tests.debug.xcconfig"; sourceTree = "<group>"; };
71+
521859BE265EF84E00C819D3 /* Swiftilities_Tests_Latest.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Swiftilities_Tests_Latest.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5572
5524B820B7943401CC253A04 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
5673
563BE12C99CEF6CB9AB591A4 /* Swiftilities.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Swiftilities.podspec; path = ../Swiftilities.podspec; sourceTree = "<group>"; };
5774
607FACD01AFB9204008FA782 /* Swiftilities_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Swiftilities_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -88,6 +105,14 @@
88105
/* End PBXFileReference section */
89106

90107
/* Begin PBXFrameworksBuildPhase section */
108+
521859B7265EF84E00C819D3 /* Frameworks */ = {
109+
isa = PBXFrameworksBuildPhase;
110+
buildActionMask = 2147483647;
111+
files = (
112+
521859B8265EF84E00C819D3 /* Pods_Swiftilities_Tests.framework in Frameworks */,
113+
);
114+
runOnlyForDeploymentPostprocessing = 0;
115+
};
91116
607FACCD1AFB9204008FA782 /* Frameworks */ = {
92117
isa = PBXFrameworksBuildPhase;
93118
buildActionMask = 2147483647;
@@ -144,6 +169,7 @@
144169
children = (
145170
607FACD01AFB9204008FA782 /* Swiftilities_Example.app */,
146171
607FACE51AFB9204008FA782 /* Swiftilities_Tests.xctest */,
172+
521859BE265EF84E00C819D3 /* Swiftilities_Tests_Latest.xctest */,
147173
);
148174
name = Products;
149175
sourceTree = "<group>";
@@ -324,6 +350,26 @@
324350
/* End PBXGroup section */
325351

326352
/* Begin PBXNativeTarget section */
353+
521859AA265EF84E00C819D3 /* Swiftilities_Tests_Latest */ = {
354+
isa = PBXNativeTarget;
355+
buildConfigurationList = 521859BB265EF84E00C819D3 /* Build configuration list for PBXNativeTarget "Swiftilities_Tests_Latest" */;
356+
buildPhases = (
357+
521859AD265EF84E00C819D3 /* [CP] Check Pods Manifest.lock */,
358+
521859AE265EF84E00C819D3 /* Sources */,
359+
521859B7265EF84E00C819D3 /* Frameworks */,
360+
521859B9265EF84E00C819D3 /* Resources */,
361+
521859BA265EF84E00C819D3 /* [CP] Embed Pods Frameworks */,
362+
);
363+
buildRules = (
364+
);
365+
dependencies = (
366+
521859AB265EF84E00C819D3 /* PBXTargetDependency */,
367+
);
368+
name = Swiftilities_Tests_Latest;
369+
productName = Tests;
370+
productReference = 521859BE265EF84E00C819D3 /* Swiftilities_Tests_Latest.xctest */;
371+
productType = "com.apple.product-type.bundle.unit-test";
372+
};
327373
607FACCF1AFB9204008FA782 /* Swiftilities_Example */ = {
328374
isa = PBXNativeTarget;
329375
buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Swiftilities_Example" */;
@@ -402,11 +448,19 @@
402448
targets = (
403449
607FACCF1AFB9204008FA782 /* Swiftilities_Example */,
404450
607FACE41AFB9204008FA782 /* Swiftilities_Tests */,
451+
521859AA265EF84E00C819D3 /* Swiftilities_Tests_Latest */,
405452
);
406453
};
407454
/* End PBXProject section */
408455

409456
/* Begin PBXResourcesBuildPhase section */
457+
521859B9265EF84E00C819D3 /* Resources */ = {
458+
isa = PBXResourcesBuildPhase;
459+
buildActionMask = 2147483647;
460+
files = (
461+
);
462+
runOnlyForDeploymentPostprocessing = 0;
463+
};
410464
607FACCE1AFB9204008FA782 /* Resources */ = {
411465
isa = PBXResourcesBuildPhase;
412466
buildActionMask = 2147483647;
@@ -445,6 +499,41 @@
445499
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Swiftilities_Example/Pods-Swiftilities_Example-frameworks.sh\"\n";
446500
showEnvVarsInLog = 0;
447501
};
502+
521859AD265EF84E00C819D3 /* [CP] Check Pods Manifest.lock */ = {
503+
isa = PBXShellScriptBuildPhase;
504+
buildActionMask = 2147483647;
505+
files = (
506+
);
507+
inputPaths = (
508+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
509+
"${PODS_ROOT}/Manifest.lock",
510+
);
511+
name = "[CP] Check Pods Manifest.lock";
512+
outputPaths = (
513+
"$(DERIVED_FILE_DIR)/Pods-Swiftilities_Tests-checkManifestLockResult.txt",
514+
);
515+
runOnlyForDeploymentPostprocessing = 0;
516+
shellPath = /bin/sh;
517+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
518+
showEnvVarsInLog = 0;
519+
};
520+
521859BA265EF84E00C819D3 /* [CP] Embed Pods Frameworks */ = {
521+
isa = PBXShellScriptBuildPhase;
522+
buildActionMask = 2147483647;
523+
files = (
524+
);
525+
inputFileListPaths = (
526+
"${PODS_ROOT}/Target Support Files/Pods-Swiftilities_Tests/Pods-Swiftilities_Tests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
527+
);
528+
name = "[CP] Embed Pods Frameworks";
529+
outputFileListPaths = (
530+
"${PODS_ROOT}/Target Support Files/Pods-Swiftilities_Tests/Pods-Swiftilities_Tests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
531+
);
532+
runOnlyForDeploymentPostprocessing = 0;
533+
shellPath = /bin/sh;
534+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Swiftilities_Tests/Pods-Swiftilities_Tests-frameworks.sh\"\n";
535+
showEnvVarsInLog = 0;
536+
};
448537
662F65D4D4E8DC340A9997D2 /* [CP] Check Pods Manifest.lock */ = {
449538
isa = PBXShellScriptBuildPhase;
450539
buildActionMask = 2147483647;
@@ -515,6 +604,21 @@
515604
/* End PBXShellScriptBuildPhase section */
516605

517606
/* Begin PBXSourcesBuildPhase section */
607+
521859AE265EF84E00C819D3 /* Sources */ = {
608+
isa = PBXSourcesBuildPhase;
609+
buildActionMask = 2147483647;
610+
files = (
611+
521859AF265EF84E00C819D3 /* ValidatorTests.swift in Sources */,
612+
521859B0265EF84E00C819D3 /* LicenseFormatterTests.swift in Sources */,
613+
521859B1265EF84E00C819D3 /* TestModel.xcdatamodeld in Sources */,
614+
521859B2265EF84E00C819D3 /* RootViewControllerTests.swift in Sources */,
615+
521859B3265EF84E00C819D3 /* TableViewHelperTests.swift in Sources */,
616+
521859B4265EF84E00C819D3 /* LogTests.swift in Sources */,
617+
521859B5265EF84E00C819D3 /* MathTests.swift in Sources */,
618+
521859B6265EF84E00C819D3 /* CoreDataStackTests.swift in Sources */,
619+
);
620+
runOnlyForDeploymentPostprocessing = 0;
621+
};
518622
607FACCC1AFB9204008FA782 /* Sources */ = {
519623
isa = PBXSourcesBuildPhase;
520624
buildActionMask = 2147483647;
@@ -553,6 +657,11 @@
553657
/* End PBXSourcesBuildPhase section */
554658

555659
/* Begin PBXTargetDependency section */
660+
521859AB265EF84E00C819D3 /* PBXTargetDependency */ = {
661+
isa = PBXTargetDependency;
662+
target = 607FACCF1AFB9204008FA782 /* Swiftilities_Example */;
663+
targetProxy = 521859AC265EF84E00C819D3 /* PBXContainerItemProxy */;
664+
};
556665
D909A58120DAE3E7007BCA07 /* PBXTargetDependency */ = {
557666
isa = PBXTargetDependency;
558667
target = 607FACCF1AFB9204008FA782 /* Swiftilities_Example */;
@@ -580,6 +689,52 @@
580689
/* End PBXVariantGroup section */
581690

582691
/* Begin XCBuildConfiguration section */
692+
521859BC265EF84E00C819D3 /* Debug */ = {
693+
isa = XCBuildConfiguration;
694+
baseConfigurationReference = 3ED95507725D28046957F181 /* Pods-Swiftilities_Tests.debug.xcconfig */;
695+
buildSettings = {
696+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
697+
CODE_SIGN_STYLE = Manual;
698+
DEVELOPMENT_TEAM = "";
699+
GCC_PREPROCESSOR_DEFINITIONS = (
700+
"DEBUG=1",
701+
"$(inherited)",
702+
);
703+
INFOPLIST_FILE = Tests/Info.plist;
704+
IPHONEOS_DEPLOYMENT_TARGET = 14.4;
705+
LD_RUNPATH_SEARCH_PATHS = (
706+
"$(inherited)",
707+
"@executable_path/Frameworks",
708+
"@loader_path/Frameworks",
709+
);
710+
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
711+
PRODUCT_NAME = "$(TARGET_NAME)";
712+
PROVISIONING_PROFILE_SPECIFIER = "";
713+
SWIFT_VERSION = 5.0;
714+
};
715+
name = Debug;
716+
};
717+
521859BD265EF84E00C819D3 /* Release */ = {
718+
isa = XCBuildConfiguration;
719+
baseConfigurationReference = 7396494F9BA8221A6823B9D4 /* Pods-Swiftilities_Tests.release.xcconfig */;
720+
buildSettings = {
721+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
722+
CODE_SIGN_STYLE = Manual;
723+
DEVELOPMENT_TEAM = "";
724+
INFOPLIST_FILE = Tests/Info.plist;
725+
IPHONEOS_DEPLOYMENT_TARGET = 14.4;
726+
LD_RUNPATH_SEARCH_PATHS = (
727+
"$(inherited)",
728+
"@executable_path/Frameworks",
729+
"@loader_path/Frameworks",
730+
);
731+
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
732+
PRODUCT_NAME = "$(TARGET_NAME)";
733+
PROVISIONING_PROFILE_SPECIFIER = "";
734+
SWIFT_VERSION = 5.0;
735+
};
736+
name = Release;
737+
};
583738
607FACED1AFB9204008FA782 /* Debug */ = {
584739
isa = XCBuildConfiguration;
585740
buildSettings = {
@@ -776,6 +931,15 @@
776931
/* End XCBuildConfiguration section */
777932

778933
/* Begin XCConfigurationList section */
934+
521859BB265EF84E00C819D3 /* Build configuration list for PBXNativeTarget "Swiftilities_Tests_Latest" */ = {
935+
isa = XCConfigurationList;
936+
buildConfigurations = (
937+
521859BC265EF84E00C819D3 /* Debug */,
938+
521859BD265EF84E00C819D3 /* Release */,
939+
);
940+
defaultConfigurationIsVisible = 0;
941+
defaultConfigurationName = Release;
942+
};
779943
607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "Swiftilities" */ = {
780944
isa = XCConfigurationList;
781945
buildConfigurations = (

Example/Swiftilities.xcodeproj/xcshareddata/xcschemes/Swiftilities-Example.xcscheme

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
4343
shouldUseLaunchSchemeArgsEnv = "YES">
44+
<MacroExpansion>
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
48+
BuildableName = "Swiftilities_Example.app"
49+
BlueprintName = "Swiftilities_Example"
50+
ReferencedContainer = "container:Swiftilities.xcodeproj">
51+
</BuildableReference>
52+
</MacroExpansion>
4453
<Testables>
4554
<TestableReference
4655
skipped = "NO">
@@ -52,18 +61,17 @@
5261
ReferencedContainer = "container:Swiftilities.xcodeproj">
5362
</BuildableReference>
5463
</TestableReference>
64+
<TestableReference
65+
skipped = "NO">
66+
<BuildableReference
67+
BuildableIdentifier = "primary"
68+
BlueprintIdentifier = "521859AA265EF84E00C819D3"
69+
BuildableName = "Swiftilities_Tests_Latest.xctest"
70+
BlueprintName = "Swiftilities_Tests_Latest"
71+
ReferencedContainer = "container:Swiftilities.xcodeproj">
72+
</BuildableReference>
73+
</TestableReference>
5574
</Testables>
56-
<MacroExpansion>
57-
<BuildableReference
58-
BuildableIdentifier = "primary"
59-
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
60-
BuildableName = "Swiftilities_Example.app"
61-
BlueprintName = "Swiftilities_Example"
62-
ReferencedContainer = "container:Swiftilities.xcodeproj">
63-
</BuildableReference>
64-
</MacroExpansion>
65-
<AdditionalOptions>
66-
</AdditionalOptions>
6775
</TestAction>
6876
<LaunchAction
6977
buildConfiguration = "Debug"
@@ -85,8 +93,6 @@
8593
ReferencedContainer = "container:Swiftilities.xcodeproj">
8694
</BuildableReference>
8795
</BuildableProductRunnable>
88-
<AdditionalOptions>
89-
</AdditionalOptions>
9096
</LaunchAction>
9197
<ProfileAction
9298
buildConfiguration = "Release"

Pod/Classes/Logging/Log.swift

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ open class Log {
5353
}
5454
}
5555

56-
public static private(set) var standard = Log("", logLevel: .off)
56+
public static private(set) var shared = Log("", logLevel: .off)
5757

5858
/// Static instance used for helper methods.
5959
open class var instance: Log {
60-
return standard
60+
return shared
6161
}
6262

6363
/// Subsystem of the OSLog message when running on iOS 14 or later.
@@ -123,9 +123,21 @@ open class Log {
123123
let logString = "\(levelString)\(date) \(objectName) \(functionName) line \(line):\n\(object())"
124124

125125
if #available(iOS 14.0, *) {
126-
let logger = Logger(subsystem: subsystem, category: name)
127126
let objectString = "\(object())"
128127
let logMessage = "\(objectName) \(functionName) line \(line)"
128+
osLog(logMessage, objectString: objectString, level: level)
129+
}
130+
else {
131+
let nameString = name.count > 0 ? "[\(name)]]" : ""
132+
print(nameString + logString + "\n")
133+
}
134+
self.handler?(level, logString)
135+
Log.globalHandler?(self, level, logString)
136+
}
137+
138+
internal func osLog(_ logMessage: String, objectString: String, level: Level) {
139+
if #available(iOS 14.0, *) {
140+
let logger = Logger(subsystem: subsystem, category: name)
129141
switch level {
130142
case .verbose:
131143
logger.trace("\(logMessage):\n\(objectString, privacy: .private)")
@@ -141,12 +153,6 @@ open class Log {
141153
break
142154
}
143155
}
144-
else {
145-
let nameString = name.count > 0 ? "[\(name)]]" : ""
146-
print(nameString + logString + "\n")
147-
}
148-
self.handler?(level, logString)
149-
Log.globalHandler?(self, level, logString)
150156
}
151157

152158
// MARK: Public

0 commit comments

Comments
 (0)