Skip to content

Commit f889574

Browse files
authored
Merge pull request #19 from emirandm/master
SPM Support
2 parents 333a44f + dc44ab2 commit f889574

14 files changed

+68
-10
lines changed

Package.swift

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// swift-tools-version:5.3
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "Swiftstraints",
8+
platforms: [.iOS(.v9), .tvOS(.v9)],
9+
products: [
10+
// Products define the executables and libraries a package produces, and make them visible to other packages.
11+
.library(
12+
name: "Swiftstraints",
13+
targets: ["Swiftstraints"]),
14+
],
15+
dependencies: [
16+
// Dependencies declare other packages that this package depends on.
17+
// .package(url: /* package url */, from: "1.0.0"),
18+
],
19+
targets: [
20+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
21+
// Targets can depend on other targets in this package, and on products in packages this package depends on.
22+
.target(
23+
name: "Swiftstraints",
24+
dependencies: [],
25+
path: "Sources",
26+
exclude: ["Info.plist"]
27+
),
28+
.testTarget(
29+
name: "SwiftstraintsTests",
30+
dependencies: ["Swiftstraints"],
31+
path: "Tests"),
32+
]
33+
)

Swiftstraints/AxisAnchor.swift renamed to Sources/Swiftstraints/AxisAnchor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
import Foundation
10+
import UIKit
1011

