Skip to content

Commit 3f1d81a

Browse files
authored
Merge pull request #256 from fpillet/carthage-fix
Carthage fix
2 parents a2deb4a + bbf20c3 commit 3f1d81a

File tree

6 files changed

+54
-37
lines changed

6 files changed

+54
-37
lines changed

Client/iOS/NSLogger.swift

+2-9
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,17 @@
3535
*/
3636

3737
import Foundation
38-
#if !NSLOGGER_DONT_IMPORT_FRAMEWORK // this is purely for Crapthage which has two different frameworks and needs to import NSLogger
39-
import NSLogger
40-
#endif
4138

4239
#if os(iOS) || os(tvOS)
43-
4440
import UIKit
45-
4641
public typealias Image = UIImage
47-
4842
#endif
49-
#if os(OSX)
5043

44+
#if os(OSX)
5145
import Cocoa
5246
public typealias Image = NSImage
53-
5447
#endif
5548

56-
5749
/// The main NSLogger class, use `shared` property to obtain an instance
5850
public final class Logger {
5951

@@ -82,6 +74,7 @@ public final class Logger {
8274
return Domain(rawValue: value)
8375
}
8476
}
77+
8578
public struct Level: RawRepresentable {
8679

8780
public let rawValue: Int

Client/iOS/NSLoggerSwift.h

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
*/
3636

3737
#import <Foundation/Foundation.h>
38+
#import "NSLogger.h"
3839

3940
//! Project version number for LoggerSwift.
4041
FOUNDATION_EXPORT double LoggerSwiftVersionNumber;

NSLogger.xcodeproj/project.pbxproj

+29-19
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 48;
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
123F1BCB1F7E8EC9008F260C /* NSLogger.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAAD0F961C4BE27B0042313D /* NSLogger.framework */; };
1110
123F1BCD1F7E994C008F260C /* NSLoggerSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = 123F1BCC1F7E994C008F260C /* NSLoggerSwift.h */; settings = {ATTRIBUTES = (Public, ); }; };
1211
3D0EE4DD1EC1255A00D0FA63 /* NSLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D0EE4DC1EC1255A00D0FA63 /* NSLogger.swift */; };
12+
3D8D66862051F58500B94C72 /* LoggerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = DAAD0FAA1C4BE55F0042313D /* LoggerClient.m */; };
13+
3D8D66872051F6DD00B94C72 /* LoggerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAD0FA91C4BE55F0042313D /* LoggerClient.h */; settings = {ATTRIBUTES = (Public, ); }; };
14+
3D8D66882051F6E200B94C72 /* NSLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAD0FAC1C4BE55F0042313D /* NSLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
1315
DAAD0FAD1C4BE55F0042313D /* LoggerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAD0FA91C4BE55F0042313D /* LoggerClient.h */; settings = {ATTRIBUTES = (Public, ); }; };
1416
DAAD0FAE1C4BE55F0042313D /* LoggerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = DAAD0FAA1C4BE55F0042313D /* LoggerClient.m */; };
1517
DAAD0FB01C4BE55F0042313D /* NSLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAD0FAC1C4BE55F0042313D /* NSLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -31,7 +33,6 @@
3133
isa = PBXFrameworksBuildPhase;
3234
buildActionMask = 2147483647;
3335
files = (
34-
123F1BCB1F7E8EC9008F260C /* NSLogger.framework in Frameworks */,
3536
);
3637
runOnlyForDeploymentPostprocessing = 0;
3738
};
@@ -92,6 +93,8 @@
9293
buildActionMask = 2147483647;
9394
files = (
9495
123F1BCD1F7E994C008F260C /* NSLoggerSwift.h in Headers */,
96+
3D8D66882051F6E200B94C72 /* NSLogger.h in Headers */,
97+
3D8D66872051F6DD00B94C72 /* LoggerClient.h in Headers */,
9598
);
9699
runOnlyForDeploymentPostprocessing = 0;
97100
};
@@ -149,7 +152,7 @@
149152
DAAD0F8D1C4BE27B0042313D /* Project object */ = {
150153
isa = PBXProject;
151154
attributes = {
152-
LastUpgradeCheck = 0820;
155+
LastUpgradeCheck = 0920;
153156
ORGANIZATIONNAME = "Florent Pillet";
154157
TargetAttributes = {
155158
3D0EE4B11EC1241100D0FA63 = {
@@ -163,7 +166,7 @@
163166
};
164167
};
165168
buildConfigurationList = DAAD0F901C4BE27B0042313D /* Build configuration list for PBXProject "NSLogger" */;
166-
compatibilityVersion = "Xcode 3.2";
169+
compatibilityVersion = "Xcode 8.0";
167170
developmentRegion = English;
168171
hasScannedForEncodings = 0;
169172
knownRegions = (
@@ -202,6 +205,7 @@
202205
isa = PBXSourcesBuildPhase;
203206
buildActionMask = 2147483647;
204207
files = (
208+
3D8D66862051F58500B94C72 /* LoggerClient.m in Sources */,
205209
3D0EE4DD1EC1255A00D0FA63 /* NSLogger.swift in Sources */,
206210
);
207211
runOnlyForDeploymentPostprocessing = 0;
@@ -221,9 +225,7 @@
221225
isa = XCBuildConfiguration;
222226
buildSettings = {
223227
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLoggerSwift;
224-
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
225-
PRODUCT_NAME = "$(PROJECT_NAME)Swift";
226-
SWIFT_SWIFT3_OBJC_INFERENCE = On;
228+
PRODUCT_NAME = NSLoggerSwift;
227229
SWIFT_VERSION = 4.0;
228230
};
229231
name = Debug;
@@ -232,9 +234,7 @@
232234
isa = XCBuildConfiguration;
233235
buildSettings = {
234236
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLoggerSwift;
235-
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
236-
PRODUCT_NAME = "$(PROJECT_NAME)Swift";
237-
SWIFT_SWIFT3_OBJC_INFERENCE = On;
237+
PRODUCT_NAME = NSLoggerSwift;
238238
SWIFT_VERSION = 4.0;
239239
};
240240
name = Release;
@@ -246,14 +246,20 @@
246246
CLANG_ANALYZER_NONNULL = YES;
247247
CLANG_ENABLE_MODULES = YES;
248248
CLANG_ENABLE_OBJC_ARC = NO;
249+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
249250
CLANG_WARN_BOOL_CONVERSION = YES;
251+
CLANG_WARN_COMMA = YES;
250252
CLANG_WARN_CONSTANT_CONVERSION = YES;
251253
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
252254
CLANG_WARN_EMPTY_BODY = YES;
253255
CLANG_WARN_ENUM_CONVERSION = YES;
254256
CLANG_WARN_INFINITE_RECURSION = YES;
255257
CLANG_WARN_INT_CONVERSION = YES;
258+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
259+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
256260
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
261+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
262+
CLANG_WARN_STRICT_PROTOTYPES = YES;
257263
CLANG_WARN_SUSPICIOUS_MOVE = YES;
258264
CLANG_WARN_UNREACHABLE_CODE = YES;
259265
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -264,7 +270,7 @@
264270
DEBUG_INFORMATION_FORMAT = dwarf;
265271
DEFINES_MODULE = YES;
266272
DYLIB_COMPATIBILITY_VERSION = 1.0.0;
267-
DYLIB_CURRENT_VERSION = 1.8.3;
273+
DYLIB_CURRENT_VERSION = 1.9.0;
268274
DYLIB_INSTALL_NAME_BASE = "@rpath";
269275
ENABLE_STRICT_OBJC_MSGSEND = YES;
270276
ENABLE_TESTABILITY = YES;
@@ -284,12 +290,9 @@
284290
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
285291
MACOSX_DEPLOYMENT_TARGET = 10.10;
286292
ONLY_ACTIVE_ARCH = YES;
287-
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLogger;
288-
PRODUCT_NAME = "$(PROJECT_NAME)";
289293
SKIP_INSTALL = YES;
290294
SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator";
291295
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
292-
SWIFT_VERSION = 3.0;
293296
TARGETED_DEVICE_FAMILY = "1,2,3";
294297
TVOS_DEPLOYMENT_TARGET = 9.0;
295298
VERSIONING_SYSTEM = "Semantic Versioning";
@@ -303,14 +306,20 @@
303306
CLANG_ANALYZER_NONNULL = YES;
304307
CLANG_ENABLE_MODULES = YES;
305308
CLANG_ENABLE_OBJC_ARC = NO;
309+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
306310
CLANG_WARN_BOOL_CONVERSION = YES;
311+
CLANG_WARN_COMMA = YES;
307312
CLANG_WARN_CONSTANT_CONVERSION = YES;
308313
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
309314
CLANG_WARN_EMPTY_BODY = YES;
310315
CLANG_WARN_ENUM_CONVERSION = YES;
311316
CLANG_WARN_INFINITE_RECURSION = YES;
312317
CLANG_WARN_INT_CONVERSION = YES;
318+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
319+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
313320
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
321+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
322+
CLANG_WARN_STRICT_PROTOTYPES = YES;
314323
CLANG_WARN_SUSPICIOUS_MOVE = YES;
315324
CLANG_WARN_UNREACHABLE_CODE = YES;
316325
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -321,7 +330,7 @@
321330
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
322331
DEFINES_MODULE = YES;
323332
DYLIB_COMPATIBILITY_VERSION = 1.0.0;
324-
DYLIB_CURRENT_VERSION = 1.8.3;
333+
DYLIB_CURRENT_VERSION = 1.9.0;
325334
DYLIB_INSTALL_NAME_BASE = "@rpath";
326335
ENABLE_NS_ASSERTIONS = NO;
327336
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -336,12 +345,9 @@
336345
INFOPLIST_FILE = Info.plist;
337346
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
338347
MACOSX_DEPLOYMENT_TARGET = 10.10;
339-
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLogger;
340-
PRODUCT_NAME = "$(PROJECT_NAME)";
341348
SKIP_INSTALL = YES;
342349
SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator";
343350
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
344-
SWIFT_VERSION = 3.0;
345351
TARGETED_DEVICE_FAMILY = "1,2,3";
346352
TVOS_DEPLOYMENT_TARGET = 9.0;
347353
VALIDATE_PRODUCT = YES;
@@ -352,12 +358,16 @@
352358
DAAD0F9F1C4BE27B0042313D /* Debug */ = {
353359
isa = XCBuildConfiguration;
354360
buildSettings = {
361+
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLogger;
362+
PRODUCT_NAME = NSLogger;
355363
};
356364
name = Debug;
357365
};
358366
DAAD0FA01C4BE27B0042313D /* Release */ = {
359367
isa = XCBuildConfiguration;
360368
buildSettings = {
369+
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLogger;
370+
PRODUCT_NAME = NSLogger;
361371
};
362372
name = Release;
363373
};

NSLogger.xcodeproj/xcshareddata/xcschemes/NSLogger.xcscheme

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0820"
3+
LastUpgradeVersion = "0920"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -15,7 +15,7 @@
1515
<BuildableReference
1616
BuildableIdentifier = "primary"
1717
BlueprintIdentifier = "DAAD0F951C4BE27B0042313D"
18-
BuildableName = "NSLogger.framework"
18+
BuildableName = "NSLoggerNoSwift.framework"
1919
BlueprintName = "NSLogger"
2020
ReferencedContainer = "container:NSLogger.xcodeproj">
2121
</BuildableReference>
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -36,6 +37,7 @@
3637
buildConfiguration = "Debug"
3738
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3839
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40+
language = ""
3941
launchStyle = "0"
4042
useCustomWorkingDirectory = "NO"
4143
ignoresPersistentStateOnLaunch = "NO"
@@ -46,7 +48,7 @@
4648
<BuildableReference
4749
BuildableIdentifier = "primary"
4850
BlueprintIdentifier = "DAAD0F951C4BE27B0042313D"
49-
BuildableName = "NSLogger.framework"
51+
BuildableName = "NSLoggerNoSwift.framework"
5052
BlueprintName = "NSLogger"
5153
ReferencedContainer = "container:NSLogger.xcodeproj">
5254
</BuildableReference>
@@ -64,7 +66,7 @@
6466
<BuildableReference
6567
BuildableIdentifier = "primary"
6668
BlueprintIdentifier = "DAAD0F951C4BE27B0042313D"
67-
BuildableName = "NSLogger.framework"
69+
BuildableName = "NSLoggerNoSwift.framework"
6870
BlueprintName = "NSLogger"
6971
ReferencedContainer = "container:NSLogger.xcodeproj">
7072
</BuildableReference>

NSLogger.xcodeproj/xcshareddata/xcschemes/NSLoggerSwift.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0820"
3+
LastUpgradeVersion = "0920"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

README.markdown

+15-4
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@ pod "NSLogger"
101101
```
102102

103103
The above only includes C and Obj-C APIs and is suitable for use in applications without any Swift code.
104-
Swift APIs are added with the `Swift` subspec. If you're developing code in Swift or a mixed Swift / Obj-C environment, use:
104+
Swift syntactic sugar APIs are added with the `Swift` subspec. If you're developing code in Swift or a mixed Swift / Obj-C environment, use:
105105

106106
```ruby
107107
pod "NSLogger/Swift"
108108
```
109109

110+
Note that you don't strictly need to include the `/Swift` variant for your Swift applications. You can perfectly develop your own extensions that call into NSLogger's C APIs without using the basic provided ones.
111+
110112
Finally if you are using frameworks or libraries that may use NSLogger, then you can use the `NoStrip` variant which forces the linker to keep all NSLogger functions in the final build, even those that your code doesn't use. Since linked in frameworks may dynamically check for the presence of NSLogger functions, this is required as the linker wouldn't see this use.
111113

112114
```ruby
@@ -115,19 +117,28 @@ pod "NSLogger/NoStrip"
115117

116118
### Carthage Install
117119

118-
NSLogger is Carthage-compatible. To use it, add the following line to your `Cartfile`:
120+
NSLogger is Carthage-compatible. It builds two frameworks: `NSLogger` and `NSLoggerSwift`. You'll need to pick either one (but not both) to use in your application. Both can be used with Swift, the `NSLoggerSwift` variant adds a simple Swift layer to make NSLogger easier to use from Swift code. You can perfectly develop your own extensions that call into NSLogger's C APIs without using the basic provided ones, and just use the `NSLogger` framework.
121+
122+
Depending on the framework you choose, your code will need to `import NSLogger` or `import NSLoggerSwift`. This is a difference with Cocoapods support where you always `import NSLogger`.
119123

120124
```
121125
github "fpillet/NSLogger"
122126
```
123127

128+
**or**
129+
130+
```
131+
github "fpillet/NSLoggerSwift"
132+
```
133+
134+
124135
Then run:
125136

126137
```shell
127138
$ carthage update
128139
```
129140

130-
Note that for Carthage, the `NSLogger.xcodeproj` top-level project offers two targets (`NSLogger` and `NSLoggerSwift`). Add the built framework that suits your needs to your project.
141+
Again, the `NSLogger.xcodeproj` top-level project offers two targets (`NSLogger` and `NSLoggerSwift`). Add the built framework that suits your needs.
131142

132143
# Advanced Usage
133144

@@ -197,4 +208,4 @@ The *NSLogger* framework runs in its own thread in your application. It tries ha
197208

198209
# Credits
199210

200-
NSLogger is Copyright (c) 2010-2017 Florent Pillet, All Rights Reserved, All Wrongs Revenged. Released under the [New BSD Licence](http://opensource.org/licenses/bsd-license.php). NSLogger uses parts of [Brandon Walkin's BWToolkit](http://www.brandonwalkin.com/bwtoolkit/), for which source code is included with the NSLogger viewer application. The NSLogger icon is Copyright (c) [Louis Harboe](http://harboe.me/)
211+
NSLogger is Copyright (c) 2010-2018 Florent Pillet, All Rights Reserved, All Wrongs Revenged. Released under the [New BSD Licence](http://opensource.org/licenses/bsd-license.php). NSLogger uses parts of [Brandon Walkin's BWToolkit](http://www.brandonwalkin.com/bwtoolkit/), for which source code is included with the NSLogger viewer application. The NSLogger icon is Copyright (c) [Louis Harboe](http://harboe.me/)

0 commit comments

Comments
 (0)