Skip to content

Commit

Permalink
Add SPM support
Browse files Browse the repository at this point in the history
  • Loading branch information
frederoni committed Jun 29, 2018
1 parent df3deff commit 3d46f9b
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
.DS_Store
build/
.build/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ before_script:
- export LANG=en_US.UTF-8
script:
- xcodebuild $ACTION -project Polyline.xcodeproj -scheme "$SCHEME" -destination "$DESTINATION" ONLY_ACTIVE_ARCH=NO
- swift build && swift test
env:
- SCHEME=Polyline ACTION=test DESTINATION='platform=iOS Simulator,name=iPhone 7,OS=10.1' ONLY_ACTIVE_ARCH=NO
- SCHEME=PolylineMac ACTION=test DESTINATION='platform=OS X'
- SCHEME=PolylineTV ACTION=test DESTINATION='platform=tvOS Simulator,name=Apple TV 1080p,OS=10.1'
- SCHEME=PolylineTV ACTION=test DESTINATION='platform=tvOS Simulator,name=Apple TV 1080p,OS=11.0'
- SCHEME=PolylineWatch ACTION=build DESTINATION='platform=watchOS Simulator,name=Apple Watch Series 2 - 42mm,OS=3.1'
28 changes: 28 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Polyline",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "Polyline",
targets: ["Polyline"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "Polyline",
dependencies: []),
.testTarget(
name: "PolylineTests",
dependencies: ["Polyline"]),
]
)
2 changes: 1 addition & 1 deletion Polyline.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Pod::Spec.new do |s|
# Not including the public_header_files will make all headers public.
#

s.source_files = "Polyline"
s.source_files = "Sources/Polyline"

# s.public_header_files = "Classes/**/*.h"

Expand Down
80 changes: 48 additions & 32 deletions Polyline.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

