Skip to content

Commit

Permalink
Merge pull request #256 from fpillet/carthage-fix
Browse files Browse the repository at this point in the history
Carthage fix
  • Loading branch information
fpillet committed Mar 11, 2018
2 parents a2deb4a + bbf20c3 commit 3f1d81a
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 37 deletions.
11 changes: 2 additions & 9 deletions Client/iOS/NSLogger.swift
Expand Up @@ -35,25 +35,17 @@
*/

import Foundation
#if !NSLOGGER_DONT_IMPORT_FRAMEWORK // this is purely for Crapthage which has two different frameworks and needs to import NSLogger
import NSLogger
#endif

#if os(iOS) || os(tvOS)

import UIKit

public typealias Image = UIImage

#endif
#if os(OSX)

#if os(OSX)
import Cocoa
public typealias Image = NSImage

#endif


/// The main NSLogger class, use `shared` property to obtain an instance
public final class Logger {

Expand Down Expand Up @@ -82,6 +74,7 @@ public final class Logger {
return Domain(rawValue: value)
}
}

public struct Level: RawRepresentable {

public let rawValue: Int
Expand Down
1 change: 1 addition & 0 deletions Client/iOS/NSLoggerSwift.h
Expand Up @@ -35,6 +35,7 @@
*/

#import <Foundation/Foundation.h>
#import "NSLogger.h"

//! Project version number for LoggerSwift.
FOUNDATION_EXPORT double LoggerSwiftVersionNumber;
Expand Down
48 changes: 29 additions & 19 deletions NSLogger.xcodeproj/project.pbxproj
Expand Up @@ -3,13 +3,15 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 48;
objects = {

/* Begin PBXBuildFile section */
123F1BCB1F7E8EC9008F260C /* NSLogger.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAAD0F961C4BE27B0042313D /* NSLogger.framework */; };
123F1BCD1F7E994C008F260C /* NSLoggerSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = 123F1BCC1F7E994C008F260C /* NSLoggerSwift.h */; settings = {ATTRIBUTES = (Public, ); }; };
3D0EE4DD1EC1255A00D0FA63 /* NSLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D0EE4DC1EC1255A00D0FA63 /* NSLogger.swift */; };
3D8D66862051F58500B94C72 /* LoggerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = DAAD0FAA1C4BE55F0042313D /* LoggerClient.m */; };
3D8D66872051F6DD00B94C72 /* LoggerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAD0FA91C4BE55F0042313D /* LoggerClient.h */; settings = {ATTRIBUTES = (Public, ); }; };
3D8D66882051F6E200B94C72 /* NSLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAD0FAC1C4BE55F0042313D /* NSLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
DAAD0FAD1C4BE55F0042313D /* LoggerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAD0FA91C4BE55F0042313D /* LoggerClient.h */; settings = {ATTRIBUTES = (Public, ); }; };
DAAD0FAE1C4BE55F0042313D /* LoggerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = DAAD0FAA1C4BE55F0042313D /* LoggerClient.m */; };
DAAD0FB01C4BE55F0042313D /* NSLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = DAAD0FAC1C4BE55F0042313D /* NSLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand All @@ -31,7 +33,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
123F1BCB1F7E8EC9008F260C /* NSLogger.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -92,6 +93,8 @@
buildActionMask = 2147483647;
files = (
123F1BCD1F7E994C008F260C /* NSLoggerSwift.h in Headers */,
3D8D66882051F6E200B94C72 /* NSLogger.h in Headers */,
3D8D66872051F6DD00B94C72 /* LoggerClient.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -149,7 +152,7 @@
DAAD0F8D1C4BE27B0042313D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0920;
ORGANIZATIONNAME = "Florent Pillet";
TargetAttributes = {
3D0EE4B11EC1241100D0FA63 = {
Expand All @@ -163,7 +166,7 @@
};
};
buildConfigurationList = DAAD0F901C4BE27B0042313D /* Build configuration list for PBXProject "NSLogger" */;
compatibilityVersion = "Xcode 3.2";
compatibilityVersion = "Xcode 8.0";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down Expand Up @@ -202,6 +205,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3D8D66862051F58500B94C72 /* LoggerClient.m in Sources */,
3D0EE4DD1EC1255A00D0FA63 /* NSLogger.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -221,9 +225,7 @@
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLoggerSwift;
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
PRODUCT_NAME = "$(PROJECT_NAME)Swift";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
PRODUCT_NAME = NSLoggerSwift;
SWIFT_VERSION = 4.0;
};
name = Debug;
Expand All @@ -232,9 +234,7 @@
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLoggerSwift;
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
PRODUCT_NAME = "$(PROJECT_NAME)Swift";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
PRODUCT_NAME = NSLoggerSwift;
SWIFT_VERSION = 4.0;
};
name = Release;
Expand All @@ -246,14 +246,20 @@
CLANG_ANALYZER_NONNULL = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -264,7 +270,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1.0.0;
DYLIB_CURRENT_VERSION = 1.8.3;
DYLIB_CURRENT_VERSION = 1.9.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand All @@ -284,12 +290,9 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLogger;
PRODUCT_NAME = "$(PROJECT_NAME)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "Semantic Versioning";
Expand All @@ -303,14 +306,20 @@
CLANG_ANALYZER_NONNULL = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -321,7 +330,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1.0.0;
DYLIB_CURRENT_VERSION = 1.8.3;
DYLIB_CURRENT_VERSION = 1.9.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -336,12 +345,9 @@
INFOPLIST_FILE = Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLogger;
PRODUCT_NAME = "$(PROJECT_NAME)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
Expand All @@ -352,12 +358,16 @@
DAAD0F9F1C4BE27B0042313D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLogger;
PRODUCT_NAME = NSLogger;
};
name = Debug;
};
DAAD0FA01C4BE27B0042313D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_BUNDLE_IDENTIFIER = com.florentpillet.NSLogger;
PRODUCT_NAME = NSLogger;
};
name = Release;
};
Expand Down
10 changes: 6 additions & 4 deletions NSLogger.xcodeproj/xcshareddata/xcschemes/NSLogger.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAAD0F951C4BE27B0042313D"
BuildableName = "NSLogger.framework"
BuildableName = "NSLoggerNoSwift.framework"
BlueprintName = "NSLogger"
ReferencedContainer = "container:NSLogger.xcodeproj">
</BuildableReference>
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -36,6 +37,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand All @@ -46,7 +48,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAAD0F951C4BE27B0042313D"
BuildableName = "NSLogger.framework"
BuildableName = "NSLoggerNoSwift.framework"
BlueprintName = "NSLogger"
ReferencedContainer = "container:NSLogger.xcodeproj">
</BuildableReference>
Expand All @@ -64,7 +66,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAAD0F951C4BE27B0042313D"
BuildableName = "NSLogger.framework"
BuildableName = "NSLoggerNoSwift.framework"
BlueprintName = "NSLogger"
ReferencedContainer = "container:NSLogger.xcodeproj">
</BuildableReference>
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
19 changes: 15 additions & 4 deletions README.markdown
Expand Up @@ -101,12 +101,14 @@ pod "NSLogger"
```

The above only includes C and Obj-C APIs and is suitable for use in applications without any Swift code.
Swift APIs are added with the `Swift` subspec. If you're developing code in Swift or a mixed Swift / Obj-C environment, use:
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:

```ruby
pod "NSLogger/Swift"
```

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.

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.

```ruby
Expand All @@ -115,19 +117,28 @@ pod "NSLogger/NoStrip"

### Carthage Install

NSLogger is Carthage-compatible. To use it, add the following line to your `Cartfile`:
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.

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`.

```
github "fpillet/NSLogger"
```

**or**

```
github "fpillet/NSLoggerSwift"
```


Then run:

```shell
$ carthage update
```

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.
Again, the `NSLogger.xcodeproj` top-level project offers two targets (`NSLogger` and `NSLoggerSwift`). Add the built framework that suits your needs.

# Advanced Usage

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

# Credits

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/)
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 comments on commit 3f1d81a

Please sign in to comment.