source 'git@github.com:CocoaPods/Specs.git'
source 'git@gitlab-ce.emas-poc.com:EMAS-iOS/emas-specs-thirdpart.git'
source 'git@gitlab-ce.emas-poc.com:EMAS-iOS/emas-specs.git'
# WeexComponents
source 'git@gitlab-ce.emas-poc.com:EMAS-Weex-iOS/weex-common.git'
source 'git@gitlab-ce.emas-poc.com:EMAS-Weex-iOS/native-common.git'

#project '<%= appName %>.xcodeproj'
platform :ios, '9.0'
inhibit_all_warnings!

def commonLibraryDependencies
    # --通用库
    pod  'UserTrack',        '6.3.5.100005-poc'
    pod  'Reachability',     '3.2'
    pod  'FMDB',             '2.7.2'
    pod  'NetworkSDK',       '10.0.4.2'
    pod  'tnet',             '10.2.0'
    pod  'AliEMASConfigure',  '0.0.1.13'
    pod  'CYLTabBarController', '~> 1.17.14'
    pod  'SDWebImage', '3.7.5'
    pod  'ZipArchive', '~> 1.4.0'
end

def accsLibraryDependencies
    # --ACCS(通用库 -> ACCS)
    pod  'TBAccsSDK',         '10.0.7'
    # --高可用(通用库-> ACCS -> 高可用)
    pod  'AliHAAdapter4poc',   '10.0.5.2'    
end

def mtopLibraryDependencies
    # --网关(通用库-> 网关)
    pod  'MtopSDK',          '10.0.6'
    pod  'mtopext/MtopCore', '10.0.6'
end

def orangeLibraryDependencies
    # --远程配置
    pod 'orange','10.0.0'
end

def weexLibraryDependencies
    # --Weex(通用库-> 高可用 -> 网关 -> Weex)
    pod 'WeexSDK', '0.20.0.3-EMAS'
    pod 'ZCache', '10.0.3'
    pod 'DynamicConfiguration', '10.0.4'
    pod 'DynamicConfigurationAdaptor', '10.0.4'
    
    # EMASWeex
    pod 'EMASWeex', '1.3.0'
    pod 'WXDevtool', '~> 0.20.0' ,:configurations => ['Debug']
    pod 'SocketRocket'
end

def weexEmasComponentsLibraryDependencies
    #weex商业组件
    pod 'EmasWeexComponents', '0.0.4'
    pod 'EmasXBase', '0.0.2'
    pod 'EmasSocial', '0.0.1'
    pod 'WeexPluginLoader'
end 

def weexUILibraryDependencies
    #weex开源组件
    pod 'BindingX', '~> 1.0.2'
end 

def weexAceChartLibraryDependencies
    # WeexAceChart
    source 'git@gitlab-ce.emas-poc.com:EMAS-Weex-iOS/weex-chart.git'
    source 'git@gitlab-ce.emas-poc.com:EMAS-Weex-iOS/native-chart.git'
    #weex商业图表
    pod 'WeexAceChart'
end 

def htmlLibraryDependencies
    # WindVane
    pod 'WindVane', '1.1.0'
end

def pushLibraryDependencies
     # --PUSH(通用库 -> PUSH)
    pod  'PushCenterSDK',     '10.0.1'
end

def httpdnsLibraryDependencies
    source 'https://github.com/aliyun/aliyun-specs.git'
    pod 'AlicloudHTTPDNS'
end

def hotfixLibraryDependencies
    # --热修复
    pod 'AlicloudLua', '5.1.4.2'
    pod 'AlicloudHotFixDebugEmas', '~> 1.0.5'
    pod 'AlicloudUtils', '1.3.4'
end

def manLibraryDependencies
    # 数据分析
    pod 'EMASMAN', '10.0.0'    
end

def otherLibraryDependencies
end

target '<%= appName %>' do
    commonLibraryDependencies
    accsLibraryDependencies
    mtopLibraryDependencies
    orangeLibraryDependencies

    # 可选部分
    # Weex 通用组件
    weexLibraryDependencies #APPSUITETAG
    #weex商业图表
    weexAceChartLibraryDependencies #APPSUITETAG
    # weex商业组件
    weexEmasComponentsLibraryDependencies #APPSUITETAG
    # weex UI 组件
    weexUILibraryDependencies #APPSUITETAG
    # H5容器 （WindVane）
    htmlLibraryDependencies #APPSUITETAG
    # 推送 SDK
    pushLibraryDependencies #APPSUITETAG
    # 热修复 SDK
    hotfixLibraryDependencies #APPSUITETAG
    # MAN SDK
    manLibraryDependencies #APPSUITETAG
    # other Library
    otherLibraryDependencies
end

# post_install do |installer|
#     copy_pods_resources_path = "Pods/Target Support Files/Pods-<%= appName %>/Pods-<%= appName %>-resources.sh"
#     string_to_replace = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"'
#     assets_compile_with_app_icon_arguments = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${BUILD_DIR}/assetcatalog_generated_info.plist"'
#     text = File.read(copy_pods_resources_path)
#     new_contents = text.gsub(string_to_replace, assets_compile_with_app_icon_arguments)
#     File.open(copy_pods_resources_path, "w") {|file| file.puts new_contents }
# end
