Commit c21acb82 authored by Samuel Giddins's avatar Samuel Giddins

Set the CFBundleIdentifier using the PRODUCT_BUNDLE_IDENTIFIER build setting

This is how Xcode 7 likes to do things
parent f7578085
...@@ -64,7 +64,7 @@ module Pod ...@@ -64,7 +64,7 @@ module Pod
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string> <string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
......
...@@ -50,7 +50,8 @@ module Pod ...@@ -50,7 +50,8 @@ module Pod
'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(search_paths), 'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(search_paths),
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1', 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
'SKIP_INSTALL' => 'YES', 'SKIP_INSTALL' => 'YES',
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ' 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
'PRODUCT_BUNDLE_IDENTIFIER' => 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}',
# 'USE_HEADERMAP' => 'NO' # 'USE_HEADERMAP' => 'NO'
} }
......
...@@ -43,11 +43,12 @@ module Pod ...@@ -43,11 +43,12 @@ module Pod
# #
def custom_build_settings def custom_build_settings
settings = { settings = {
'OTHER_LDFLAGS' => '', 'MACH_O_TYPE' => 'staticlib',
'OTHER_LIBTOOLFLAGS' => '', 'OTHER_LDFLAGS' => '',
'PODS_ROOT' => '$(SRCROOT)', 'OTHER_LIBTOOLFLAGS' => '',
'SKIP_INSTALL' => 'YES', 'PODS_ROOT' => '$(SRCROOT)',
'MACH_O_TYPE' => 'staticlib', 'PRODUCT_BUNDLE_IDENTIFIER' => 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}',
'SKIP_INSTALL' => 'YES',
} }
super.merge(settings) super.merge(settings)
end end
......
...@@ -62,4 +62,22 @@ describe Pod::Generator::InfoPlistFile do ...@@ -62,4 +62,22 @@ describe Pod::Generator::InfoPlistFile do
`plutil -lint #{file}` `plutil -lint #{file}`
$?.should.be.success $?.should.be.success
end end
it 'generates a correct Info.plist file' do
generator = Pod::Generator::InfoPlistFile.new(mock('Target'))
file = temporary_directory + 'Info.plist'
generator.save_as(file)
Xcodeproj::PlistHelper.read(file).should == {
'CFBundleDevelopmentRegion' => 'en',
'CFBundleExecutable' => '${EXECUTABLE_NAME}',
'CFBundleIdentifier' => '${PRODUCT_BUNDLE_IDENTIFIER}',
'CFBundleInfoDictionaryVersion' => '6.0',
'CFBundleName' => '${PRODUCT_NAME}',
'CFBundlePackageType' => 'FMWK',
'CFBundleShortVersionString' => '1.0.0',
'CFBundleSignature' => '????',
'CFBundleVersion' => '${CURRENT_PROJECT_VERSION}',
'NSPrincipalClass' => '',
}
end
end end
...@@ -99,6 +99,10 @@ module Pod ...@@ -99,6 +99,10 @@ module Pod
@xcconfig.to_hash['SKIP_INSTALL'].should == 'YES' @xcconfig.to_hash['SKIP_INSTALL'].should == 'YES'
end end
it 'sets PRODUCT_BUNDLE_IDENTIFIER' do
@xcconfig.to_hash['PRODUCT_BUNDLE_IDENTIFIER'].should == 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}'
end
it 'saves the xcconfig' do it 'saves the xcconfig' do
path = temporary_directory + 'sample.xcconfig' path = temporary_directory + 'sample.xcconfig'
@generator.save_as(path) @generator.save_as(path)
......
...@@ -114,6 +114,13 @@ module Pod ...@@ -114,6 +114,13 @@ module Pod
end end
end end
it 'has a PRODUCT_BUNDLE_IDENTIFIER set' do
@installer.install!
@installer.target.native_target.build_configurations.each do |config|
config.build_settings['PRODUCT_BUNDLE_IDENTIFIER'].should == 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}'
end
end
#--------------------------------------# #--------------------------------------#
it 'creates the xcconfig file' do it 'creates the xcconfig file' do
......
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