Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Swift Package Manager support #312

Merged
merged 1 commit into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ Doc/
Pods
/Podfile.lock
Carthage/
/.build
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@


## Unreleased
* **bugfix** Fixed an issue with `WKWebView` on iOS not returning a user agent string [#322](https://github.com/matomo-org/matomo-sdk-ios/issues/322)

## 7.0.3
* **feature** Added support for the Swift Package Manager. [#312](https://github.com/matomo-org/matomo-sdk-ios/pull/312)
* **improvement** Added new devices info [#321](https://github.com/matomo-org/matomo-sdk-ios/pull/321)

## 7.0.2
* **improvement** Added `timeout` property to URLSessionDispatcher initialization method
* **bugfix** Fixed an issue with `WKWebView` on iOS not returning a user agent string [#322](https://github.com/matomo-org/matomo-sdk-ios/issues/322)

## 7.0.1
* **bugfix** Fixed an issue with a new `forcedVisitorId` value validation. [#315](https://github.com/matomo-org/matomo-sdk-ios/pull/315)
Expand Down
4 changes: 4 additions & 0 deletions MatomoTracker/Application.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#if SWIFT_PACKAGE
import Foundation
#endif

public struct Application {
/// Creates an returns a new application object representing the current application
public static func makeCurrentApplication() -> Application {
Expand Down
17 changes: 17 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// swift-tools-version:5.0
//
// MatomoTracker
//

import PackageDescription

let package = Package(
name: "MatomoTracker",
products: [
.library(name: "MatomoTracker", targets: ["MatomoTracker"])
],
targets: [
.target(name: "MatomoTracker", dependencies: [], path: "MatomoTracker"),
],
swiftLanguageVersions: [.v5]
)
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ namespace :package_manager do
sh("carthage build --no-skip-current") rescue nil
package_manager_failed('Carthage integration') unless $?.success?
end

desc 'Builds the project with the Swift Package Manager'
task spm: :prepare do
sh("swift build") rescue nil
package_manager_failed('Swift Package Manager') unless $?.success?
end
end


Expand All @@ -56,6 +62,7 @@ end
desc 'Check the integration of MatomoTracker with package managers'
task :build_with_package_manager do
Rake::Task['package_manager:carthage'].invoke
Rake::Task['package_manager:spm'].invoke
end

task default: 'test'
Expand Down