Podfile 3.17 KB
Newer Older
Ghislain MARY's avatar
Ghislain MARY committed
1 2
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
DanmeiChen's avatar
DanmeiChen committed
3
source "https://gitlab.linphone.org/BC/public/podspec.git"
DanmeiChen's avatar
DanmeiChen committed
4
source "https://github.com/CocoaPods/Specs.git"
Ghislain MARY's avatar
Ghislain MARY committed
5

6 7
def basic_pods
	if ENV['PODFILE_PATH'].nil?
DanmeiChen's avatar
DanmeiChen committed
8
		pod 'linphone-sdk', '4.2'
9 10 11 12
		else
		pod 'linphone-sdk', :path => ENV['PODFILE_PATH']  # loacl sdk
	end
	
13 14 15 16 17 18 19
	if not ENV['USE_CRASHLYTHICS'].nil?
		# activate crashlythics
		pod 'Firebase/Core'
		pod 'Fabric', '~> 1.9.0'
		pod 'Crashlytics', '~> 3.12.0'
		pod 'Firebase/Performance'
	end
20 21
end

Ghislain MARY's avatar
Ghislain MARY committed
22 23 24 25 26
target 'liblinphoneTester' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for liblinphoneTester
27
  basic_pods
DanmeiChen's avatar
DanmeiChen committed
28
  
Ghislain MARY's avatar
Ghislain MARY committed
29 30 31 32 33 34 35 36 37 38 39 40
  target 'liblinphoneTesterTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'linphone' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for linphone
41
  basic_pods
42
	pod 'SVProgressHUD'
Ghislain MARY's avatar
Ghislain MARY committed
43 44 45

  target 'linphoneTests' do
    inherit! :search_paths
DanmeiChen's avatar
DanmeiChen committed
46
		pod 'KIF', :configurations => ['Debug']
Ghislain MARY's avatar
Ghislain MARY committed
47 48 49 50 51 52 53 54 55 56 57 58 59
    # Pods for testing
  end

end

target 'linphoneExtension' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for linphoneExtension

end

60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
=begin
target 'latestCallsWidget' do
	# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
	use_frameworks!
	
	# Pods for latestCallsWidget
	
end

target 'latestChatroomsWidget' do
	# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
	use_frameworks!
	
	# Pods for latestChatroomsWidget
end


Ghislain MARY's avatar
Ghislain MARY committed
77 78 79 80 81 82 83
target 'richNotifications' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for richNotifications

end
84
=end
85 86

post_install do |installer|
87 88 89 90 91 92 93 94 95
	# Get the version of linphone-sdk
	installer.pod_targets.each do |target|
		if target.pod_name == 'linphone-sdk'
			target.specs.each do |spec|
				$linphone_sdk_version = spec.version
			end
		end
	end
			
96 97 98 99 100
	app_project = Xcodeproj::Project.open(Dir.glob("*.xcodeproj")[0])
	app_project.native_targets.each do |target|
		if target.name == 'linphone'
			target.build_configurations.each do |config|
				if ENV['USE_CRASHLYTHICS'].nil?
DanmeiChen's avatar
DanmeiChen committed
101 102 103 104 105
					if config.name == "Debug" then
						config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) DEBUG=1'
					else
						config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited)'
					end
106 107
				else
					# activate crashlythics
DanmeiChen's avatar
DanmeiChen committed
108 109 110 111 112
					if config.name == "Debug" then
						config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) DEBUG=1 USE_CRASHLYTHICSS=1'
						else
						config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) USE_CRASHLYTHICSS=1'
					end
113
				end
114

115 116 117 118 119 120
				config.build_settings['OTHER_CFLAGS'] = '-DBCTBX_LOG_DOMAIN=\"ios\"',
																								'-DCHECK_VERSION_UPDATE=FALSE',
																								'-DENABLE_QRCODE=TRUE',
																								'-DENABLE_SMS_INVITE=TRUE',
																								'$(inherited)',
																								"-DLINPHONE_SDK_VERSION=\\\"#{$linphone_sdk_version}\\\""
121
				
122 123 124 125 126
				app_project.save
			end
		end
	end
end