lib/ios/module/setup/ProjectManipulator.rb in shellboxCLI-0.1.2 vs lib/ios/module/setup/ProjectManipulator.rb in shellboxCLI-0.1.3

- old
+ new

@@ -85,10 +85,17 @@ if @has_interface == :yes podDevInjection += "\n pod '${POD_NAME}Interface', path: '../'" end + if @module_type == :feature + podDevInjection += "\n\n pod 'SBFoundation', path: '../../../CoreModules/SBFoundation'" + podDevInjection += "\n pod 'SBUIKit', path: '../../../CoreModules/SBUIKit'" + podDevInjection += "\n pod 'SBRouterServiceInterface', path: '../../../CoreModules/SBRouterService'" + podDevInjection += "\n pod 'SBDependencyInterface', path: '../../../CoreModules/SBDependency'" + 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 @@ -212,18 +219,24 @@ podTests = "" if @has_test == :yes podTests = "# TESTS" podTests += "\n s.test_spec 'Tests' do |test_spec|" - podTests += "\n test_spec.source_files = '${POD_NAME}Tests/**/*'" - podTests += "\n test_spec.exclude_files = '${POD_NAME}Tests/Resources/*.plist'" + podTests += "\n test_spec.source_files = '${POD_NAME}Tests/**/*'" + podTests += "\n test_spec.exclude_files = '${POD_NAME}Tests/Resources/*.plist'" podTests += "\n end" end - podInternal = "" + podInternal = "s.dependency 'SBFoundation'" + + if @module_type == :feature + podInternal += "\n s.dependency 'SBUIKit'" + podInternal += "\n s.dependency 'SBDependencyInterface'" + end + if @has_interface == :yes - podInternal = "s.dependency '${POD_NAME}Interface'" + podInternal += "\n s.dependency '${POD_NAME}Interface'" end text.gsub!("${FEATURE_INTERNAL}", podInternal) text.gsub!("${FEATURE_TEST}", podTests) text.gsub!("${POD_NAME}", @configurator.pod_name) @@ -236,9 +249,16 @@ def createPodspecInterface @configurator.printMessage("Configurando arquivo Podspec Interface") podspecFilename = "#{module_root_path}/#{@configurator.pod_name}Interface.podspec" FileUtils.cp(File.join(@configurator.template_path, "NAMEInterface.podspec"), podspecFilename) text = File.read podspecFilename + + podInternal = "" + if @module_type == :feature + podInternal += "\n s.dependency 'SBRouterServiceInterface'" + end + + text.gsub!("${FEATURE_INTERNAL}", podInternal) text.gsub!("${POD_NAME}", @configurator.pod_name) text.gsub!("${USER_NAME}", @configurator.user_name) text.gsub!("${USER_EMAIL}", @configurator.user_email) File.open(podspecFilename, "w") { |file| file.puts text} @configurator.printDone \ No newline at end of file