1112
@available(iOS 9.0, *)
1213
public protocol AxisAnchor {

Swiftstraints/DimensionAnchor.swift renamed to Sources/Swiftstraints/DimensionAnchor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
import Foundation
10+
import UIKit
1011

1112
@available(iOS 9.0, *)
1213
public protocol DimensionAnchor {
File renamed without changes.

Swiftstraints/LayoutPriority.swift renamed to Sources/Swiftstraints/LayoutPriority.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright © 2016 Skyvive. All rights reserved.
77
//
88

9+
import UIKit
10+
911
public enum LayoutPriority {
1012

1113
case required

Swiftstraints/NSLayoutConstraint+Extensions.swift renamed to Sources/Swiftstraints/NSLayoutConstraint+Extensions.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright © 2016 Skyvive. All rights reserved.
77
//
88

9+
import UIKit
10+
911
extension NSLayoutConstraint {
1012

1113
func priority(_ priority: LayoutPriority) -> Self {
File renamed without changes.

Swiftstraints/VisualFormatLanguage.swift renamed to Sources/Swiftstraints/VisualFormatLanguage.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
import Foundation
10+
import UIKit
1011

1112
private func vflKey(_ object: AnyObject) -> String {
1213
return "A\(UInt(bitPattern: Unmanaged.passUnretained(object).toOpaque().hashValue))B"

Swiftstraints.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Swiftstraints"
3-
s.version = "5.0.0"
3+
s.version = "5.1.0"
44
s.summary = "Auto Layout Made Easy"
55
s.description = <<-DESC
66
Write auto layout constraints in a single line of code.

Swiftstraints.xcodeproj/project.pbxproj

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@
8686
A2611A661B01B2980032CB53 = {
8787
isa = PBXGroup;
8888
children = (
89+
C79AC63025599BBE003DF3A7 /* Sources */,
90+
C79AC63125599BCD003DF3A7 /* Tests */,
8991
A2C4CA0D1B02865C00A4DC56 /* Swiftstraints.podspec */,
90-
A2611A721B01B2980032CB53 /* Swiftstraints */,
91-
A2611A7F1B01B2980032CB53 /* SwiftstraintsTests */,
9292
A2611A711B01B2980032CB53 /* Products */,
9393
);
9494
sourceTree = "<group>";
@@ -144,6 +144,22 @@
144144
name = "Supporting Files";
145145
sourceTree = "<group>";
146146
};
147+
C79AC63025599BBE003DF3A7 /* Sources */ = {
148+
isa = PBXGroup;
149+
children = (
150+
A2611A721B01B2980032CB53 /* Swiftstraints */,
151+
);
152+
path = Sources;
153+
sourceTree = "<group>";
154+
};
155+
C79AC63125599BCD003DF3A7 /* Tests */ = {
156+
isa = PBXGroup;
157+
children = (
158+
A2611A7F1B01B2980032CB53 /* SwiftstraintsTests */,
159+
);
160+
path = Tests;
161+
sourceTree = "<group>";
162+
};
147163
/* End PBXGroup section */
148164

149165
/* Begin PBXHeadersBuildPhase section */
@@ -458,7 +474,7 @@
458474
DYLIB_COMPATIBILITY_VERSION = 1;
459475
DYLIB_CURRENT_VERSION = 1;
460476
DYLIB_INSTALL_NAME_BASE = "@rpath";
461-
INFOPLIST_FILE = Swiftstraints/Info.plist;
477+
INFOPLIST_FILE = Sources/Swiftstraints/Info.plist;
462478
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
463479
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
464480
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -480,7 +496,7 @@
480496
DYLIB_COMPATIBILITY_VERSION = 1;
481497
DYLIB_CURRENT_VERSION = 1;
482498
DYLIB_INSTALL_NAME_BASE = "@rpath";
483-
INFOPLIST_FILE = Swiftstraints/Info.plist;
499+
INFOPLIST_FILE = Sources/Swiftstraints/Info.plist;
484500
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
485501
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
486502
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -500,7 +516,7 @@
500516
"DEBUG=1",
501517
"$(inherited)",
502518
);
503-
INFOPLIST_FILE = SwiftstraintsTests/Info.plist;
519+
INFOPLIST_FILE = Tests/SwiftstraintsTests/Info.plist;
504520
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
505521
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
506522
PRODUCT_BUNDLE_IDENTIFIER = "com.skyvive.$(PRODUCT_NAME:rfc1034identifier)";
@@ -513,7 +529,7 @@
513529
isa = XCBuildConfiguration;
514530
buildSettings = {
515531
FRAMEWORK_SEARCH_PATHS = "";
516-
INFOPLIST_FILE = SwiftstraintsTests/Info.plist;
532+
INFOPLIST_FILE = Tests/SwiftstraintsTests/Info.plist;
517533
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
518534
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
519535
PRODUCT_BUNDLE_IDENTIFIER = "com.skyvive.$(PRODUCT_NAME:rfc1034identifier)";
@@ -532,7 +548,7 @@
532548
DYLIB_COMPATIBILITY_VERSION = 1;
533549
DYLIB_CURRENT_VERSION = 1;
534550
DYLIB_INSTALL_NAME_BASE = "@rpath";
535-
INFOPLIST_FILE = Swiftstraints/Info.plist;
551+
INFOPLIST_FILE = Sources/Swiftstraints/Info.plist;
536552
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
537553
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
538554
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
@@ -557,7 +573,7 @@
557573
DYLIB_COMPATIBILITY_VERSION = 1;
558574
DYLIB_CURRENT_VERSION = 1;
559575
DYLIB_INSTALL_NAME_BASE = "@rpath";
560-
INFOPLIST_FILE = Swiftstraints/Info.plist;
576+
INFOPLIST_FILE = Sources/Swiftstraints/Info.plist;
561577
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
562578
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
563579
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
File renamed without changes.

SwiftstraintsTests/SwiftstraintsTests.swift renamed to Tests/SwiftstraintsTests/SwiftstraintsTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
// Created by Bradley Hilton on 5/11/15.
66
// Copyright (c) 2015 Skyvive. All rights reserved.
77
//
8+
#if canImport(UIKit)
89

910
import UIKit
1011
import XCTest
11-
import Swiftstraints
12+
@testable import Swiftstraints
1213

1314
func == (lh: NSLayoutConstraint, rh: NSLayoutConstraint) -> Bool {
1415
return lh.firstItem === rh.firstItem &&
@@ -139,3 +140,4 @@ class SwiftstraintsTests: XCTestCase {
139140
}
140141

141142
}
143+
#endif

0 commit comments

Comments
 (0)