diff --git a/.gitignore b/.gitignore index 93c86d3..8e6acba 100644 --- a/.gitignore +++ b/.gitignore @@ -27,10 +27,13 @@ DerivedData Carthage/Build +# Swift Package Manager +.build/ + # 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-ignore-the-pods-directory-in-source-control -# +# # Note: if you ignore the Pods directory, make sure to uncomment # `pod install` in .travis.yml # diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..c470f6b --- /dev/null +++ b/Package.swift @@ -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: "ProxyResolver", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "ProxyResolver", + targets: ["ProxyResolver"]), + ], + dependencies: [], + 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: "ProxyResolver", + dependencies: [], + path: "./ProxyResolver/Classes/" + ), + .testTarget( + name: "ProxyResolverTests", + dependencies: ["ProxyResolver"], + path: "./Example/Tests/"), + ] +) diff --git a/ProxyResolver/Classes/Internal/Types.swift b/ProxyResolver/Classes/Internal/Types.swift index 42c3f7d..cfb4f62 100644 --- a/ProxyResolver/Classes/Internal/Types.swift +++ b/ProxyResolver/Classes/Internal/Types.swift @@ -1,10 +1,12 @@ // // Types.swift -// Pods-ProxyResolver_Tests +// ProxyResolver // // Created by Mikhail Churbanov on 11/06/2018. // +import Foundation + enum ConfigProxyType { case none case autoConfigurationUrl diff --git a/ProxyResolver/Classes/ProxyResolver.swift b/ProxyResolver/Classes/ProxyResolver.swift index 6f0a72e..85e9e11 100644 --- a/ProxyResolver/Classes/ProxyResolver.swift +++ b/ProxyResolver/Classes/ProxyResolver.swift @@ -1,6 +1,6 @@ // // ProxyResolver.swift -// ProxyConfig +// ProxyResolver // // Created by Mikhail Churbanov on 16/04/2018. // Copyright © 2018 Mikhail Churbanov. All rights reserved. diff --git a/README.md b/README.md index 1e4bd3b..df4aeda 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # ProxyResolver -![Swift](https://img.shields.io/badge/Swift-4.1-green.svg) [![CI Status](https://img.shields.io/travis/rinold/ProxyResolver.svg?style=flat)](https://travis-ci.org/rinold/ProxyResolver) +![Swift](https://img.shields.io/badge/swift-4.1-green.svg) [![Version](https://img.shields.io/cocoapods/v/ProxyResolver.svg?style=flat)](https://cocoapods.org/pods/ProxyResolver) +![Carthage](https://img.shields.io/badge/carthage-+-orange.svg) +![Carthage](https://img.shields.io/badge/spm-+-orange.svg) [![License](https://img.shields.io/cocoapods/l/ProxyResolver.svg?style=flat)](https://cocoapods.org/pods/ProxyResolver) [![Platform](https://img.shields.io/cocoapods/p/ProxyResolver.svg?style=flat)](https://cocoapods.org/pods/ProxyResolver) @@ -17,7 +19,7 @@ import ProxyResolver let proxy = ProxyResolver() let url = URL(string: "https://github.com")! - proxy.resolve(for: url) { result in +proxy.resolve(for: url) { result in switch result { case .direct: // Direct connection allowed - no proxy required