Updated to work with SPM
This commit is contained in:
parent
e5f5b5f541
commit
728bde8133
|
@ -27,6 +27,9 @@ 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
|
||||
|
|
|
@ -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/"),
|
||||
]
|
||||
)
|
|
@ -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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// ProxyResolver.swift
|
||||
// ProxyConfig
|
||||
// ProxyResolver
|
||||
//
|
||||
// Created by Mikhail Churbanov on 16/04/2018.
|
||||
// Copyright © 2018 Mikhail Churbanov. All rights reserved.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue