Skip to content

Commit 331d85d

Browse files
committed
Support Swift Package Manager
1 parent cc28684 commit 331d85d

File tree

7 files changed

+85
-31
lines changed

7 files changed

+85
-31
lines changed

.gitignore

+43-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Xcode
22
#
3+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4+
5+
## Build generated
36
build/
7+
DerivedData
8+
9+
## Various settings
410
*.pbxuser
511
!default.pbxuser
612
*.mode1v3
@@ -10,10 +16,44 @@ build/
1016
*.perspectivev3
1117
!default.perspectivev3
1218
xcuserdata
19+
20+
## Other
1321
*.xccheckout
1422
*.moved-aside
15-
DerivedData
23+
*.xcuserstate
24+
*.xcscmblueprint
25+
26+
## Obj-C/Swift specific
1627
*.hmap
1728
*.ipa
18-
*.xcuserstate
19-
.DS_Store
29+
30+
# Swift Package Manager
31+
#
32+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
33+
# Packages/
34+
.build/
35+
36+
# CocoaPods
37+
#
38+
# We recommend against adding the Pods directory to your .gitignore. However
39+
# you should judge for yourself, the pros and cons are mentioned at:
40+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
41+
#
42+
# Pods/
43+
44+
# Carthage
45+
#
46+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
47+
# Carthage/Checkouts
48+
49+
Carthage/Build
50+
51+
# fastlane
52+
#
53+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
54+
# screenshots whenever they are needed.
55+
# For more information about the recommended setup visit:
56+
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
57+
58+
fastlane/report.xml
59+
fastlane/screenshots
File renamed without changes.
File renamed without changes.

Package.swift

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright (c) 2016 Indragie Karunaratne. All rights reserved.
2+
// Licensed under the MIT license, see LICENSE file for more info.
3+
4+
import PackageDescription
5+
6+
let package = Package(name: "SwiftAutoLayout")

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ You may notice that this looks a lot like the linear equation that a constraint
1919
2020
SwiftAutoLayout allows you to more effectively communicate the intent of a constraint by making the syntax more similar to the equation that it represents.
2121

22+
### Installing
23+
24+
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.
25+
2226
### Attributes
2327

2428
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.
File renamed without changes.

SwiftAutoLayout.xcodeproj/project.pbxproj

+32-28
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
725A2B381A0468F300F44058 /* SwiftAutoLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 725A2B371A0468F300F44058 /* SwiftAutoLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
1110
725A2B3E1A0468F300F44058 /* SwiftAutoLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 725A2B321A0468F300F44058 /* SwiftAutoLayout.framework */; };
1211
725A2B451A0468F300F44058 /* SwiftAutoLayoutTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 725A2B441A0468F300F44058 /* SwiftAutoLayoutTests.swift */; };
13-
725A2B4F1A04695300F44058 /* SwiftAutoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 725A2B4E1A04695300F44058 /* SwiftAutoLayout.swift */; };
14-
725A2B6E1A046A8000F44058 /* SwiftAutoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 725A2B4E1A04695300F44058 /* SwiftAutoLayout.swift */; };
15-
725A2B6F1A046A8600F44058 /* SwiftAutoLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 725A2B371A0468F300F44058 /* SwiftAutoLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
12+
725B5E6C1C40C5B100ABF520 /* SwiftAutoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 725B5E6B1C40C5B100ABF520 /* SwiftAutoLayout.swift */; };
13+
725B5E6D1C40C5B100ABF520 /* SwiftAutoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 725B5E6B1C40C5B100ABF520 /* SwiftAutoLayout.swift */; };
14+
725B5E731C40C5BB00ABF520 /* SwiftAutoLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 725B5E701C40C5BB00ABF520 /* SwiftAutoLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
15+
725B5E741C40C5BB00ABF520 /* SwiftAutoLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 725B5E701C40C5BB00ABF520 /* SwiftAutoLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
1616
/* End PBXBuildFile section */
1717

1818
/* Begin PBXContainerItemProxy section */
@@ -27,13 +27,13 @@
2727

