From 59eaaf1672465251bb3dd0acdb66a83d56ef7338 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Sun, 22 May 2016 23:15:10 +0100 Subject: [PATCH 1/4] Modernises build settings according Xcode wishes; Adds a shared scheme for Carthage compatibility. --- .gitignore | 3 + Resources/Info.plist | 2 +- Source/XUIFontAdditions.m | 2 +- XUIKit.xcodeproj/project.pbxproj | 6 +- .../contents.xcworkspacedata | 7 ++ .../xcshareddata/xcschemes/XUIKit.xcscheme | 80 +++++++++++++++++++ 6 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 XUIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 XUIKit.xcodeproj/xcshareddata/xcschemes/XUIKit.xcscheme diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ebc85fd --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +Carthage/Build +.DS_Store +*.xcuserdatad diff --git a/Resources/Info.plist b/Resources/Info.plist index 8ad60c9..3d55dbd 100644 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile CFBundleIdentifier - com.iccir.XUIKit + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/Source/XUIFontAdditions.m b/Source/XUIFontAdditions.m index 422a95b..1705d78 100644 --- a/Source/XUIFontAdditions.m +++ b/Source/XUIFontAdditions.m @@ -93,7 +93,7 @@ - (CGFloat) xui_lineHeight int unitsPerEm = CTFontGetUnitsPerEm(ctFont); long ascent = lroundf( ( CTFontGetAscent( ctFont) / unitsPerEm) * pointSize); - long descent = lroundf(-(-abs(CTFontGetDescent(ctFont)) / unitsPerEm) * pointSize); + long descent = lroundf(-(-fabs(CTFontGetDescent(ctFont)) / unitsPerEm) * pointSize); long lineGap = lroundf( ( CTFontGetLeading(ctFont) / unitsPerEm) * pointSize); return ascent + descent + lineGap; diff --git a/XUIKit.xcodeproj/project.pbxproj b/XUIKit.xcodeproj/project.pbxproj index 2d122f1..ecfbed3 100644 --- a/XUIKit.xcodeproj/project.pbxproj +++ b/XUIKit.xcodeproj/project.pbxproj @@ -272,7 +272,7 @@ 555459F514EC607B0074B45E /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0600; + LastUpgradeCheck = 0730; }; buildConfigurationList = 555459F814EC607B0074B45E /* Build configuration list for PBXProject "XUIKit" */; compatibilityVersion = "Xcode 3.2"; @@ -332,6 +332,7 @@ DYLIB_CURRENT_VERSION = 1; GCC_PREFIX_HEADER = Source/XUIKitPrefix.pch; MACH_O_TYPE = mh_dylib; + PRODUCT_BUNDLE_IDENTIFIER = com.iccir.XUIKit; }; name = Debug; }; @@ -345,6 +346,7 @@ DYLIB_CURRENT_VERSION = 1; GCC_PREFIX_HEADER = Source/XUIKitPrefix.pch; MACH_O_TYPE = mh_dylib; + PRODUCT_BUNDLE_IDENTIFIER = com.iccir.XUIKit; }; name = Profile; }; @@ -358,12 +360,14 @@ DYLIB_CURRENT_VERSION = 1; GCC_PREFIX_HEADER = Source/XUIKitPrefix.pch; MACH_O_TYPE = mh_dylib; + PRODUCT_BUNDLE_IDENTIFIER = com.iccir.XUIKit; }; name = Release; }; 55545A1214EC607B0074B45E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_TESTABILITY = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; }; diff --git a/XUIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/XUIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/XUIKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/XUIKit.xcodeproj/xcshareddata/xcschemes/XUIKit.xcscheme b/XUIKit.xcodeproj/xcshareddata/xcschemes/XUIKit.xcscheme new file mode 100644 index 0000000..289980b --- /dev/null +++ b/XUIKit.xcodeproj/xcshareddata/xcschemes/XUIKit.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c8f7e46784e3cf6b74d25f98a75674caef6ff712 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Sun, 22 May 2016 23:20:11 +0100 Subject: [PATCH 2/4] Defines a module. --- XUIKit.xcodeproj/project.pbxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/XUIKit.xcodeproj/project.pbxproj b/XUIKit.xcodeproj/project.pbxproj index ecfbed3..2fa2f65 100644 --- a/XUIKit.xcodeproj/project.pbxproj +++ b/XUIKit.xcodeproj/project.pbxproj @@ -367,6 +367,7 @@ 55545A1214EC607B0074B45E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + DEFINES_MODULE = YES; ENABLE_TESTABILITY = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; @@ -376,6 +377,7 @@ 55545A1314EC607B0074B45E /* Profile */ = { isa = XCBuildConfiguration; buildSettings = { + DEFINES_MODULE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; }; name = Profile; @@ -383,6 +385,7 @@ 5579298314FEE20900FCDE7C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + DEFINES_MODULE = YES; MACOSX_DEPLOYMENT_TARGET = 10.7; }; name = Release; From cc0bbd4842a2f2dfe8cffc30b6a415b18f0e1524 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Sun, 22 May 2016 23:22:32 +0100 Subject: [PATCH 3/4] Adds Cocoa.h header imports to make module based importing happy. --- Source/XUIBezierPathAdditions.h | 2 ++ Source/XUIColorAdditions.h | 1 + Source/XUIFontAdditions.h | 2 ++ Source/XUIGeometry.h | 2 +- Source/XUIGraphics.h | 1 + Source/XUIImageAdditions.h | 3 +-- Source/XUIIndexPathAdditions.h | 4 +++- Source/XUIValueAdditions.h | 1 + Source/XUIView.h | 1 + Source/XUIViewAdditions.h | 1 + 10 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Source/XUIBezierPathAdditions.h b/Source/XUIBezierPathAdditions.h index 0d37d04..f80aa56 100644 --- a/Source/XUIBezierPathAdditions.h +++ b/Source/XUIBezierPathAdditions.h @@ -18,6 +18,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import + #import diff --git a/Source/XUIColorAdditions.h b/Source/XUIColorAdditions.h index 6a71f2b..f542bb9 100644 --- a/Source/XUIColorAdditions.h +++ b/Source/XUIColorAdditions.h @@ -18,6 +18,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import @interface NSColor (XUIKitAdditions) diff --git a/Source/XUIFontAdditions.h b/Source/XUIFontAdditions.h index f65d37c..eb73a29 100644 --- a/Source/XUIFontAdditions.h +++ b/Source/XUIFontAdditions.h @@ -18,6 +18,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import + @interface NSFont (XUIKitAdditions) + (NSArray *) familyNames; diff --git a/Source/XUIGeometry.h b/Source/XUIGeometry.h index a673e01..35cd80b 100644 --- a/Source/XUIGeometry.h +++ b/Source/XUIGeometry.h @@ -18,7 +18,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import #import diff --git a/Source/XUIGraphics.h b/Source/XUIGraphics.h index 7199a20..0e79bf9 100644 --- a/Source/XUIGraphics.h +++ b/Source/XUIGraphics.h @@ -18,6 +18,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import #import @class NSImage; diff --git a/Source/XUIImageAdditions.h b/Source/XUIImageAdditions.h index 2514e43..feaf94f 100644 --- a/Source/XUIImageAdditions.h +++ b/Source/XUIImageAdditions.h @@ -19,8 +19,7 @@ */ #import -#import - +#import @class CIImage; diff --git a/Source/XUIIndexPathAdditions.h b/Source/XUIIndexPathAdditions.h index 4895386..11cf26a 100644 --- a/Source/XUIIndexPathAdditions.h +++ b/Source/XUIIndexPathAdditions.h @@ -17,8 +17,10 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import + +#import @interface NSIndexPath (XUIKitAdditions) diff --git a/Source/XUIValueAdditions.h b/Source/XUIValueAdditions.h index 1100afb..222e0ca 100644 --- a/Source/XUIValueAdditions.h +++ b/Source/XUIValueAdditions.h @@ -18,6 +18,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import #import #import diff --git a/Source/XUIView.h b/Source/XUIView.h index 2c3d6a1..e05b08d 100644 --- a/Source/XUIView.h +++ b/Source/XUIView.h @@ -18,6 +18,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import #import #import #import diff --git a/Source/XUIViewAdditions.h b/Source/XUIViewAdditions.h index 20cb436..ee0b5a7 100644 --- a/Source/XUIViewAdditions.h +++ b/Source/XUIViewAdditions.h @@ -18,6 +18,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import #import From 887d9f9b2850024c841e21b53cc5b91591645f94 Mon Sep 17 00:00:00 2001 From: Matias Piipari Date: Sun, 22 May 2016 23:24:18 +0100 Subject: [PATCH 4/4] Limits to x86_64 and OSX 10.10 --- XUIKit.xcodeproj/project.pbxproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/XUIKit.xcodeproj/project.pbxproj b/XUIKit.xcodeproj/project.pbxproj index 2fa2f65..21b58cc 100644 --- a/XUIKit.xcodeproj/project.pbxproj +++ b/XUIKit.xcodeproj/project.pbxproj @@ -332,7 +332,9 @@ DYLIB_CURRENT_VERSION = 1; GCC_PREFIX_HEADER = Source/XUIKitPrefix.pch; MACH_O_TYPE = mh_dylib; + MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = com.iccir.XUIKit; + VALID_ARCHS = x86_64; }; name = Debug; }; @@ -346,7 +348,9 @@ DYLIB_CURRENT_VERSION = 1; GCC_PREFIX_HEADER = Source/XUIKitPrefix.pch; MACH_O_TYPE = mh_dylib; + MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = com.iccir.XUIKit; + VALID_ARCHS = x86_64; }; name = Profile; }; @@ -360,7 +364,9 @@ DYLIB_CURRENT_VERSION = 1; GCC_PREFIX_HEADER = Source/XUIKitPrefix.pch; MACH_O_TYPE = mh_dylib; + MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = com.iccir.XUIKit; + VALID_ARCHS = x86_64; }; name = Release; };