From 01124b9f325dc48f72707b56781a82ad0b4174c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Sat, 19 May 2018 05:47:52 +0100 Subject: [PATCH] Add Swift Package Manager support (#501) --- .gitignore | 1 + Package.swift | 10 +++++++++- SnapKit.xcodeproj/project.pbxproj | 8 ++++---- Tests/{ => SnapKitTests}/Info.plist | 0 Tests/{ => SnapKitTests}/Tests.swift | 0 5 files changed, 14 insertions(+), 5 deletions(-) rename Tests/{ => SnapKitTests}/Info.plist (100%) rename Tests/{ => SnapKitTests}/Tests.swift (100%) diff --git a/.gitignore b/.gitignore index c0dbc2e..79fa0df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.build/ project.xcworkspace xcuserdata Examples/ diff --git a/Package.swift b/Package.swift index 2e87314..321d426 100644 --- a/Package.swift +++ b/Package.swift @@ -1,3 +1,4 @@ +// swift-tools-version:4.0 // // SnapKit // @@ -25,5 +26,12 @@ import PackageDescription let package = Package( - name: "SnapKit" + name: "SnapKit", + products: [ + .library(name: "SnapKit", targets: ["SnapKit"]), + ], + targets: [ + .target(name: "SnapKit", path: "Source"), + .testTarget(name: "SnapKitTests", dependencies: ["SnapKit"]), + ] ) diff --git a/SnapKit.xcodeproj/project.pbxproj b/SnapKit.xcodeproj/project.pbxproj index 58f9b93..b0193f2 100644 --- a/SnapKit.xcodeproj/project.pbxproj +++ b/SnapKit.xcodeproj/project.pbxproj @@ -82,8 +82,8 @@ EEBCC9E219CC627E0083B827 /* SnapKit Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SnapKit Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; EECDB3641AC0C95C006BBC11 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; EECDB3661AC0C95C006BBC11 /* SnapKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SnapKit.h; sourceTree = ""; }; - EECDB3691AC0C95C006BBC11 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EECDB36A1AC0C95C006BBC11 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; + EECDB3691AC0C95C006BBC11 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = SnapKitTests/Info.plist; sourceTree = ""; }; + EECDB36A1AC0C95C006BBC11 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Tests.swift; path = SnapKitTests/Tests.swift; sourceTree = ""; }; EEF68F9D1D78492400980C26 /* ConstraintLayoutGuideDSL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintLayoutGuideDSL.swift; sourceTree = ""; }; EEF68FA51D784A5300980C26 /* ConstraintDSL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintDSL.swift; sourceTree = ""; }; EEF68FAF1D784FB100980C26 /* ConstraintLayoutGuide+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ConstraintLayoutGuide+Extensions.swift"; sourceTree = ""; }; @@ -559,7 +559,7 @@ buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/Tests/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Tests/SnapKitTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -572,7 +572,7 @@ buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/Tests/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Tests/SnapKitTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.snapkit.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Tests/Info.plist b/Tests/SnapKitTests/Info.plist similarity index 100% rename from Tests/Info.plist rename to Tests/SnapKitTests/Info.plist diff --git a/Tests/Tests.swift b/Tests/SnapKitTests/Tests.swift similarity index 100% rename from Tests/Tests.swift rename to Tests/SnapKitTests/Tests.swift