2828
/* Begin PBXFileReference section */
2929
725A2B321A0468F300F44058 /* SwiftAutoLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftAutoLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; };
30-
725A2B361A0468F300F44058 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
31-
725A2B371A0468F300F44058 /* SwiftAutoLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftAutoLayout.h; sourceTree = "<group>"; };
3230
725A2B3D1A0468F300F44058 /* SwiftAutoLayoutTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftAutoLayoutTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3331
725A2B431A0468F300F44058 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3432
725A2B441A0468F300F44058 /* SwiftAutoLayoutTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftAutoLayoutTests.swift; sourceTree = "<group>"; };
35-
725A2B4E1A04695300F44058 /* SwiftAutoLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftAutoLayout.swift; sourceTree = "<group>"; };
3633
725A2B551A046A3C00F44058 /* SwiftAutoLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftAutoLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; };
34+
725B5E6B1C40C5B100ABF520 /* SwiftAutoLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftAutoLayout.swift; path = Sources/SwiftAutoLayout.swift; sourceTree = SOURCE_ROOT; };
35+
725B5E6F1C40C5BB00ABF520 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Framework/Info.plist; sourceTree = "<group>"; };
36+
725B5E701C40C5BB00ABF520 /* SwiftAutoLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SwiftAutoLayout.h; path = Framework/SwiftAutoLayout.h; sourceTree = "<group>"; };
3737
/* End PBXFileReference section */
3838

