App running state
Showing
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
# Uncomment the next line to define a global platform for your project | ||
workspace '1Weather' | ||
platform :ios, '11.0' | ||
# Comment the next line if you don't want to use dynamic frameworks | ||
use_frameworks! | ||
workspace '1Weather' | ||
def shared_pods | ||
pod 'XMLCoder', '~> 0.12.0' | ||
pod 'Firebase/Crashlytics' | ||
pod 'GoogleUtilities' | ||
end | ||
#Core pods | ||
def core_pods | ||
pod 'XMLCoder', '~> 0.12.0' | ||
pod 'Localize-Swift' | ||
pod 'Firebase/Crashlytics' | ||
pod 'Firebase/RemoteConfig' | ||
pod 'GoogleUtilities' | ||
# If updating the podspec, make sure to add a tag and push it to origin | ||
pod 'Swarm', :git => 'git@gitlab.pinsightmedia.com:oneweather/wdt-skywisetilekit-ios.git', :branch => 'develop' | ||
end | ||
... | ... | @@ -34,17 +33,9 @@ def analytics_pods |
pod 'AppsFlyerFramework' | ||
pod 'Flurry-iOS-SDK/FlurrySDK' | ||
# Recommended: Add the Firebase pod for Google Analytics | ||
pod 'GoogleUtilities' | ||
pod 'Firebase/Crashlytics' | ||
pod 'Firebase/Analytics' | ||
end | ||
target 'OneWeatherAnalytics' do | ||
project 'OneWeatherAnalytics/OneWeatherAnalytics.project' | ||
analytics_pods | ||
ad_pods | ||
end | ||
#Application | ||
def application_pods | ||
pod 'SnapKit' | ||
... | ... | @@ -55,7 +46,9 @@ def application_pods |
pod 'PKHUD', '~> 5.0' | ||
end | ||
#-------Targets------- | ||
target '1Weather' do | ||
shared_pods | ||
core_pods | ||
ad_pods | ||
analytics_pods | ||
... | ... | @@ -65,38 +58,45 @@ end |
#Core | ||
target 'OneWeatherCore' do | ||
project 'OneWeatherCore/OneWeatherCore.project' | ||
analytics_pods | ||
shared_pods | ||
core_pods | ||
end | ||
#CoreDataStorage | ||
target 'CoreDataStorage' do | ||
project 'CoreDataStorage/CoreDataStorage.project' | ||
core_pods | ||
shared_pods | ||
end | ||
#BlendFIPSSource | ||
target 'BlendFIPSSource' do | ||
project 'BlendFIPS/BlendFIPSSource.project' | ||
core_pods | ||
shared_pods | ||
end | ||
#BlendHealthSource | ||
target 'BlendHealthSource' do | ||
project 'BlendHealthSource/BlendHealthSource.project' | ||
core_pods | ||
shared_pods | ||
end | ||
#DelayedSaveStorage | ||
target 'DelayedSaveStorage' do | ||
project 'DelayedSaveStorage/DelayedSaveStorage.project' | ||
core_pods | ||
shared_pods | ||
end | ||
#WDTSource | ||
target 'WDTWeatherSource' do | ||
project 'WDTWeatherSource/WDTWeatherSource.project' | ||
core_pods | ||
shared_pods | ||
end | ||
#Analytics | ||
target 'OneWeatherAnalytics' do | ||
project 'OneWeatherAnalytics/OneWeatherAnalytics.project' | ||
shared_pods | ||
analytics_pods | ||
end | ||
target 'OneWeatherNotificationServiceExtension' do | ||
... | ... | @@ -105,3 +105,68 @@ target 'OneWeatherNotificationServiceExtension' do |
end | ||
post_install do |installer| | ||
auto_process_target(['1Weather'], 'OneWeatherAnalytics', installer) | ||
end | ||
def auto_process_target(app_target_names, embedded_target_name, installer) | ||
words = find_words_at_embedded_target('Pods-' + embedded_target_name, | ||
installer) | ||
handle_app_targets(app_target_names.map{ |str| 'Pods-' + str }, | ||
words, | ||
installer) | ||
end | ||
def find_line_with_start(str, start) | ||
str.each_line do |line| | ||
if line.start_with?(start) | ||
return line | ||
end | ||
end | ||
return nil | ||
end | ||
def remove_words(str, words) | ||
new_str = str | ||
words.each do |word| | ||
new_str = new_str.sub(word, '') | ||
end | ||
return new_str | ||
end | ||
def find_words_at_embedded_target(target_name, installer) | ||
target = installer.pods_project.targets.find { |target| target.name == target_name } | ||
target.build_configurations.each do |config| | ||
xcconfig_path = config.base_configuration_reference.real_path | ||
xcconfig = File.read(xcconfig_path) | ||
old_line = find_line_with_start(xcconfig, "OTHER_LDFLAGS") | ||
if old_line == nil | ||
next | ||
end | ||
words = old_line.split(' ').select{ |str| str.start_with?("-l") }.map{ |str| ' ' + str } | ||
return words | ||
end | ||
end | ||
def handle_app_targets(names, words, installer) | ||
installer.pods_project.targets.each do |target| | ||
if names.index(target.name) == nil | ||
next | ||
end | ||
puts "Updating #{target.name} OTHER_LDFLAGS" | ||
target.build_configurations.each do |config| | ||
xcconfig_path = config.base_configuration_reference.real_path | ||
xcconfig = File.read(xcconfig_path) | ||
old_line = find_line_with_start(xcconfig, "OTHER_LDFLAGS") | ||
if old_line == nil | ||
next | ||
end | ||
new_line = remove_words(old_line, words) | ||
new_xcconfig = xcconfig.sub(old_line, new_line) | ||
File.open(xcconfig_path, "w") { |file| file << new_xcconfig } | ||
end | ||
end | ||
end |
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to comment