Commit 7300c82c authored by Samuel Giddins's avatar Samuel Giddins

[Target] Always use the #product_module_name as the $PRODUCT_NAME

parent 83787fab
...@@ -101,9 +101,6 @@ module Pod ...@@ -101,9 +101,6 @@ module Pod
settings['SWIFT_VERSION'] = target.swift_version settings['SWIFT_VERSION'] = target.swift_version
end end
if target.requires_frameworks? || target.uses_swift?
settings['DEFINES_MODULE'] = 'YES'
end
settings settings
end end
...@@ -610,8 +607,15 @@ module Pod ...@@ -610,8 +607,15 @@ module Pod
return super unless custom_module_map return super unless custom_module_map
path = target.module_map_path path = target.module_map_path
UI.message "- Copying module map file to #{UI.path(path)}" do UI.message "- Copying module map file to #{UI.path(path)}" do
unless path.exist? && FileUtils.identical?(custom_module_map, path) Tempfile.open(path.basename.to_s) do |tmp_module_map|
FileUtils.cp(custom_module_map, path) contents = custom_module_map.read
unless target.requires_frameworks?
contents.gsub!(/^(\s*)framework\s+module/, '\1module')
end
tmp_module_map.write contents
tmp_module_map.rewind
unless path.exist? && FileUtils.identical?(tmp_module_map, path)
FileUtils.cp(tmp_module_map, path)
end end
add_file_to_support_group(path) add_file_to_support_group(path)
...@@ -621,6 +625,7 @@ module Pod ...@@ -621,6 +625,7 @@ module Pod
end end
end end
end end
end
def create_umbrella_header def create_umbrella_header
return super unless custom_module_map return super unless custom_module_map
...@@ -696,6 +701,14 @@ module Pod ...@@ -696,6 +701,14 @@ module Pod
ditto "${PODS_ROOT}/#{target.module_map_path.relative_path_from(target.sandbox.root)}" "${MODULE_MAP_PATH}" ditto "${PODS_ROOT}/#{target.module_map_path.relative_path_from(target.sandbox.root)}" "${MODULE_MAP_PATH}"
printf "\\n\\nmodule ${PRODUCT_MODULE_NAME}.Swift {\\n header \\"${COMPATIBILITY_HEADER_PATH}\\"\\n requires objc\\n}\\n" >> "${MODULE_MAP_PATH}" printf "\\n\\nmodule ${PRODUCT_MODULE_NAME}.Swift {\\n header \\"${COMPATIBILITY_HEADER_PATH}\\"\\n requires objc\\n}\\n" >> "${MODULE_MAP_PATH}"
SH SH
build_phase.input_paths = %W[
${DERIVED_SOURCES_DIR}/${PRODUCT_MODULE_NAME}-Swift.h
${PODS_ROOT}/#{target.module_map_path.relative_path_from(target.sandbox.root)}
]
build_phase.output_paths = %W[
${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap
${BUILT_PRODUCTS_DIR}/Swift\ Compatibility\ Header/${PRODUCT_MODULE_NAME}-Swift.h
]
end end
#-----------------------------------------------------------------------# #-----------------------------------------------------------------------#
......
...@@ -74,7 +74,9 @@ module Pod ...@@ -74,7 +74,9 @@ module Pod
# @return [Hash{String => String}] # @return [Hash{String => String}]
# #
def custom_build_settings def custom_build_settings
settings = {} settings = {
'PRODUCT_NAME' => target.product_module_name
}
unless target.archs.empty? unless target.archs.empty?
settings['ARCHS'] = target.archs settings['ARCHS'] = target.archs
......
...@@ -45,11 +45,7 @@ module Pod ...@@ -45,11 +45,7 @@ module Pod
# and #product_module_name or #label. # and #product_module_name or #label.
# #
def product_basename def product_basename
if requires_frameworks?
product_module_name product_module_name
else
label
end
end end
# @return [String] the name of the framework, depends on #label. # @return [String] the name of the framework, depends on #label.
...@@ -67,7 +63,7 @@ module Pod ...@@ -67,7 +63,7 @@ module Pod
# used for migration. # used for migration.
# #
def static_library_name def static_library_name
"lib#{label}.a" "lib#{product_module_name}.a"
end end
# @return [Symbol] either :framework or :static_library, depends on # @return [Symbol] either :framework or :static_library, depends on
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment