Podfile 2.14 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 5 6
use_frameworks!

# Libraries

7 8
$git_root = "https://github.com/pia-foss"

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

$tunnel_pod = 'PIATunnel'
19
$tunnel_repo = 'tunnel-apple'
Davide De Rosa's avatar
Davide De Rosa committed
20 21 22

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

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

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

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

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

def tunnel_by_version(version)
Davide De Rosa's avatar
Davide De Rosa committed
48
    pod $tunnel_pod, version
Davide De Rosa's avatar
Davide De Rosa committed
49 50 51 52 53 54
end

# Pod groups

def shared_main_pods
    pod 'AlamofireImage'
55
    #library_by_path('')
Jose Blaya's avatar
Jose Blaya committed
56
    library_by_git('956464e')
57
    #library_by_version('~> 1.1.3')
Davide De Rosa's avatar
Davide De Rosa committed
58 59 60 61 62 63 64 65
end

def app_pods
    shared_main_pods
    pod 'iRate'
    pod 'TPKeyboardAvoiding'
    pod 'SideMenu', '= 3.1.5'
    pod 'FXPageControl'
66
    pod 'DZNEmptyDataSet'
67
    pod 'PopupDialog'
Davide De Rosa's avatar
Davide De Rosa committed
68 69 70
end

def tunnel_pods
71 72
    #tunnel_by_path('')
    tunnel_by_git('bd53e0a')
73
    #tunnel_by_version('~> 1.1.6')
Davide De Rosa's avatar
Davide De Rosa committed
74 75 76 77 78 79 80 81 82 83
end

# Targets

target 'PIA VPN' do
    app_pods
end

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

target 'PIA VPN Tunnel' do
    tunnel_pods
end
94

95 96 97 98 99 100 101 102
target 'PIA VPNTests' do
    app_pods
    pod 'HockeySDK'
    pod 'Firebase/Core'
    pod 'Crashlytics'
    pod 'Fabric'
end

103 104 105 106 107 108 109 110 111
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
    end
end