Method: IOS::ProjectManipulator#createExampleProject

Defined in:
lib/ios/module/setup/ProjectManipulator.rb

#createExampleProjectObject



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/ios/module/setup/ProjectManipulator.rb', line 76

def createExampleProject
    @configurator.printMessage("Criando projeto Exemplo")
    projectFileName = File.join(@module_root_path, "Example")
    FileUtils.cp_r(File.join(@configurator.template_path, "/Example/Example"), @module_root_path)

    podDevInjection = "pod '${POD_NAME}', path: '../'"

    if @has_test == :yes
        podDevInjection = "pod '${POD_NAME}', path: '../', :testspecs => ['Tests']"
    end

    if @has_interface == :yes
        podDevInjection += "\n    pod '${POD_NAME}Interface', path: '../'"
    end

     podDevInjection += "\n"
    podDevInjection += "\n    pod 'SBFoundation', path: '../../../CoreModules/SBFoundation'"
    if @module_type == :feature
        podDevInjection += "\n    pod 'SBUIKit', path: '../../../CoreModules/SBUIKit'"
        podDevInjection += "\n    pod 'SBRouterService', path: '../../../CoreModules/SBRouterService'"
        podDevInjection += "\n    pod 'SBRouterServiceInterface', path: '../../../CoreModules/SBRouterService'"
        podDevInjection += "\n    pod 'SBDependency', path: '../../../CoreModules/SBDependency'"
        podDevInjection += "\n    pod 'SBDependencyInterface', path: '../../../CoreModules/SBDependency'"
        podDevInjection += "\n    pod 'SBAnalyticsInterface', path: '../../../CoreModules/SBAnalytics'"
        podDevInjection += "\n    pod 'SBLoggerInterface', path: '../../../CoreModules/SBLogger'"
        if @mock_network == :yes
            podDevInjection += "\n    pod 'SBUserSessionInterface', path: '../../../CoreModules/SBUserSession'"
            podDevInjection += "\n    pod 'SBNetworkOld', path: '../../../CoreModules/SBNetworkOld'"
            podDevInjection += "\n    pod 'Fetcher', path: '../../../CoreModules/Fetcher'"
            podDevInjection += "\n    pod 'Flow', path: '../../../CoreModules/Flow'"
          podDevInjection += "\n    pod 'SecFoundation', path: '../../../CoreModules/SecFoundation'"
            podDevInjection += "\n    pod 'SBSecurity', path: '../../../CoreModules/SBSecurity'"
            podDevInjection += "\n    pod 'SBSecurityInterface', path: '../../../CoreModules/SBSecurity'"
            podDevInjection += "\n    pod 'SBFeatureTogglesKitInterface', path: '../../../CoreModules/SBFeatureTogglesKit'"
        end
        podDevInjection += "\n    pod 'SBAssets', :git => '[email protected]:acelera/ios-ds-assets.git', :branch => 'master'"
        podDevInjection += "\n    pod 'IDwallToolkit', :git => '[email protected]:acelera/ios-frameworks.git', :branch => 'master'"

    end

    text = File.read projectFileName + "/Podfile"
    text.gsub!("${DEV_PODS}", podDevInjection)
    text.gsub!("${POD_NAME}", @configurator.pod_name)
    File.open(projectFileName + "/Podfile", "w") { |file| file.puts text}
    @configurator.printDone
end