Updated to work with SPM
This commit is contained in:
parent
e5f5b5f541
commit
728bde8133
|
@ -27,10 +27,13 @@ DerivedData
|
||||||
|
|
||||||
Carthage/Build
|
Carthage/Build
|
||||||
|
|
||||||
|
# Swift Package Manager
|
||||||
|
.build/
|
||||||
|
|
||||||
# We recommend against adding the Pods directory to your .gitignore. However
|
# We recommend against adding the Pods directory to your .gitignore. However
|
||||||
# you should judge for yourself, the pros and cons are mentioned at:
|
# 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
|
# 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
|
# Note: if you ignore the Pods directory, make sure to uncomment
|
||||||
# `pod install` in .travis.yml
|
# `pod install` in .travis.yml
|
||||||
#
|
#
|
||||||
|
|
|
@ -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
|
// Types.swift
|
||||||
// Pods-ProxyResolver_Tests
|
// ProxyResolver
|
||||||
//
|
//
|
||||||
// Created by Mikhail Churbanov on 11/06/2018.
|
// Created by Mikhail Churbanov on 11/06/2018.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
enum ConfigProxyType {
|
enum ConfigProxyType {
|
||||||
case none
|
case none
|
||||||
case autoConfigurationUrl
|
case autoConfigurationUrl
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//
|
//
|
||||||
// ProxyResolver.swift
|
// ProxyResolver.swift
|
||||||
// ProxyConfig
|
// ProxyResolver
|
||||||
//
|
//
|
||||||
// Created by Mikhail Churbanov on 16/04/2018.
|
// Created by Mikhail Churbanov on 16/04/2018.
|
||||||
// Copyright © 2018 Mikhail Churbanov. All rights reserved.
|
// Copyright © 2018 Mikhail Churbanov. All rights reserved.
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
# ProxyResolver
|
# 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)
|
[![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)
|
[![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)
|
[![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)
|
[![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 proxy = ProxyResolver()
|
||||||
let url = URL(string: "https://github.com")!
|
let url = URL(string: "https://github.com")!
|
||||||
proxy.resolve(for: url) { result in
|
proxy.resolve(for: url) { result in
|
||||||
switch result {
|
switch result {
|
||||||
case .direct:
|
case .direct:
|
||||||
// Direct connection allowed - no proxy required
|
// Direct connection allowed - no proxy required
|
||||||
|
|
Loading…
Reference in New Issue