lib/cocoapods-jxedt/binary/helper/prebuild_sandbox.rb in cocoapods-jxedt-0.0.16 vs lib/cocoapods-jxedt/binary/helper/prebuild_sandbox.rb in cocoapods-jxedt-0.0.17
- old
+ new
@@ -107,10 +107,26 @@
def project_path
root + 'Pods-Source.xcodeproj'
end
def clean_source_project!
- return if Jxedt.config.keep_source_project?
+ if Jxedt.config.keep_source_project?
+ # 修改productName后,可以把源码工程拖入workspace中源码调试,而源码不链接和编译
+ require 'xcodeproj'
+ project = Xcodeproj::Project.open(project_path)
+ project.targets.each do |target|
+ target.build_configurations.each do |config|
+ # 修改工程的product name
+ product_name = config.build_settings['PRODUCT_NAME'] || target.name
+ config.build_settings['PRODUCT_NAME'] = "#{product_name}_Source"
+ end
+ # target.name = "#{target.name}_Source"
+ end
+ project.save
+
+ # 保存源码工程,退出
+ return
+ end
sources_root.rmtree if real_path_compiler? && sources_root.exist?
root.rmtree if root.exist?
end
end
\ No newline at end of file