/* Begin PBXFileReference section */
207F63FE19B5DF7E005261FA /* Polyline.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Polyline.framework; sourceTree = BUILT_PRODUCTS_DIR; };
207F640219B5DF7E005261FA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
207F640219B5DF7E005261FA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../Info.plist; sourceTree = "<group>"; };
207F640319B5DF7E005261FA /* Polyline.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Polyline.h; sourceTree = "<group>"; };
207F640919B5DF7E005261FA /* PolylineTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PolylineTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
207F640C19B5DF7E005261FA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -133,10 +133,10 @@
207F63F419B5DF7E005261FA = {
isa = PBXGroup;
children = (
35A28A5720E284B20030D1D9 /* Tests */,
35A28A5420E283D10030D1D9 /* Sources */,
207F641C19B5EDC3005261FA /* README.md */,
207F641819B5E05A005261FA /* LICENSE.txt */,
207F640019B5DF7E005261FA /* Polyline */,
207F640A19B5DF7E005261FA /* PolylineTests */,
207F63FF19B5DF7E005261FA /* Products */,
);
sourceTree = "<group>";
Expand All @@ -155,40 +155,56 @@
name = Products;
sourceTree = "<group>";
};
207F640019B5DF7E005261FA /* Polyline */ = {
207F640A19B5DF7E005261FA /* PolylineTests */ = {
isa = PBXGroup;
children = (
207F640319B5DF7E005261FA /* Polyline.h */,
207F641A19B5E10C005261FA /* Polyline.swift */,
207F640119B5DF7E005261FA /* Supporting Files */,
207F640D19B5DF7E005261FA /* PolylineTests.swift */,
28DD887D1AA1280C001CC005 /* FunctionalPolylineTests.swift */,
207F640B19B5DF7E005261FA /* Supporting Files */,
);
path = Polyline;
path = PolylineTests;
sourceTree = "<group>";
};
207F640119B5DF7E005261FA /* Supporting Files */ = {
207F640B19B5DF7E005261FA /* Supporting Files */ = {
isa = PBXGroup;
children = (
207F640219B5DF7E005261FA /* Info.plist */,
207F640C19B5DF7E005261FA /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
207F640A19B5DF7E005261FA /* PolylineTests */ = {
35A28A5420E283D10030D1D9 /* Sources */ = {
isa = PBXGroup;
children = (
207F640D19B5DF7E005261FA /* PolylineTests.swift */,
28DD887D1AA1280C001CC005 /* FunctionalPolylineTests.swift */,
207F640B19B5DF7E005261FA /* Supporting Files */,
35A28A5520E283EA0030D1D9 /* Polyline */,
);
path = PolylineTests;
path = Sources;
sourceTree = "<group>";
};
207F640B19B5DF7E005261FA /* Supporting Files */ = {
35A28A5520E283EA0030D1D9 /* Polyline */ = {
isa = PBXGroup;
children = (
207F640C19B5DF7E005261FA /* Info.plist */,
207F640319B5DF7E005261FA /* Polyline.h */,
207F641A19B5E10C005261FA /* Polyline.swift */,
35A28A5620E283F90030D1D9 /* Supporting Files */,
);
name = "Supporting Files";
path = Polyline;
sourceTree = "<group>";
};
35A28A5620E283F90030D1D9 /* Supporting Files */ = {
isa = PBXGroup;
children = (
207F640219B5DF7E005261FA /* Info.plist */,
);
path = "Supporting Files";
sourceTree = "<group>";
};
35A28A5720E284B20030D1D9 /* Tests */ = {
isa = PBXGroup;
children = (
207F640A19B5DF7E005261FA /* PolylineTests */,
);
path = Tests;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -663,7 +679,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Polyline/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/Sources/Polyline/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.ramoapps.$(PRODUCT_NAME:rfc1034identifier)";
Expand All @@ -684,7 +700,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Polyline/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/Sources/Polyline/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.ramoapps.$(PRODUCT_NAME:rfc1034identifier)";
Expand All @@ -702,7 +718,7 @@
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = PolylineTests/Info.plist;
INFOPLIST_FILE = Tests/PolylineTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.ramoapps.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -713,7 +729,7 @@
207F641619B5DF7E005261FA /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = PolylineTests/Info.plist;
INFOPLIST_FILE = Tests/PolylineTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.ramoapps.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -734,7 +750,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "$(SRCROOT)/Polyline/Info.plist";
INFOPLIST_FILE = "$(SRCROOT)/Sources/Polyline/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramoapps.Polyline;
Expand All @@ -759,7 +775,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "$(SRCROOT)/Polyline/Info.plist";
INFOPLIST_FILE = "$(SRCROOT)/Sources/Polyline/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramoapps.Polyline;
Expand All @@ -778,7 +794,7 @@
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = PolylineTests/Info.plist;
INFOPLIST_FILE = Tests/PolylineTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramoapps.PolylineTests;
PRODUCT_NAME = PolylineTests;
Expand All @@ -796,7 +812,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = PolylineTests/Info.plist;
INFOPLIST_FILE = Tests/PolylineTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramoapps.PolylineTests;
PRODUCT_NAME = PolylineTests;
Expand All @@ -816,7 +832,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Polyline/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/Sources/Polyline/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramoapps.Polyline;
Expand All @@ -841,7 +857,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Polyline/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/Sources/Polyline/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramoapps.Polyline;
Expand All @@ -860,7 +876,7 @@
CLANG_ANALYZER_NONNULL = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = PolylineTests/Info.plist;
INFOPLIST_FILE = Tests/PolylineTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramoapps.PolylineTests;
PRODUCT_NAME = PolylineTests;
Expand All @@ -877,7 +893,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = PolylineTests/Info.plist;
INFOPLIST_FILE = Tests/PolylineTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramoapps.PolylineTests;
PRODUCT_NAME = PolylineTests;
Expand All @@ -899,7 +915,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Polyline/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/Sources/Polyline/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramoapps.Polyline;
Expand All @@ -925,7 +941,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = Polyline/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/Sources/Polyline/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramoapps.Polyline;
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ You can integrate Polyline in your `Cartfile` like this:
github "raphaelmor/Polyline" ~> 4.0
```

### Swift Package Manager
You can integrate Polyline using the [Swift Package Manager](https://swift.org/package-manager/), add the following package to the `dependencies` in your Package.swift file:

```swift
.Package(url: "https://github.com/raphaelmor/Polyline.git", .upToNextMinor(from: "4.0"))
```

### Manual

- Drag Polyline.swift inside your project tree.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import XCTest

import PolylineTests

var tests = [XCTestCaseEntry]()
tests += PolylineTests.allTests()
XCTMain(tests)
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions Tests/PolylineTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import XCTest

#if !os(macOS)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(PolylineTests.allTests),
]
}
#endif

0 comments on commit 3d46f9b

Please sign in to comment.