3939
/* Begin PBXFrameworksBuildPhase section */
@@ -65,7 +65,8 @@
6565
725A2B281A0468F300F44058 = {
6666
isa = PBXGroup;
6767
children = (
68-
725A2B341A0468F300F44058 /* SwiftAutoLayout */,
68+
725B5E6E1C40C5B300ABF520 /* Framework */,
69+
725A2B341A0468F300F44058 /* Sources */,
6970
725A2B411A0468F300F44058 /* SwiftAutoLayoutTests */,
7071
725A2B331A0468F300F44058 /* Products */,
7172
);
@@ -81,24 +82,15 @@
8182
name = Products;
8283
sourceTree = "<group>";
8384
};
84-
725A2B341A0468F300F44058 /* SwiftAutoLayout */ = {
85+
725A2B341A0468F300F44058 /* Sources */ = {
8586
isa = PBXGroup;
8687
children = (
87-
725A2B371A0468F300F44058 /* SwiftAutoLayout.h */,
88-
725A2B4E1A04695300F44058 /* SwiftAutoLayout.swift */,
89-
725A2B351A0468F300F44058 /* Supporting Files */,
88+
725B5E6B1C40C5B100ABF520 /* SwiftAutoLayout.swift */,
9089
);
90+
name = Sources;
9191
path = SwiftAutoLayout;
9292
sourceTree = "<group>";
9393
};
94-
725A2B351A0468F300F44058 /* Supporting Files */ = {
95-
isa = PBXGroup;
96-
children = (
97-
725A2B361A0468F300F44058 /* Info.plist */,
98-
);
99-
name = "Supporting Files";
100-
sourceTree = "<group>";
101-
};
10294
725A2B411A0468F300F44058 /* SwiftAutoLayoutTests */ = {
10395
isa = PBXGroup;
10496
children = (
@@ -116,22 +108,31 @@
116108
name = "Supporting Files";
117109
sourceTree = "<group>";
118110
};
111+
725B5E6E1C40C5B300ABF520 /* Framework */ = {
112+
isa = PBXGroup;
113+
children = (
114+
725B5E6F1C40C5BB00ABF520 /* Info.plist */,
115+
725B5E701C40C5BB00ABF520 /* SwiftAutoLayout.h */,
116+
);
117+
name = Framework;
118+
sourceTree = "<group>";
119+
};
119120
/* End PBXGroup section */
120121

121122
/* Begin PBXHeadersBuildPhase section */
122123
725A2B2F1A0468F300F44058 /* Headers */ = {
123124
isa = PBXHeadersBuildPhase;
124125
buildActionMask = 2147483647;
125126
files = (
126-
725A2B381A0468F300F44058 /* SwiftAutoLayout.h in Headers */,
127+
725B5E731C40C5BB00ABF520 /* SwiftAutoLayout.h in Headers */,
127128
);
128129
runOnlyForDeploymentPostprocessing = 0;
129130
};
130131
725A2B521A046A3C00F44058 /* Headers */ = {
131132
isa = PBXHeadersBuildPhase;
132133
buildActionMask = 2147483647;
133134
files = (
134-
725A2B6F1A046A8600F44058 /* SwiftAutoLayout.h in Headers */,
135+
725B5E741C40C5BB00ABF520 /* SwiftAutoLayout.h in Headers */,
135136
);
136137
runOnlyForDeploymentPostprocessing = 0;
137138
};
@@ -261,7 +262,7 @@
261262
isa = PBXSourcesBuildPhase;
262263
buildActionMask = 2147483647;
263264
files = (
264-
725A2B4F1A04695300F44058 /* SwiftAutoLayout.swift in Sources */,
265+
725B5E6C1C40C5B100ABF520 /* SwiftAutoLayout.swift in Sources */,
265266
);
266267
runOnlyForDeploymentPostprocessing = 0;
267268
};
@@ -277,7 +278,7 @@
277278
isa = PBXSourcesBuildPhase;
278279
buildActionMask = 2147483647;
279280
files = (
280-
725A2B6E1A046A8000F44058 /* SwiftAutoLayout.swift in Sources */,
281+
725B5E6D1C40C5B100ABF520 /* SwiftAutoLayout.swift in Sources */,
281282
);
282283
runOnlyForDeploymentPostprocessing = 0;
283284
};
@@ -387,7 +388,7 @@
387388
DYLIB_COMPATIBILITY_VERSION = 1;
388389
DYLIB_CURRENT_VERSION = 1;
389390
DYLIB_INSTALL_NAME_BASE = "@rpath";
390-
INFOPLIST_FILE = SwiftAutoLayout/Info.plist;
391+
INFOPLIST_FILE = Framework/Info.plist;
391392
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
392393
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
393394
PRODUCT_BUNDLE_IDENTIFIER = "com.indragie.$(PRODUCT_NAME:rfc1034identifier)";
@@ -406,7 +407,7 @@
406407
DYLIB_COMPATIBILITY_VERSION = 1;
407408
DYLIB_CURRENT_VERSION = 1;
408409
DYLIB_INSTALL_NAME_BASE = "@rpath";
409-
INFOPLIST_FILE = SwiftAutoLayout/Info.plist;
410+
INFOPLIST_FILE = Framework/Info.plist;
410411
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
411412
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
412413
PRODUCT_BUNDLE_IDENTIFIER = "com.indragie.$(PRODUCT_NAME:rfc1034identifier)";
@@ -450,6 +451,7 @@
450451
725A2B691A046A3C00F44058 /* Debug */ = {
451452
isa = XCBuildConfiguration;
452453
buildSettings = {
454+
CLANG_ENABLE_MODULES = YES;
453455
COMBINE_HIDPI_IMAGES = YES;
454456
DEFINES_MODULE = YES;
455457
DSTROOT = "/tmp/$(TARGET_NAME).dst";
@@ -461,20 +463,22 @@
461463
"DEBUG=1",
462464
"$(inherited)",
463465
);
464-
INFOPLIST_FILE = SwiftAutoLayout/Info.plist;
466+
INFOPLIST_FILE = Framework/Info.plist;
465467
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
466468
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
467469
MACOSX_DEPLOYMENT_TARGET = 10.10;
468470
PRODUCT_BUNDLE_IDENTIFIER = "com.indragie.$(PRODUCT_NAME:rfc1034identifier)";
469471
PRODUCT_NAME = "$(PROJECT_NAME)";
470472
SDKROOT = macosx;
471473
SKIP_INSTALL = YES;
474+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
472475
};
473476
name = Debug;
474477
};
475478
725A2B6A1A046A3C00F44058 /* Release */ = {
476479
isa = XCBuildConfiguration;
477480
buildSettings = {
481+
CLANG_ENABLE_MODULES = YES;
478482
COMBINE_HIDPI_IMAGES = YES;
479483
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
480484
DEFINES_MODULE = YES;
@@ -483,7 +487,7 @@
483487
DYLIB_CURRENT_VERSION = 1;
484488
DYLIB_INSTALL_NAME_BASE = "@rpath";
485489
FRAMEWORK_VERSION = A;
486-
INFOPLIST_FILE = SwiftAutoLayout/Info.plist;
490+
INFOPLIST_FILE = Framework/Info.plist;
487491
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
488492
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
489493
MACOSX_DEPLOYMENT_TARGET = 10.10;

0 commit comments

Comments
 (0)