Skip to content

Commit

Permalink
Support Swift Package Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
indragiek committed Jan 9, 2016
1 parent cc28684 commit 331d85d
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 31 deletions.
46 changes: 43 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -10,10 +16,44 @@ build/
*.perspectivev3
!default.perspectivev3
xcuserdata

## Other
*.xccheckout
*.moved-aside
DerivedData
*.xcuserstate
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.xcuserstate
.DS_Store

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md

fastlane/report.xml
fastlane/screenshots
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) 2016 Indragie Karunaratne. All rights reserved.
// Licensed under the MIT license, see LICENSE file for more info.

import PackageDescription

let package = Package(name: "SwiftAutoLayout")
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ You may notice that this looks a lot like the linear equation that a constraint
SwiftAutoLayout allows you to more effectively communicate the intent of a constraint by making the syntax more similar to the equation that it represents.

### Installing

Use [Swift Package Manager](https://github.com/apple/swift-package-manager) or add `SwiftAutoLayout.xcodeproj` as a subproject and link against either `SwiftAutoLayout-iOS.framework` or `SwiftAutoLayout-Mac.framework` depending on the platform.

### Attributes

Layout attributes are defined as properties added in extensions of `UIView` and `UILayoutGuide` on iOS and `NSView` and `NSLayoutGuide` on OS X. For example, `UIView.width` and `UIView.height` represent `NSLayoutAttribute.Width` and `NSLayoutAttribute.Height`, respectively.
Expand Down
File renamed without changes.
60 changes: 32 additions & 28 deletions SwiftAutoLayout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
objects = {

/* Begin PBXBuildFile section */
725A2B381A0468F300F44058 /* SwiftAutoLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 725A2B371A0468F300F44058 /* SwiftAutoLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
725A2B3E1A0468F300F44058 /* SwiftAutoLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 725A2B321A0468F300F44058 /* SwiftAutoLayout.framework */; };
725A2B451A0468F300F44058 /* SwiftAutoLayoutTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 725A2B441A0468F300F44058 /* SwiftAutoLayoutTests.swift */; };
725A2B4F1A04695300F44058 /* SwiftAutoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 725A2B4E1A04695300F44058 /* SwiftAutoLayout.swift */; };
725A2B6E1A046A8000F44058 /* SwiftAutoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 725A2B4E1A04695300F44058 /* SwiftAutoLayout.swift */; };
725A2B6F1A046A8600F44058 /* SwiftAutoLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 725A2B371A0468F300F44058 /* SwiftAutoLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
725B5E6C1C40C5B100ABF520 /* SwiftAutoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 725B5E6B1C40C5B100ABF520 /* SwiftAutoLayout.swift */; };
725B5E6D1C40C5B100ABF520 /* SwiftAutoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 725B5E6B1C40C5B100ABF520 /* SwiftAutoLayout.swift */; };
725B5E731C40C5BB00ABF520 /* SwiftAutoLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 725B5E701C40C5BB00ABF520 /* SwiftAutoLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
725B5E741C40C5BB00ABF520 /* SwiftAutoLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 725B5E701C40C5BB00ABF520 /* SwiftAutoLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -27,13 +27,13 @@

/* Begin PBXFileReference section */
725A2B321A0468F300F44058 /* SwiftAutoLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftAutoLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; };
725A2B361A0468F300F44058 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
725A2B371A0468F300F44058 /* SwiftAutoLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftAutoLayout.h; sourceTree = "<group>"; };
725A2B3D1A0468F300F44058 /* SwiftAutoLayoutTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftAutoLayoutTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
725A2B431A0468F300F44058 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
725A2B441A0468F300F44058 /* SwiftAutoLayoutTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftAutoLayoutTests.swift; sourceTree = "<group>"; };
725A2B4E1A04695300F44058 /* SwiftAutoLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftAutoLayout.swift; sourceTree = "<group>"; };
725A2B551A046A3C00F44058 /* SwiftAutoLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftAutoLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; };
725B5E6B1C40C5B100ABF520 /* SwiftAutoLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftAutoLayout.swift; path = Sources/SwiftAutoLayout.swift; sourceTree = SOURCE_ROOT; };
725B5E6F1C40C5BB00ABF520 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Framework/Info.plist; sourceTree = "<group>"; };
725B5E701C40C5BB00ABF520 /* SwiftAutoLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SwiftAutoLayout.h; path = Framework/SwiftAutoLayout.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -65,7 +65,8 @@
725A2B281A0468F300F44058 = {
isa = PBXGroup;
children = (
725A2B341A0468F300F44058 /* SwiftAutoLayout */,
725B5E6E1C40C5B300ABF520 /* Framework */,
725A2B341A0468F300F44058 /* Sources */,
725A2B411A0468F300F44058 /* SwiftAutoLayoutTests */,
725A2B331A0468F300F44058 /* Products */,
);
Expand All @@ -81,24 +82,15 @@
name = Products;
sourceTree = "<group>";
};
725A2B341A0468F300F44058 /* SwiftAutoLayout */ = {
725A2B341A0468F300F44058 /* Sources */ = {
isa = PBXGroup;
children = (
725A2B371A0468F300F44058 /* SwiftAutoLayout.h */,
725A2B4E1A04695300F44058 /* SwiftAutoLayout.swift */,
725A2B351A0468F300F44058 /* Supporting Files */,
725B5E6B1C40C5B100ABF520 /* SwiftAutoLayout.swift */,
);
name = Sources;
path = SwiftAutoLayout;
sourceTree = "<group>";
};
725A2B351A0468F300F44058 /* Supporting Files */ = {
isa = PBXGroup;
children = (
725A2B361A0468F300F44058 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
725A2B411A0468F300F44058 /* SwiftAutoLayoutTests */ = {
isa = PBXGroup;
children = (
Expand All @@ -116,22 +108,31 @@
name = "Supporting Files";
sourceTree = "<group>";
};
725B5E6E1C40C5B300ABF520 /* Framework */ = {
isa = PBXGroup;
children = (
725B5E6F1C40C5BB00ABF520 /* Info.plist */,
725B5E701C40C5BB00ABF520 /* SwiftAutoLayout.h */,
);
name = Framework;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
725A2B2F1A0468F300F44058 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
725A2B381A0468F300F44058 /* SwiftAutoLayout.h in Headers */,
725B5E731C40C5BB00ABF520 /* SwiftAutoLayout.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
725A2B521A046A3C00F44058 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
725A2B6F1A046A8600F44058 /* SwiftAutoLayout.h in Headers */,
725B5E741C40C5BB00ABF520 /* SwiftAutoLayout.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -261,7 +262,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
725A2B4F1A04695300F44058 /* SwiftAutoLayout.swift in Sources */,
725B5E6C1C40C5B100ABF520 /* SwiftAutoLayout.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -277,7 +278,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
725A2B6E1A046A8000F44058 /* SwiftAutoLayout.swift in Sources */,
725B5E6D1C40C5B100ABF520 /* SwiftAutoLayout.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -387,7 +388,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SwiftAutoLayout/Info.plist;
INFOPLIST_FILE = Framework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.indragie.$(PRODUCT_NAME:rfc1034identifier)";
Expand All @@ -406,7 +407,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SwiftAutoLayout/Info.plist;
INFOPLIST_FILE = Framework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.indragie.$(PRODUCT_NAME:rfc1034identifier)";
Expand Down Expand Up @@ -450,6 +451,7 @@
725A2B691A046A3C00F44058 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DSTROOT = "/tmp/$(TARGET_NAME).dst";
Expand All @@ -461,20 +463,22 @@
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = SwiftAutoLayout/Info.plist;
INFOPLIST_FILE = Framework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = "com.indragie.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(PROJECT_NAME)";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
725A2B6A1A046A3C00F44058 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
Expand All @@ -483,7 +487,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = SwiftAutoLayout/Info.plist;
INFOPLIST_FILE = Framework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
Expand Down

0 comments on commit 331d85d

Please sign in to comment.