Podfile 2.65 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
def all_pods
7
	if ENV['PODFILE_PATH'].nil?
8
		pod 'linphone-sdk', '~> 4.4.0-alpha'
9
	else
10
		pod 'linphone-sdk', :path => ENV['PODFILE_PATH']  # local sdk
Paul Cartier's avatar
Paul Cartier committed
11
	end
12

DanmeiChen's avatar
DanmeiChen committed
13
	crashlytics
Paul Cartier's avatar
Paul Cartier committed
14 15
end

DanmeiChen's avatar
DanmeiChen committed
16 17
def crashlytics
	if not ENV['USE_CRASHLYTICS'].nil?
18
		pod 'Firebase/Analytics'
DanmeiChen's avatar
DanmeiChen committed
19
		pod 'Firebase/Crashlytics'
20
	end
21 22
end

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

  # Pods for linphone
28
	pod 'SVProgressHUD'
29
	all_pods
Ghislain MARY's avatar
Ghislain MARY committed
30 31 32

end

33 34 35 36 37
target 'msgNotificationService' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for messagesNotification
38
  all_pods
39 40 41 42 43 44 45 46

end

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

  # Pods for messagesNotification
47
  all_pods
48 49 50

end

51
post_install do |installer|
52 53 54 55 56 57 58 59 60
	# 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
			
61 62
	app_project = Xcodeproj::Project.open(Dir.glob("*.xcodeproj")[0])
	app_project.native_targets.each do |target|
DanmeiChen's avatar
DanmeiChen committed
63
		target.build_configurations.each do |config|
64 65 66 67 68 69 70
			if target.name == "linphone" || target.name == 'msgNotificationService' || target.name == 'msgNotificationContent'
				if ENV['USE_CRASHLYTICS'].nil?
					if config.name == "Debug" then
						config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) DEBUG=1'
						else
						config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited)'
					end
DanmeiChen's avatar
DanmeiChen committed
71 72
					config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited)'
				else
73 74 75 76 77 78
					# activate crashlytics
					if config.name == "Debug" then
						config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) DEBUG=1 USE_CRASHLYTICS=1'
					else
						config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) USE_CRASHLYTICS=1'
					end
DanmeiChen's avatar
DanmeiChen committed
79
					config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -DUSE_CRASHLYTICS'
80 81
				end
			end
DanmeiChen's avatar
DanmeiChen committed
82

83 84
			if target.name == "linphone"
				config.build_settings['OTHER_CFLAGS'] = '-DBCTBX_LOG_DOMAIN=\"ios\"',
DanmeiChen's avatar
DanmeiChen committed
85 86 87 88 89
																							'-DCHECK_VERSION_UPDATE=FALSE',
																							'-DENABLE_QRCODE=TRUE',
																							'-DENABLE_SMS_INVITE=TRUE',
																							'$(inherited)',
																							"-DLINPHONE_SDK_VERSION=\\\"#{$linphone_sdk_version}\\\""
90
			end
DanmeiChen's avatar
DanmeiChen committed
91 92

			app_project.save
93 94 95
		end
	end
end