From 7156409baf50382c3712b2c97b453d5e6d1ec61b Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 11:11:35 +0300 Subject: [PATCH 01/16] Initial pod configuration --- OpenVPNAdapter.podspec | 49 ++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index 397d94a..493931f 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -16,8 +16,8 @@ Pod::Spec.new do |s| # s.name = "OpenVPNAdapter" - s.version = "0.0.1" - s.summary = "A short description of OpenVPNAdapter." + s.version = "0.1.0" + s.summary = "Objective-C wrapper for OpenVPN library. Compatible with iOS and macOS." # This description is used to generate tags and improve search results. # * Think: What does it do? Why did you write it? What is the focus? @@ -25,7 +25,9 @@ Pod::Spec.new do |s| # * Write the description between the DESC delimiters below. # * Finally, don't worry about the indent, CocoaPods strips it! s.description = <<-DESC - DESC + OpenVPNAdapter is an Objective-C framework that allows to easily configure and establish VPN connection using OpenVPN protocol. It is based on the original openvpn3 library so it has every feature the library has. + The framework is designed to use in conjunction with NetworkExtension framework and doesn't use any private Apple API. Compatible with iOS and macOS and also Swift friendly + DESC s.homepage = "http://EXAMPLE/OpenVPNAdapter" # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" @@ -38,7 +40,7 @@ Pod::Spec.new do |s| # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. # - s.license = "MIT (example)" + s.license = "AGPLv3" # s.license = { :type => "MIT", :file => "FILE_LICENSE" } @@ -53,9 +55,6 @@ Pod::Spec.new do |s| # s.author = { "Sergey Abramchuk" => "personal@ss-abramchuk.me" } - # Or just: s.author = "Sergey Abramchuk" - # s.authors = { "Sergey Abramchuk" => "personal@ss-abramchuk.me" } - # s.social_media_url = "http://twitter.com/Sergey Abramchuk" # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # # @@ -63,14 +62,9 @@ Pod::Spec.new do |s| # the deployment target. You can optionally include the target after the platform. # - # s.platform = :ios - # s.platform = :ios, "5.0" - # When using multiple platforms - # s.ios.deployment_target = "5.0" - # s.osx.deployment_target = "10.7" - # s.watchos.deployment_target = "2.0" - # s.tvos.deployment_target = "9.0" + s.ios.deployment_target = "9.0" + s.osx.deployment_target = "10.11" # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # @@ -79,7 +73,7 @@ Pod::Spec.new do |s| # Supports git, hg, bzr, svn and HTTP. # - s.source = { :git => "http://EXAMPLE/OpenVPNAdapter.git", :tag => "#{s.version}" } + s.source = { :git => "https://github.com/ss-abramchuk/OpenVPNAdapter", :branch => "develop" } # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # @@ -90,11 +84,12 @@ Pod::Spec.new do |s| # Not including the public_header_files will make all headers public. # - s.source_files = "Classes", "Classes/**/*.{h,m}" - s.exclude_files = "Classes/Exclude" + s.source_files = "Sources/OpenVPNAdapter/*.{h,m,mm}" - # s.public_header_files = "Classes/**/*.h" + s.public_header_files = "Sources/OpenVPNAdapter/*.h" + s.private_header_files = "Sources/OpenVPNAdapter/OpenVPNReachabilityTracker.h", "Sources/OpenVPNAdapter/OpenVPNReachability+Internal.h" + s.module_map = "Configuration/OpenVPNAdapter.modulemap" # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # # @@ -116,11 +111,8 @@ Pod::Spec.new do |s| # the lib prefix of their name. # - # s.framework = "SomeFramework" - # s.frameworks = "SomeFramework", "AnotherFramework" - - # s.library = "iconv" - # s.libraries = "iconv", "xml2" + s.ios.frameworks = "UIKit", "NetworkExtension", "SystemConfiguration" + s.osx.frameworks = "NetworkExtension", "SystemConfiguration" # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # @@ -129,9 +121,14 @@ Pod::Spec.new do |s| # where they will only apply to your library. If you depend on other Podspecs # you can include multiple dependencies to ensure it works. - # s.requires_arc = true + s.requires_arc = true - # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } - # s.dependency "JSONKit", "~> 1.4" + # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(TARGETNAME)/openvpn3" } + + # ――― Subspecs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + + s.subspec 'openvpn3' do |ovpns| + ovpns.source_files = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/openvpn/**/*.hpp", "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/client/*.{hpp,cpp}" + end end From 646e9655a11af11a7fb12dca62ff1739bf4425db Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 11:32:59 +0300 Subject: [PATCH 02/16] Update configuration --- OpenVPNAdapter.podspec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index 493931f..d48b5e9 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -73,7 +73,7 @@ Pod::Spec.new do |s| # Supports git, hg, bzr, svn and HTTP. # - s.source = { :git => "https://github.com/ss-abramchuk/OpenVPNAdapter", :branch => "develop" } + s.source = { :git => "file:///Users/ss.abramchuk/Sources.localized/open-source.localized/openvpn-adapter", :branch => "feature/cocoapods" } # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # @@ -123,12 +123,13 @@ Pod::Spec.new do |s| s.requires_arc = true - # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(TARGETNAME)/openvpn3" } + s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(TARGETNAME)/openvpn3" } # ――― Subspecs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # s.subspec 'openvpn3' do |ovpns| - ovpns.source_files = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/openvpn/**/*.hpp", "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/client/*.{hpp,cpp}" + ovpns.source_files = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/client/*.{hpp,cpp}" + ovpns.preserve_paths = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/openvpn" end end From 8789052507e075960bf84226324a845a9c173ab9 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 11:51:40 +0300 Subject: [PATCH 03/16] Delete category for NSSet --- OpenVPNAdapter.xcodeproj/project.pbxproj | 12 ------------ .../OpenVPNAdapter/NSSet+OpenVPNAdditions.h | 18 ------------------ .../OpenVPNAdapter/NSSet+OpenVPNAdditions.m | 16 ---------------- .../OpenVPNNetworkSettingsBuilder.m | 1 - 4 files changed, 47 deletions(-) delete mode 100644 Sources/OpenVPNAdapter/NSSet+OpenVPNAdditions.h delete mode 100644 Sources/OpenVPNAdapter/NSSet+OpenVPNAdditions.m diff --git a/OpenVPNAdapter.xcodeproj/project.pbxproj b/OpenVPNAdapter.xcodeproj/project.pbxproj index d1db83e..57aed9b 100644 --- a/OpenVPNAdapter.xcodeproj/project.pbxproj +++ b/OpenVPNAdapter.xcodeproj/project.pbxproj @@ -103,10 +103,6 @@ C9A50F2E21763A2C0010C0D4 /* NSArray+OpenVPNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = C9A50F2B21763A2C0010C0D4 /* NSArray+OpenVPNAdditions.h */; }; C9A50F2F21763A2C0010C0D4 /* NSArray+OpenVPNAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = C9A50F2C21763A2C0010C0D4 /* NSArray+OpenVPNAdditions.m */; }; C9A50F3021763A2C0010C0D4 /* NSArray+OpenVPNAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = C9A50F2C21763A2C0010C0D4 /* NSArray+OpenVPNAdditions.m */; }; - C9A50F3321763CBC0010C0D4 /* NSSet+OpenVPNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = C9A50F3121763CBC0010C0D4 /* NSSet+OpenVPNAdditions.h */; }; - C9A50F3421763CBC0010C0D4 /* NSSet+OpenVPNAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = C9A50F3121763CBC0010C0D4 /* NSSet+OpenVPNAdditions.h */; }; - C9A50F3521763CBC0010C0D4 /* NSSet+OpenVPNAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = C9A50F3221763CBC0010C0D4 /* NSSet+OpenVPNAdditions.m */; }; - C9A50F3621763CBC0010C0D4 /* NSSet+OpenVPNAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = C9A50F3221763CBC0010C0D4 /* NSSet+OpenVPNAdditions.m */; }; C9B7955E1F1D16AA00CF35FE /* OpenVPNReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B7955C1F1D16AA00CF35FE /* OpenVPNReachability.h */; settings = {ATTRIBUTES = (Public, ); }; }; C9B7955F1F1D16AA00CF35FE /* OpenVPNReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = C9B7955C1F1D16AA00CF35FE /* OpenVPNReachability.h */; settings = {ATTRIBUTES = (Public, ); }; }; C9B795601F1D16AA00CF35FE /* OpenVPNReachability.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9B7955D1F1D16AA00CF35FE /* OpenVPNReachability.mm */; }; @@ -240,8 +236,6 @@ C98467AA1EAA5BB500272A9A /* OpenVPNConfiguration+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "OpenVPNConfiguration+Internal.h"; path = "OpenVPNAdapter/OpenVPNConfiguration+Internal.h"; sourceTree = ""; }; C9A50F2B21763A2C0010C0D4 /* NSArray+OpenVPNAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "NSArray+OpenVPNAdditions.h"; path = "Sources/OpenVPNAdapter/NSArray+OpenVPNAdditions.h"; sourceTree = SOURCE_ROOT; }; C9A50F2C21763A2C0010C0D4 /* NSArray+OpenVPNAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "NSArray+OpenVPNAdditions.m"; path = "Sources/OpenVPNAdapter/NSArray+OpenVPNAdditions.m"; sourceTree = SOURCE_ROOT; }; - C9A50F3121763CBC0010C0D4 /* NSSet+OpenVPNAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "NSSet+OpenVPNAdditions.h"; path = "Sources/OpenVPNAdapter/NSSet+OpenVPNAdditions.h"; sourceTree = SOURCE_ROOT; }; - C9A50F3221763CBC0010C0D4 /* NSSet+OpenVPNAdditions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "NSSet+OpenVPNAdditions.m"; path = "Sources/OpenVPNAdapter/NSSet+OpenVPNAdditions.m"; sourceTree = SOURCE_ROOT; }; C9B7955C1F1D16AA00CF35FE /* OpenVPNReachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenVPNReachability.h; path = OpenVPNAdapter/OpenVPNReachability.h; sourceTree = ""; }; C9B7955D1F1D16AA00CF35FE /* OpenVPNReachability.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OpenVPNReachability.mm; path = OpenVPNAdapter/OpenVPNReachability.mm; sourceTree = ""; }; C9B795621F1D182500CF35FE /* OpenVPNReachabilityTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenVPNReachabilityTracker.h; path = OpenVPNAdapter/OpenVPNReachabilityTracker.h; sourceTree = ""; }; @@ -586,8 +580,6 @@ C9E350C0200F6EC0000820D9 /* NSError+OpenVPNError.m */, C9A50F2B21763A2C0010C0D4 /* NSArray+OpenVPNAdditions.h */, C9A50F2C21763A2C0010C0D4 /* NSArray+OpenVPNAdditions.m */, - C9A50F3121763CBC0010C0D4 /* NSSet+OpenVPNAdditions.h */, - C9A50F3221763CBC0010C0D4 /* NSSet+OpenVPNAdditions.m */, ); name = Extensions; sourceTree = ""; @@ -628,7 +620,6 @@ C9657A5E1EB0D60700EFF210 /* OpenVPNTransportProtocol.h in Headers */, C9657A1D1EB0A8D800EFF210 /* OpenVPNConnectionInfo+Internal.h in Headers */, C9B7955E1F1D16AA00CF35FE /* OpenVPNReachability.h in Headers */, - C9A50F3321763CBC0010C0D4 /* NSSet+OpenVPNAdditions.h in Headers */, C915F1F41F612F3300B3DF23 /* OpenVPNPrivateKey.h in Headers */, C9657A171EB0A7F800EFF210 /* OpenVPNConnectionInfo.h in Headers */, C9310BC120FF6E9700838910 /* Umbrella-Header.h in Headers */, @@ -676,7 +667,6 @@ C9657A5F1EB0D60700EFF210 /* OpenVPNTransportProtocol.h in Headers */, C9657A1E1EB0A8D800EFF210 /* OpenVPNConnectionInfo+Internal.h in Headers */, C9B7955F1F1D16AA00CF35FE /* OpenVPNReachability.h in Headers */, - C9A50F3421763CBC0010C0D4 /* NSSet+OpenVPNAdditions.h in Headers */, C915F1F51F612F3300B3DF23 /* OpenVPNPrivateKey.h in Headers */, C9657A181EB0A7F800EFF210 /* OpenVPNConnectionInfo.h in Headers */, C9310BC220FF6E9700838910 /* Umbrella-Header.h in Headers */, @@ -946,7 +936,6 @@ ABD6EF121F8F93AB007D3D90 /* OpenVPNPacketFlowBridge.mm in Sources */, C9657A311EB0B7A900EFF210 /* OpenVPNTransportStats.mm in Sources */, C9B795661F1D182500CF35FE /* OpenVPNReachabilityTracker.mm in Sources */, - C9A50F3521763CBC0010C0D4 /* NSSet+OpenVPNAdditions.m in Sources */, C9657A581EB0CE1300EFF210 /* OpenVPNProperties.mm in Sources */, C9CA4DD51F602F7B00C4F184 /* OpenVPNCertificate.m in Sources */, C9CDFDDD200781AF00323B73 /* OpenVPNClient.mm in Sources */, @@ -989,7 +978,6 @@ ABD6EF131F8F93AB007D3D90 /* OpenVPNPacketFlowBridge.mm in Sources */, C9657A301EB0B7A600EFF210 /* OpenVPNTransportStats.mm in Sources */, C9B795671F1D182500CF35FE /* OpenVPNReachabilityTracker.mm in Sources */, - C9A50F3621763CBC0010C0D4 /* NSSet+OpenVPNAdditions.m in Sources */, C9657A591EB0CE1400EFF210 /* OpenVPNProperties.mm in Sources */, C9CA4DD61F602F7B00C4F184 /* OpenVPNCertificate.m in Sources */, C9CDFDDE200781AF00323B73 /* OpenVPNClient.mm in Sources */, diff --git a/Sources/OpenVPNAdapter/NSSet+OpenVPNAdditions.h b/Sources/OpenVPNAdapter/NSSet+OpenVPNAdditions.h deleted file mode 100644 index f7e7c37..0000000 --- a/Sources/OpenVPNAdapter/NSSet+OpenVPNAdditions.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// NSSet+OpenVPNAdditions.h -// OpenVPNAdapter -// -// Created by Sergey Abramchuk on 16/10/2018. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSSet (OpenVPNEmptySet) - -@property (nonatomic, readonly) BOOL ovpn_isNotEmpty; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Sources/OpenVPNAdapter/NSSet+OpenVPNAdditions.m b/Sources/OpenVPNAdapter/NSSet+OpenVPNAdditions.m deleted file mode 100644 index 0af8b0f..0000000 --- a/Sources/OpenVPNAdapter/NSSet+OpenVPNAdditions.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// NSSet+OpenVPNAdditions.m -// OpenVPNAdapter -// -// Created by Sergey Abramchuk on 16/10/2018. -// - -#import "NSSet+OpenVPNAdditions.h" - -@implementation NSSet (OpenVPNEmptySet) - -- (BOOL)ovpn_isNotEmpty { - return (self.count > 0) ? YES : NO; -} - -@end diff --git a/Sources/OpenVPNAdapter/OpenVPNNetworkSettingsBuilder.m b/Sources/OpenVPNAdapter/OpenVPNNetworkSettingsBuilder.m index f95433c..10d5e5d 100644 --- a/Sources/OpenVPNAdapter/OpenVPNNetworkSettingsBuilder.m +++ b/Sources/OpenVPNAdapter/OpenVPNNetworkSettingsBuilder.m @@ -10,7 +10,6 @@ #import #import "NSArray+OpenVPNAdditions.h" -#import "NSSet+OpenVPNAdditions.h" @interface OpenVPNNetworkSettingsBuilder () From 0c7e8f07c352a0dfde10f769b38bec7730a9eea9 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 11:57:20 +0300 Subject: [PATCH 04/16] Configure private headers --- OpenVPNAdapter.podspec | 74 ++++++++++-------------------------------- 1 file changed, 17 insertions(+), 57 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index d48b5e9..ec0a545 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -1,93 +1,53 @@ -# -# Be sure to run `pod spec lint OpenVPNAdapter.podspec' to ensure this is a -# valid spec and to remove all comments including this before submitting the spec. -# -# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html -# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ -# - Pod::Spec.new do |s| # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # These will help people to find your library, and whilst it - # can feel like a chore to fill in it's definitely to your advantage. The - # summary should be tweet-length, and the description more in depth. - # s.name = "OpenVPNAdapter" s.version = "0.1.0" s.summary = "Objective-C wrapper for OpenVPN library. Compatible with iOS and macOS." - - # This description is used to generate tags and improve search results. - # * Think: What does it do? Why did you write it? What is the focus? - # * Try to keep it short, snappy and to the point. - # * Write the description between the DESC delimiters below. - # * Finally, don't worry about the indent, CocoaPods strips it! s.description = <<-DESC OpenVPNAdapter is an Objective-C framework that allows to easily configure and establish VPN connection using OpenVPN protocol. It is based on the original openvpn3 library so it has every feature the library has. The framework is designed to use in conjunction with NetworkExtension framework and doesn't use any private Apple API. Compatible with iOS and macOS and also Swift friendly DESC - s.homepage = "http://EXAMPLE/OpenVPNAdapter" - # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" + s.homepage = "https://github.com/ss-abramchuk/OpenVPNAdapter" # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Licensing your code is important. See http://choosealicense.com for more info. - # CocoaPods will detect a license file if there is a named LICENSE* - # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. - # s.license = "AGPLv3" - # s.license = { :type => "MIT", :file => "FILE_LICENSE" } # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Specify the authors of the library, with email addresses. Email addresses - # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also - # accepts just a name if you'd rather not provide an email address. - # - # Specify a social_media_url where others can refer to, for example a twitter - # profile URL. - # s.author = { "Sergey Abramchuk" => "personal@ss-abramchuk.me" } # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # If this Pod runs only on iOS or OS X, then specify the platform and - # the deployment target. You can optionally include the target after the platform. - # - # When using multiple platforms s.ios.deployment_target = "9.0" s.osx.deployment_target = "10.11" # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Specify the location from where the source should be retrieved. - # Supports git, hg, bzr, svn and HTTP. - # - s.source = { :git => "file:///Users/ss.abramchuk/Sources.localized/open-source.localized/openvpn-adapter", :branch => "feature/cocoapods" } + s.source = { :git => "https://github.com/ss-abramchuk/OpenVPNAdapter.git", :branch => "develop" } # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # CocoaPods is smart about how it includes source code. For source files - # giving a folder will include any swift, h, m, mm, c & cpp files. - # For header files it will include any header in the folder. - # Not including the public_header_files will make all headers public. - # s.source_files = "Sources/OpenVPNAdapter/*.{h,m,mm}" s.public_header_files = "Sources/OpenVPNAdapter/*.h" - s.private_header_files = "Sources/OpenVPNAdapter/OpenVPNReachabilityTracker.h", "Sources/OpenVPNAdapter/OpenVPNReachability+Internal.h" + s.private_header_files = [ + "Sources/OpenVPNAdapter/*+Internal.h", + "Sources/OpenVPNAdapter/OpenVPNReachabilityTracker.h", + "Sources/OpenVPNAdapter/OpenVPNClient.h", + "Sources/OpenVPNAdapter/OpenVPNNetworkSettingsBuilder.h", + "Sources/OpenVPNAdapter/OpenVPNPacket.h", + "Sources/OpenVPNAdapter/OpenVPNPacketFlowBridge.h", + "Sources/OpenVPNAdapter/NSError+OpenVPNError.h", + "Sources/OpenVPNAdapter/NSArray+OpenVPNAdditions.h" + ] s.module_map = "Configuration/OpenVPNAdapter.modulemap" @@ -123,13 +83,13 @@ Pod::Spec.new do |s| s.requires_arc = true - s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(TARGETNAME)/openvpn3" } + # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(TARGETNAME)/openvpn3" } # ――― Subspecs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - s.subspec 'openvpn3' do |ovpns| - ovpns.source_files = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/client/*.{hpp,cpp}" - ovpns.preserve_paths = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/openvpn" - end + # s.subspec 'Libraries/Vendors/openvpn3' do |ovpns| + # ovpns.source_files = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/client/*.{hpp,cpp}" + # ovpns.private_header_files = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/openvpn/**/*.hpp" + # end end From a18d1a3a3889248ede84f1373dde6ab387b31bc9 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 12:52:58 +0300 Subject: [PATCH 05/16] Change of include syntaxis --- Sources/OpenVPNAdapter/OpenVPNClient.h | 2 +- Sources/OpenVPNAdapter/OpenVPNConfiguration+Internal.h | 2 +- Sources/OpenVPNAdapter/OpenVPNConnectionInfo+Internal.h | 2 +- Sources/OpenVPNAdapter/OpenVPNCredentials+Internal.h | 2 +- Sources/OpenVPNAdapter/OpenVPNInterfaceStats+Internal.h | 2 +- Sources/OpenVPNAdapter/OpenVPNProperties+Internal.h | 2 +- Sources/OpenVPNAdapter/OpenVPNServerEntry+Internal.h | 2 +- Sources/OpenVPNAdapter/OpenVPNSessionToken+Internal.h | 2 +- Sources/OpenVPNAdapter/OpenVPNTransportStats+Internal.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Sources/OpenVPNAdapter/OpenVPNClient.h b/Sources/OpenVPNAdapter/OpenVPNClient.h index 4ffad1e..1996e25 100644 --- a/Sources/OpenVPNAdapter/OpenVPNClient.h +++ b/Sources/OpenVPNAdapter/OpenVPNClient.h @@ -7,7 +7,7 @@ #import -#include +#include "ovpncli.hpp" @class NEIPv4Route; @class NEIPv6Route; diff --git a/Sources/OpenVPNAdapter/OpenVPNConfiguration+Internal.h b/Sources/OpenVPNAdapter/OpenVPNConfiguration+Internal.h index 4bd4030..406149c 100644 --- a/Sources/OpenVPNAdapter/OpenVPNConfiguration+Internal.h +++ b/Sources/OpenVPNAdapter/OpenVPNConfiguration+Internal.h @@ -8,7 +8,7 @@ #import "OpenVPNConfiguration.h" -#include +#include "ovpncli.hpp" using namespace openvpn; diff --git a/Sources/OpenVPNAdapter/OpenVPNConnectionInfo+Internal.h b/Sources/OpenVPNAdapter/OpenVPNConnectionInfo+Internal.h index c03fb21..19d255f 100644 --- a/Sources/OpenVPNAdapter/OpenVPNConnectionInfo+Internal.h +++ b/Sources/OpenVPNAdapter/OpenVPNConnectionInfo+Internal.h @@ -8,7 +8,7 @@ #import "OpenVPNConnectionInfo.h" -#include +#include "ovpncli.hpp" using namespace openvpn; diff --git a/Sources/OpenVPNAdapter/OpenVPNCredentials+Internal.h b/Sources/OpenVPNAdapter/OpenVPNCredentials+Internal.h index 8cb7831..0b048bf 100644 --- a/Sources/OpenVPNAdapter/OpenVPNCredentials+Internal.h +++ b/Sources/OpenVPNAdapter/OpenVPNCredentials+Internal.h @@ -7,7 +7,7 @@ // #import "OpenVPNCredentials.h" -#include +#include "ovpncli.hpp" using namespace openvpn; diff --git a/Sources/OpenVPNAdapter/OpenVPNInterfaceStats+Internal.h b/Sources/OpenVPNAdapter/OpenVPNInterfaceStats+Internal.h index 735e605..ae8b127 100644 --- a/Sources/OpenVPNAdapter/OpenVPNInterfaceStats+Internal.h +++ b/Sources/OpenVPNAdapter/OpenVPNInterfaceStats+Internal.h @@ -8,7 +8,7 @@ #import "OpenVPNInterfaceStats.h" -#include +#include "ovpncli.hpp" using namespace openvpn; diff --git a/Sources/OpenVPNAdapter/OpenVPNProperties+Internal.h b/Sources/OpenVPNAdapter/OpenVPNProperties+Internal.h index d6bee9a..a276e2c 100644 --- a/Sources/OpenVPNAdapter/OpenVPNProperties+Internal.h +++ b/Sources/OpenVPNAdapter/OpenVPNProperties+Internal.h @@ -8,7 +8,7 @@ #import "OpenVPNProperties.h" -#include +#include "ovpncli.hpp" using namespace openvpn; diff --git a/Sources/OpenVPNAdapter/OpenVPNServerEntry+Internal.h b/Sources/OpenVPNAdapter/OpenVPNServerEntry+Internal.h index b4e44fe..0ef67b3 100644 --- a/Sources/OpenVPNAdapter/OpenVPNServerEntry+Internal.h +++ b/Sources/OpenVPNAdapter/OpenVPNServerEntry+Internal.h @@ -8,7 +8,7 @@ #import "OpenVPNServerEntry.h" -#include +#include "ovpncli.hpp" using namespace openvpn; diff --git a/Sources/OpenVPNAdapter/OpenVPNSessionToken+Internal.h b/Sources/OpenVPNAdapter/OpenVPNSessionToken+Internal.h index b1c9026..1ee326f 100644 --- a/Sources/OpenVPNAdapter/OpenVPNSessionToken+Internal.h +++ b/Sources/OpenVPNAdapter/OpenVPNSessionToken+Internal.h @@ -8,7 +8,7 @@ #import "OpenVPNSessionToken.h" -#include +#include "ovpncli.hpp" using namespace openvpn; diff --git a/Sources/OpenVPNAdapter/OpenVPNTransportStats+Internal.h b/Sources/OpenVPNAdapter/OpenVPNTransportStats+Internal.h index df7e129..bd8eea0 100644 --- a/Sources/OpenVPNAdapter/OpenVPNTransportStats+Internal.h +++ b/Sources/OpenVPNAdapter/OpenVPNTransportStats+Internal.h @@ -8,7 +8,7 @@ #import "OpenVPNTransportStats.h" -#include +#include "ovpncli.hpp" using namespace openvpn; From 25e7a4d4dcdc950093723fdb1dd4dc5260966e1a Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 13:11:09 +0300 Subject: [PATCH 06/16] Configure asio subspec --- OpenVPNAdapter.podspec | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index ec0a545..a50cb4b 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -87,9 +87,36 @@ Pod::Spec.new do |s| # ――― Subspecs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # s.subspec 'Libraries/Vendors/openvpn3' do |ovpns| - # ovpns.source_files = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/client/*.{hpp,cpp}" - # ovpns.private_header_files = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/openvpn/**/*.hpp" + # s.subspec 'lz4' do |lz4| + # lz4.ios.vendored_library = "Sources/OpenVPNAdapter/Libraries/Vendors/lz4/lib/ios/liblz4.a" + # lz4.osx.vendored_library = "Sources/OpenVPNAdapter/Libraries/Vendors/lz4/lib/macos/liblz4.a" + # end + # + # s.subspec 'mbedtls' do |mbedtls| + # mbedtls.preserve_paths = "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/include/mbedtls/*.h" + # mbedtls.ios.vendored_libraries = [ + # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedcrypto.a", + # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedtls.a", + # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedx509.a" + # ] + # mbedtls.osx.vendored_libraries = [ + # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedcrypto.a", + # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedtls.a", + # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedx509.a" + # ] # end + s.subspec 'asio' do |asio| + asio_path = "Sources/OpenVPNAdapter/Libraries/Vendors/asio" + asio.preserve_paths = "#{asio_path}/asio/include/*.hpp" + asio.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/#{asio_path}/asio/include/**" } + end + + s.subspec 'openvpn3' do |openvpn| + openvpn_path = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn" + openvpn.source_files = "#{openvpn_path}/client/*.{hpp,cpp}" + openvpn.preserve_paths = "#{openvpn_path}/openvpn/**/*.hpp" + openvpn.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/#{openvpn_path}/openvpn/**" } + end + end From e5c5d78d25bf46d493de1f9309c3bd60317b01b1 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 15:52:25 +0300 Subject: [PATCH 07/16] Configure xcconfig parameters --- OpenVPNAdapter.podspec | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index a50cb4b..6352f47 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -83,10 +83,17 @@ Pod::Spec.new do |s| s.requires_arc = true - # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(TARGETNAME)/openvpn3" } + s.xcconfig = { + "APPLICATION_EXTENSION_API_ONLY" => "YES", + "CLANG_CXX_LANGUAGE_STANDARD" => "gnu++14", + "CLANG_CXX_LIBRARY" => "libc++", + "GCC_WARN_64_TO_32_BIT_CONVERSION" => "NO" + } # ――― Subspecs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + vendors_path = "Sources/OpenVPNAdapter/Libraries/Vendors" + # s.subspec 'lz4' do |lz4| # lz4.ios.vendored_library = "Sources/OpenVPNAdapter/Libraries/Vendors/lz4/lib/ios/liblz4.a" # lz4.osx.vendored_library = "Sources/OpenVPNAdapter/Libraries/Vendors/lz4/lib/macos/liblz4.a" @@ -107,16 +114,22 @@ Pod::Spec.new do |s| # end s.subspec 'asio' do |asio| - asio_path = "Sources/OpenVPNAdapter/Libraries/Vendors/asio" - asio.preserve_paths = "#{asio_path}/asio/include/*.hpp" - asio.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/#{asio_path}/asio/include/**" } + asio_path = "#{vendors_path}/asio" + + asio.preserve_paths = "#{asio_path}/asio/include/**/*.{hpp,ipp}" + asio.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{asio_path}/asio/include/**" } end s.subspec 'openvpn3' do |openvpn| - openvpn_path = "Sources/OpenVPNAdapter/Libraries/Vendors/openvpn" + openvpn_path = "#{vendors_path}/openvpn" + openvpn.source_files = "#{openvpn_path}/client/*.{hpp,cpp}" openvpn.preserve_paths = "#{openvpn_path}/openvpn/**/*.hpp" - openvpn.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/#{openvpn_path}/openvpn/**" } + + openvpn.xcconfig = { + "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{openvpn_path}/**", + "OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER" + } end end From 7474125cf57ffc50ccd46e93373bb1cbefaf2e58 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 16:49:30 +0300 Subject: [PATCH 08/16] Set local repo as source --- OpenVPNAdapter.podspec | 57 ++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index 6352f47..ba9b7dd 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -30,7 +30,7 @@ Pod::Spec.new do |s| # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - s.source = { :git => "https://github.com/ss-abramchuk/OpenVPNAdapter.git", :branch => "develop" } + s.source = { :git => "file:///Users/ss.abramchuk/Sources.localized/open-source.localized/openvpn-adapter", :branch => "feature/cocoapods" } # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # @@ -71,9 +71,8 @@ Pod::Spec.new do |s| # the lib prefix of their name. # - s.ios.frameworks = "UIKit", "NetworkExtension", "SystemConfiguration" - s.osx.frameworks = "NetworkExtension", "SystemConfiguration" - + s.ios.frameworks = "Foundation", "NetworkExtension", "SystemConfiguration", "UIKit" + s.osx.frameworks = "Foundation", "NetworkExtension", "SystemConfiguration" # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # # @@ -87,7 +86,8 @@ Pod::Spec.new do |s| "APPLICATION_EXTENSION_API_ONLY" => "YES", "CLANG_CXX_LANGUAGE_STANDARD" => "gnu++14", "CLANG_CXX_LIBRARY" => "libc++", - "GCC_WARN_64_TO_32_BIT_CONVERSION" => "NO" + "GCC_WARN_64_TO_32_BIT_CONVERSION" => "NO", + "OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER" } # ――― Subspecs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # @@ -95,27 +95,41 @@ Pod::Spec.new do |s| vendors_path = "Sources/OpenVPNAdapter/Libraries/Vendors" # s.subspec 'lz4' do |lz4| - # lz4.ios.vendored_library = "Sources/OpenVPNAdapter/Libraries/Vendors/lz4/lib/ios/liblz4.a" - # lz4.osx.vendored_library = "Sources/OpenVPNAdapter/Libraries/Vendors/lz4/lib/macos/liblz4.a" - # end + # lz4_path = "#{vendors_path}/lz4" # + # lz4.preserve_paths = "#{lz4_path}/include/*.h" + # + # # lz4.ios.vendored_library = "#{lz4_path}/lib/ios/liblz4.a" + # # lz4.osx.vendored_library = "#{lz4_path}/lib/macos/liblz4.a" + # + # lz4.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{lz4_path}/include/**" } + # end + # s.subspec 'mbedtls' do |mbedtls| - # mbedtls.preserve_paths = "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/include/mbedtls/*.h" - # mbedtls.ios.vendored_libraries = [ - # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedcrypto.a", - # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedtls.a", - # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedx509.a" - # ] - # mbedtls.osx.vendored_libraries = [ - # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedcrypto.a", - # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedtls.a", - # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedx509.a" - # ] + # mbedtls_path = "#{vendors_path}/mbedtls" + # + # mbedtls.preserve_paths = "#{mbedtls_path}/include/**/*.h" + # + # # mbedtls.ios.vendored_libraries = [ + # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedcrypto.a", + # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedtls.a", + # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedx509.a" + # # ] + # # mbedtls.osx.vendored_libraries = [ + # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedcrypto.a", + # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedtls.a", + # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedx509.a" + # # ] + # + # mbedtls.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{mbedtls_path}/include/**" } # end s.subspec 'asio' do |asio| asio_path = "#{vendors_path}/asio" + # asio.source_files = "#{asio_path}/asio/include/**/*.{hpp,ipp}" + # asio.public_header_files = "#{asio_path}/asio/include/**/*.hpp" + asio.preserve_paths = "#{asio_path}/asio/include/**/*.{hpp,ipp}" asio.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{asio_path}/asio/include/**" } end @@ -127,9 +141,10 @@ Pod::Spec.new do |s| openvpn.preserve_paths = "#{openvpn_path}/openvpn/**/*.hpp" openvpn.xcconfig = { - "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{openvpn_path}/**", - "OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER" + "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{openvpn_path}/**" } end + # s.libraries = "lz4" + end From d8f1e17fe140506eed0e3e29291fb1e91486f5e8 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 17:00:17 +0300 Subject: [PATCH 09/16] Enable mbedTLS and lz4 --- OpenVPNAdapter.podspec | 65 +++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index ba9b7dd..f419dd8 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -94,42 +94,39 @@ Pod::Spec.new do |s| vendors_path = "Sources/OpenVPNAdapter/Libraries/Vendors" - # s.subspec 'lz4' do |lz4| - # lz4_path = "#{vendors_path}/lz4" - # - # lz4.preserve_paths = "#{lz4_path}/include/*.h" - # - # # lz4.ios.vendored_library = "#{lz4_path}/lib/ios/liblz4.a" - # # lz4.osx.vendored_library = "#{lz4_path}/lib/macos/liblz4.a" - # - # lz4.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{lz4_path}/include/**" } - # end + s.subspec 'lz4' do |lz4| + lz4_path = "#{vendors_path}/lz4" - # s.subspec 'mbedtls' do |mbedtls| - # mbedtls_path = "#{vendors_path}/mbedtls" - # - # mbedtls.preserve_paths = "#{mbedtls_path}/include/**/*.h" - # - # # mbedtls.ios.vendored_libraries = [ - # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedcrypto.a", - # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedtls.a", - # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/ios/libmbedx509.a" - # # ] - # # mbedtls.osx.vendored_libraries = [ - # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedcrypto.a", - # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedtls.a", - # # "Sources/OpenVPNAdapter/Libraries/Vendors/mbedtls/lib/macos/libmbedx509.a" - # # ] - # - # mbedtls.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{mbedtls_path}/include/**" } - # end + lz4.preserve_paths = "#{lz4_path}/include/*.h" + + lz4.ios.vendored_library = "#{lz4_path}/lib/ios/liblz4.a" + lz4.osx.vendored_library = "#{lz4_path}/lib/macos/liblz4.a" + + lz4.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{lz4_path}/include/**" } + end + + s.subspec 'mbedtls' do |mbedtls| + mbedtls_path = "#{vendors_path}/mbedtls" + + mbedtls.preserve_paths = "#{mbedtls_path}/include/**/*.h" + + mbedtls.ios.vendored_libraries = [ + "#{mbedtls_path}/lib/ios/libmbedcrypto.a", + "#{mbedtls_path}/lib/ios/libmbedtls.a", + "#{mbedtls_path}/lib/ios/libmbedx509.a" + ] + mbedtls.osx.vendored_libraries = [ + "#{mbedtls_path}/lib/macos/libmbedcrypto.a", + "#{mbedtls_path}/lib/macos/libmbedtls.a", + "#{mbedtls_path}/lib/macos/libmbedx509.a" + ] + + mbedtls.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{mbedtls_path}/include/**" } + end s.subspec 'asio' do |asio| asio_path = "#{vendors_path}/asio" - # asio.source_files = "#{asio_path}/asio/include/**/*.{hpp,ipp}" - # asio.public_header_files = "#{asio_path}/asio/include/**/*.hpp" - asio.preserve_paths = "#{asio_path}/asio/include/**/*.{hpp,ipp}" asio.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{asio_path}/asio/include/**" } end @@ -140,11 +137,9 @@ Pod::Spec.new do |s| openvpn.source_files = "#{openvpn_path}/client/*.{hpp,cpp}" openvpn.preserve_paths = "#{openvpn_path}/openvpn/**/*.hpp" - openvpn.xcconfig = { - "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{openvpn_path}/**" - } + openvpn.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{openvpn_path}/**" } end - # s.libraries = "lz4" + s.libraries = "lz4", "mbedcrypto", "mbedtls", "mbedx509" end From 49a5a63166ca969f224d611cbc108a82caecfe23 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 17:09:19 +0300 Subject: [PATCH 10/16] Cleanup podspec --- OpenVPNAdapter.podspec | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index f419dd8..da749d4 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -51,34 +51,14 @@ Pod::Spec.new do |s| s.module_map = "Configuration/OpenVPNAdapter.modulemap" - # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # A list of resources included with the Pod. These are copied into the - # target bundle with a build phase script. Anything else will be cleaned. - # You can preserve files from being cleaned, please don't preserve - # non-essential files like tests, examples and documentation. - # - - # s.resource = "icon.png" - # s.resources = "Resources/*.png" - - # s.preserve_paths = "FilesToSave", "MoreFilesToSave" - # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Link your library with frameworks, or libraries. Libraries do not include - # the lib prefix of their name. - # s.ios.frameworks = "Foundation", "NetworkExtension", "SystemConfiguration", "UIKit" s.osx.frameworks = "Foundation", "NetworkExtension", "SystemConfiguration" + # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # If your library depends on compiler flags you can set them in the xcconfig hash - # where they will only apply to your library. If you depend on other Podspecs - # you can include multiple dependencies to ensure it works. s.requires_arc = true @@ -90,6 +70,7 @@ Pod::Spec.new do |s| "OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER" } + # ――― Subspecs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # vendors_path = "Sources/OpenVPNAdapter/Libraries/Vendors" @@ -135,6 +116,8 @@ Pod::Spec.new do |s| openvpn_path = "#{vendors_path}/openvpn" openvpn.source_files = "#{openvpn_path}/client/*.{hpp,cpp}" + openvpn.private_header_files = "#{openvpn_path}/client/*.hpp" + openvpn.preserve_paths = "#{openvpn_path}/openvpn/**/*.hpp" openvpn.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{openvpn_path}/**" } From 17f653143bd6709bb32f827770d2ccbe8c8079f3 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 17:36:36 +0300 Subject: [PATCH 11/16] Delete extra indents --- OpenVPNAdapter.podspec | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index da749d4..d623792 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -39,14 +39,14 @@ Pod::Spec.new do |s| s.public_header_files = "Sources/OpenVPNAdapter/*.h" s.private_header_files = [ - "Sources/OpenVPNAdapter/*+Internal.h", - "Sources/OpenVPNAdapter/OpenVPNReachabilityTracker.h", - "Sources/OpenVPNAdapter/OpenVPNClient.h", - "Sources/OpenVPNAdapter/OpenVPNNetworkSettingsBuilder.h", - "Sources/OpenVPNAdapter/OpenVPNPacket.h", - "Sources/OpenVPNAdapter/OpenVPNPacketFlowBridge.h", - "Sources/OpenVPNAdapter/NSError+OpenVPNError.h", - "Sources/OpenVPNAdapter/NSArray+OpenVPNAdditions.h" + "Sources/OpenVPNAdapter/*+Internal.h", + "Sources/OpenVPNAdapter/OpenVPNReachabilityTracker.h", + "Sources/OpenVPNAdapter/OpenVPNClient.h", + "Sources/OpenVPNAdapter/OpenVPNNetworkSettingsBuilder.h", + "Sources/OpenVPNAdapter/OpenVPNPacket.h", + "Sources/OpenVPNAdapter/OpenVPNPacketFlowBridge.h", + "Sources/OpenVPNAdapter/NSError+OpenVPNError.h", + "Sources/OpenVPNAdapter/NSArray+OpenVPNAdditions.h" ] s.module_map = "Configuration/OpenVPNAdapter.modulemap" @@ -63,11 +63,11 @@ Pod::Spec.new do |s| s.requires_arc = true s.xcconfig = { - "APPLICATION_EXTENSION_API_ONLY" => "YES", - "CLANG_CXX_LANGUAGE_STANDARD" => "gnu++14", - "CLANG_CXX_LIBRARY" => "libc++", - "GCC_WARN_64_TO_32_BIT_CONVERSION" => "NO", - "OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER" + "APPLICATION_EXTENSION_API_ONLY" => "YES", + "CLANG_CXX_LANGUAGE_STANDARD" => "gnu++14", + "CLANG_CXX_LIBRARY" => "libc++", + "GCC_WARN_64_TO_32_BIT_CONVERSION" => "NO", + "OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER" } From bf6efc56850a775aa3717a8cdc61f5f6b02c3f14 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Thu, 18 Oct 2018 17:43:26 +0300 Subject: [PATCH 12/16] Add extra empty line --- OpenVPNAdapter.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index d623792..e355f28 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -22,6 +22,7 @@ Pod::Spec.new do |s| s.author = { "Sergey Abramchuk" => "personal@ss-abramchuk.me" } + # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # s.ios.deployment_target = "9.0" From 5378633319a06b7d9682a2bcf9fbebbad9afd72c Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Fri, 19 Oct 2018 11:44:37 +0300 Subject: [PATCH 13/16] Update podspec --- OpenVPNAdapter.podspec | 132 ++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 75 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index e355f28..a59418d 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -2,25 +2,26 @@ Pod::Spec.new do |s| # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - s.name = "OpenVPNAdapter" - s.version = "0.1.0" - s.summary = "Objective-C wrapper for OpenVPN library. Compatible with iOS and macOS." - s.description = <<-DESC - OpenVPNAdapter is an Objective-C framework that allows to easily configure and establish VPN connection using OpenVPN protocol. It is based on the original openvpn3 library so it has every feature the library has. - The framework is designed to use in conjunction with NetworkExtension framework and doesn't use any private Apple API. Compatible with iOS and macOS and also Swift friendly + s.name = "OpenVPNAdapter" + s.version = "0.1.0" + s.summary = "Objective-C wrapper for OpenVPN library. Compatible with iOS and macOS." + s.description = <<-DESC + OpenVPNAdapter is an Objective-C framework that allows to easily configure and establish VPN connection using OpenVPN protocol. + It is based on the original openvpn3 library so it has every feature the library has. The framework is designed to use in conjunction + with NetworkExtension framework and doesn't use any private Apple API. Compatible with iOS and macOS and also Swift friendly. DESC - s.homepage = "https://github.com/ss-abramchuk/OpenVPNAdapter" + s.homepage = "https://github.com/ss-abramchuk/OpenVPNAdapter" # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - s.license = "AGPLv3" + s.license = "AGPLv3" # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - s.author = { "Sergey Abramchuk" => "personal@ss-abramchuk.me" } + s.author = { "Sergey Abramchuk" => "personal@ss-abramchuk.me" } # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # @@ -31,23 +32,40 @@ Pod::Spec.new do |s| # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - s.source = { :git => "file:///Users/ss.abramchuk/Sources.localized/open-source.localized/openvpn-adapter", :branch => "feature/cocoapods" } + s.source = { :git => "https://github.com/ss-abramchuk/OpenVPNAdapter.git", :branch => "feature/cocoapods" } # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - s.source_files = "Sources/OpenVPNAdapter/*.{h,m,mm}" + framework_path = "Sources/OpenVPNAdapter" + vendors_path = "#{framework_path}/Libraries/Vendors" - s.public_header_files = "Sources/OpenVPNAdapter/*.h" + lz4_path = "#{vendors_path}/lz4" + mbedtls_path = "#{vendors_path}/mbedtls" + asio_path = "#{vendors_path}/asio" + openvpn_path = "#{vendors_path}/openvpn" + + s.source_files = "#{framework_path}/*.{h,m,mm}", "#{openvpn_path}/client/*.{hpp,cpp}" + + s.public_header_files = "#{framework_path}/*.h" s.private_header_files = [ - "Sources/OpenVPNAdapter/*+Internal.h", - "Sources/OpenVPNAdapter/OpenVPNReachabilityTracker.h", - "Sources/OpenVPNAdapter/OpenVPNClient.h", - "Sources/OpenVPNAdapter/OpenVPNNetworkSettingsBuilder.h", - "Sources/OpenVPNAdapter/OpenVPNPacket.h", - "Sources/OpenVPNAdapter/OpenVPNPacketFlowBridge.h", - "Sources/OpenVPNAdapter/NSError+OpenVPNError.h", - "Sources/OpenVPNAdapter/NSArray+OpenVPNAdditions.h" + "#{framework_path}/*+Internal.h", + "#{framework_path}/OpenVPNReachabilityTracker.h", + "#{framework_path}/OpenVPNClient.h", + "#{framework_path}/OpenVPNNetworkSettingsBuilder.h", + "#{framework_path}/OpenVPNPacket.h", + "#{framework_path}/OpenVPNPacketFlowBridge.h", + "#{framework_path}/NSError+OpenVPNError.h", + "#{framework_path}/NSArray+OpenVPNAdditions.h", + "#{openvpn_path}/openvpn/**/*.hpp", + "#{openvpn_path}/client/*.hpp" + ] + + s.preserve_paths = [ + "#{lz4_path}/include/*.h", + "#{mbedtls_path}/include/**/*.h", + "#{asio_path}/asio/include/**/*.{hpp,ipp}", + "#{openvpn_path}/openvpn/**/*.hpp" ] s.module_map = "Configuration/OpenVPNAdapter.modulemap" @@ -58,72 +76,36 @@ Pod::Spec.new do |s| s.ios.frameworks = "Foundation", "NetworkExtension", "SystemConfiguration", "UIKit" s.osx.frameworks = "Foundation", "NetworkExtension", "SystemConfiguration" + s.ios.vendored_libraries = [ + "#{lz4_path}/lib/ios/liblz4.a", + "#{mbedtls_path}/lib/ios/libmbedcrypto.a", + "#{mbedtls_path}/lib/ios/libmbedtls.a", + "#{mbedtls_path}/lib/ios/libmbedx509.a" + ] + + s.osx.vendored_libraries = [ + "#{lz4_path}/lib/macos/liblz4.a", + "#{mbedtls_path}/lib/macos/libmbedcrypto.a", + "#{mbedtls_path}/lib/macos/libmbedtls.a", + "#{mbedtls_path}/lib/macos/libmbedx509.a" + ] + + s.libraries = "lz4", "mbedcrypto", "mbedtls", "mbedx509" + # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # s.requires_arc = true + s.prefix_header_file = false s.xcconfig = { "APPLICATION_EXTENSION_API_ONLY" => "YES", "CLANG_CXX_LANGUAGE_STANDARD" => "gnu++14", "CLANG_CXX_LIBRARY" => "libc++", + "HEADER_SEARCH_PATHS" => "\"${PODS_TARGET_SRCROOT}/#{lz4_path}/include/**\" \"${PODS_TARGET_SRCROOT}/#{mbedtls_path}/include/**\" \"${PODS_TARGET_SRCROOT}/#{asio_path}/asio/include/**\" \"${PODS_TARGET_SRCROOT}/#{openvpn_path}/**\"", "GCC_WARN_64_TO_32_BIT_CONVERSION" => "NO", + "CLANG_WARN_DOCUMENTATION_COMMENTS" => "NO", "OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER" } - - # ――― Subspecs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - - vendors_path = "Sources/OpenVPNAdapter/Libraries/Vendors" - - s.subspec 'lz4' do |lz4| - lz4_path = "#{vendors_path}/lz4" - - lz4.preserve_paths = "#{lz4_path}/include/*.h" - - lz4.ios.vendored_library = "#{lz4_path}/lib/ios/liblz4.a" - lz4.osx.vendored_library = "#{lz4_path}/lib/macos/liblz4.a" - - lz4.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{lz4_path}/include/**" } - end - - s.subspec 'mbedtls' do |mbedtls| - mbedtls_path = "#{vendors_path}/mbedtls" - - mbedtls.preserve_paths = "#{mbedtls_path}/include/**/*.h" - - mbedtls.ios.vendored_libraries = [ - "#{mbedtls_path}/lib/ios/libmbedcrypto.a", - "#{mbedtls_path}/lib/ios/libmbedtls.a", - "#{mbedtls_path}/lib/ios/libmbedx509.a" - ] - mbedtls.osx.vendored_libraries = [ - "#{mbedtls_path}/lib/macos/libmbedcrypto.a", - "#{mbedtls_path}/lib/macos/libmbedtls.a", - "#{mbedtls_path}/lib/macos/libmbedx509.a" - ] - - mbedtls.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{mbedtls_path}/include/**" } - end - - s.subspec 'asio' do |asio| - asio_path = "#{vendors_path}/asio" - - asio.preserve_paths = "#{asio_path}/asio/include/**/*.{hpp,ipp}" - asio.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{asio_path}/asio/include/**" } - end - - s.subspec 'openvpn3' do |openvpn| - openvpn_path = "#{vendors_path}/openvpn" - - openvpn.source_files = "#{openvpn_path}/client/*.{hpp,cpp}" - openvpn.private_header_files = "#{openvpn_path}/client/*.hpp" - - openvpn.preserve_paths = "#{openvpn_path}/openvpn/**/*.hpp" - - openvpn.xcconfig = { "HEADER_SEARCH_PATHS" => "${PODS_ROOT}/#{s.name}/#{openvpn_path}/**" } - end - - s.libraries = "lz4", "mbedcrypto", "mbedtls", "mbedx509" - end From a29496ac6fd27a4dab573728b3b13df0c27be3eb Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Fri, 19 Oct 2018 12:01:52 +0300 Subject: [PATCH 14/16] Move openvpn to separate subspec --- OpenVPNAdapter.podspec | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index a59418d..ffcdd8e 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -45,7 +45,7 @@ Pod::Spec.new do |s| asio_path = "#{vendors_path}/asio" openvpn_path = "#{vendors_path}/openvpn" - s.source_files = "#{framework_path}/*.{h,m,mm}", "#{openvpn_path}/client/*.{hpp,cpp}" + s.source_files = "#{framework_path}/*.{h,m,mm}" s.public_header_files = "#{framework_path}/*.h" s.private_header_files = [ @@ -56,9 +56,7 @@ Pod::Spec.new do |s| "#{framework_path}/OpenVPNPacket.h", "#{framework_path}/OpenVPNPacketFlowBridge.h", "#{framework_path}/NSError+OpenVPNError.h", - "#{framework_path}/NSArray+OpenVPNAdditions.h", - "#{openvpn_path}/openvpn/**/*.hpp", - "#{openvpn_path}/client/*.hpp" + "#{framework_path}/NSArray+OpenVPNAdditions.h" ] s.preserve_paths = [ @@ -108,4 +106,13 @@ Pod::Spec.new do |s| "OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER" } + + # ――― Subspecs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + + s.subspec "openvpn" do |openvpn| + openvpn.source_files = "#{openvpn_path}/client/*.{hpp,cpp}" + openvpn.private_header_files = "#{openvpn_path}/client/*.hpp" + openvpn.compiler_flags = "-x objective-c++" + end + end From 8e2ee297b34b83c97df09662e0dc6c0fdc128c85 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Fri, 19 Oct 2018 12:42:23 +0300 Subject: [PATCH 15/16] Move other dependencies to subspecs --- OpenVPNAdapter.podspec | 90 ++++++++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 29 deletions(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index ffcdd8e..c20b690 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -40,11 +40,6 @@ Pod::Spec.new do |s| framework_path = "Sources/OpenVPNAdapter" vendors_path = "#{framework_path}/Libraries/Vendors" - lz4_path = "#{vendors_path}/lz4" - mbedtls_path = "#{vendors_path}/mbedtls" - asio_path = "#{vendors_path}/asio" - openvpn_path = "#{vendors_path}/openvpn" - s.source_files = "#{framework_path}/*.{h,m,mm}" s.public_header_files = "#{framework_path}/*.h" @@ -59,13 +54,6 @@ Pod::Spec.new do |s| "#{framework_path}/NSArray+OpenVPNAdditions.h" ] - s.preserve_paths = [ - "#{lz4_path}/include/*.h", - "#{mbedtls_path}/include/**/*.h", - "#{asio_path}/asio/include/**/*.{hpp,ipp}", - "#{openvpn_path}/openvpn/**/*.hpp" - ] - s.module_map = "Configuration/OpenVPNAdapter.modulemap" @@ -74,20 +62,6 @@ Pod::Spec.new do |s| s.ios.frameworks = "Foundation", "NetworkExtension", "SystemConfiguration", "UIKit" s.osx.frameworks = "Foundation", "NetworkExtension", "SystemConfiguration" - s.ios.vendored_libraries = [ - "#{lz4_path}/lib/ios/liblz4.a", - "#{mbedtls_path}/lib/ios/libmbedcrypto.a", - "#{mbedtls_path}/lib/ios/libmbedtls.a", - "#{mbedtls_path}/lib/ios/libmbedx509.a" - ] - - s.osx.vendored_libraries = [ - "#{lz4_path}/lib/macos/liblz4.a", - "#{mbedtls_path}/lib/macos/libmbedcrypto.a", - "#{mbedtls_path}/lib/macos/libmbedtls.a", - "#{mbedtls_path}/lib/macos/libmbedx509.a" - ] - s.libraries = "lz4", "mbedcrypto", "mbedtls", "mbedx509" @@ -100,19 +74,77 @@ Pod::Spec.new do |s| "APPLICATION_EXTENSION_API_ONLY" => "YES", "CLANG_CXX_LANGUAGE_STANDARD" => "gnu++14", "CLANG_CXX_LIBRARY" => "libc++", - "HEADER_SEARCH_PATHS" => "\"${PODS_TARGET_SRCROOT}/#{lz4_path}/include/**\" \"${PODS_TARGET_SRCROOT}/#{mbedtls_path}/include/**\" \"${PODS_TARGET_SRCROOT}/#{asio_path}/asio/include/**\" \"${PODS_TARGET_SRCROOT}/#{openvpn_path}/**\"", "GCC_WARN_64_TO_32_BIT_CONVERSION" => "NO", - "CLANG_WARN_DOCUMENTATION_COMMENTS" => "NO", - "OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER" + "CLANG_WARN_DOCUMENTATION_COMMENTS" => "NO" } # ――― Subspecs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + s.subspec "lz4" do |lz4| + lz4_path = "#{vendors_path}/lz4" + + lz4.preserve_paths = "#{lz4_path}/include/*.h" + + lz4.ios.vendored_libraries = [ + "#{lz4_path}/lib/ios/liblz4.a" + ] + + lz4.osx.vendored_libraries = [ + "#{lz4_path}/lib/macos/liblz4.a" + ] + + lz4.xcconfig = { + "HEADER_SEARCH_PATHS" => "${PODS_TARGET_SRCROOT}/#{lz4_path}/include/**" + } + end + + s.subspec "mbedtls" do |mbedtls| + mbedtls_path = "#{vendors_path}/mbedtls" + + mbedtls.preserve_paths = "#{mbedtls_path}/include/**/*.h" + + mbedtls.ios.vendored_libraries = [ + "#{mbedtls_path}/lib/ios/libmbedcrypto.a", + "#{mbedtls_path}/lib/ios/libmbedtls.a", + "#{mbedtls_path}/lib/ios/libmbedx509.a" + ] + + mbedtls.osx.vendored_libraries = [ + "#{mbedtls_path}/lib/macos/libmbedcrypto.a", + "#{mbedtls_path}/lib/macos/libmbedtls.a", + "#{mbedtls_path}/lib/macos/libmbedx509.a" + ] + + mbedtls.xcconfig = { + "HEADER_SEARCH_PATHS" => "${PODS_TARGET_SRCROOT}/#{mbedtls_path}/include/**" + } + end + + s.subspec "asio" do |asio| + asio_path = "#{vendors_path}/asio" + + asio.preserve_paths = "#{asio_path}/asio/include/**/*.{hpp,ipp}" + + asio.xcconfig = { + "HEADER_SEARCH_PATHS" => "${PODS_TARGET_SRCROOT}/#{asio_path}/asio/include/**" + } + end + s.subspec "openvpn" do |openvpn| + openvpn_path = "#{vendors_path}/openvpn" + openvpn.source_files = "#{openvpn_path}/client/*.{hpp,cpp}" openvpn.private_header_files = "#{openvpn_path}/client/*.hpp" + + openvpn.preserve_paths = "#{openvpn_path}/openvpn/**/*.hpp" + openvpn.compiler_flags = "-x objective-c++" + + openvpn.xcconfig = { + "HEADER_SEARCH_PATHS" => "${PODS_TARGET_SRCROOT}/#{openvpn_path}/**", + "OTHER_CPLUSPLUSFLAGS" => "$(OTHER_CFLAGS) -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_STANDALONE -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_MBEDTLS -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER" + } end end From c7d2e363c86872a29bf375e2dd8300a94da94cf4 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Fri, 19 Oct 2018 12:45:21 +0300 Subject: [PATCH 16/16] Set source branch to develop --- OpenVPNAdapter.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenVPNAdapter.podspec b/OpenVPNAdapter.podspec index c20b690..c89a6f3 100644 --- a/OpenVPNAdapter.podspec +++ b/OpenVPNAdapter.podspec @@ -32,7 +32,7 @@ Pod::Spec.new do |s| # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - s.source = { :git => "https://github.com/ss-abramchuk/OpenVPNAdapter.git", :branch => "feature/cocoapods" } + s.source = { :git => "https://github.com/ss-abramchuk/OpenVPNAdapter.git", :branch => "develop" } # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #