Podfile 2.41 KB
Newer Older
Davide De Rosa's avatar
Davide De Rosa committed
1
source 'https://github.com/CocoaPods/Specs.git'
Jose Blaya's avatar
Jose Blaya committed
2
platform :ios, '10.0'
Davide De Rosa's avatar
Davide De Rosa committed
3 4
use_frameworks!

Jose Blaya's avatar
Jose Blaya committed
5 6 7
# ignore all warnings from all pods
inhibit_all_warnings!

Davide De Rosa's avatar
Davide De Rosa committed
8 9
# Libraries

10 11
$git_root = "https://github.com/pia-foss"

Davide De Rosa's avatar
Davide De Rosa committed
12
$library_pod = 'PIALibrary'
13
$library_repo = 'client-library-apple'
Davide De Rosa's avatar
Davide De Rosa committed
14 15 16 17 18 19 20 21
$library_subspecs = [
    'Library',
    'UI',
    'Mock',
    'VPN'
]

$tunnel_pod = 'PIATunnel'
22
$tunnel_repo = 'tunnel-apple'
Davide De Rosa's avatar
Davide De Rosa committed
23 24 25

def library_by_path(root)
    $library_subspecs.each { |name|
26
        pod "#{$library_pod}/#{name}", :path => "#{root}/#{$library_repo}"
Davide De Rosa's avatar
Davide De Rosa committed
27 28 29 30 31
    }
end

def library_by_git(sha)
    $library_subspecs.each { |name|
32
        pod "#{$library_pod}/#{name}", :git => "#{$git_root}/#{$library_repo}", :commit => sha
Davide De Rosa's avatar
Davide De Rosa committed
33 34 35 36 37
    }
end

def library_by_version(version)
    $library_subspecs.each { |name|
Davide De Rosa's avatar
Davide De Rosa committed
38
        pod "#{$library_pod}/#{name}", version
Davide De Rosa's avatar
Davide De Rosa committed
39 40 41 42
    }
end

def tunnel_by_path(root)
43
    pod $tunnel_pod, :path => "#{root}/#{$tunnel_repo}"
Davide De Rosa's avatar
Davide De Rosa committed
44 45 46
end

def tunnel_by_git(sha)
47
    pod $tunnel_pod, :git => "#{$git_root}/#{$tunnel_repo}", :commit => sha
Davide De Rosa's avatar
Davide De Rosa committed
48 49 50
end

def tunnel_by_version(version)
Davide De Rosa's avatar
Davide De Rosa committed
51
    pod $tunnel_pod, version
Davide De Rosa's avatar
Davide De Rosa committed
52 53 54 55 56 57
end

# Pod groups

def shared_main_pods
    pod 'AlamofireImage'
58
    #library_by_path('')
59
    library_by_git('ac88c39')
60
    #library_by_version('~> 1.1.3')
Davide De Rosa's avatar
Davide De Rosa committed
61 62 63 64 65 66 67 68
end

def app_pods
    shared_main_pods
    pod 'iRate'
    pod 'TPKeyboardAvoiding'
    pod 'SideMenu', '= 3.1.5'
    pod 'FXPageControl'
69
    pod 'DZNEmptyDataSet'
70
    pod 'PopupDialog'
Davide De Rosa's avatar
Davide De Rosa committed
71 72 73
end

def tunnel_pods
74
    #tunnel_by_path('')
Jose Blaya's avatar
Jose Blaya committed
75
    tunnel_by_git('257296c')
76
    #tunnel_by_version('~> 1.1.6')
Davide De Rosa's avatar
Davide De Rosa committed
77 78 79 80 81 82 83 84 85 86
end

# Targets

target 'PIA VPN' do
    app_pods
end

target 'PIA VPN dev' do
    app_pods
Jose Blaya's avatar
Jose Blaya committed
87
    #only use the following pods for internal (non-public) builds
Davide De Rosa's avatar
Davide De Rosa committed
88
    pod 'HockeySDK'
89 90 91
    pod 'Firebase/Core'
    pod 'Crashlytics'
    pod 'Fabric'
Davide De Rosa's avatar
Davide De Rosa committed
92 93 94 95 96
end

target 'PIA VPN Tunnel' do
    tunnel_pods
end
97

98 99 100 101 102 103 104 105
target 'PIA VPNTests' do
    app_pods
    pod 'HockeySDK'
    pod 'Firebase/Core'
    pod 'Crashlytics'
    pod 'Fabric'
end

106 107 108 109 110 111 112
post_install do |installer|
    installer.pods_project.targets.each do |target|
        if ['PopupDialog'].include? target.name
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.2'
            end
        end
Jose Blaya's avatar
Jose Blaya committed
113 114 115 116 117
        if ['SwiftEntryKit', 'QuickLayout', 'SideMenu'].include? target.name
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.0'
            end
        end
118 119
    end
end