Skip to content

Commit

Permalink
Merge pull request #10950 from CocoaPods/development_language
Browse files Browse the repository at this point in the history
Use `${DEVELOPMENT_LANGUAGE}` as the default `CFBundleDevelopmentRegion` value in any generated `Info.plist`.
  • Loading branch information
dnkoutso committed Sep 17, 2021
2 parents c949589 + f55c026 commit f120f9f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### Enhancements

* None.
* Use `${DEVELOPMENT_LANGUAGE}` as the default `CFBundleDevelopmentRegion` value in any generated `Info.plist`.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#10950](https://github.com/CocoaPods/CocoaPods/pull/10950)

##### Bug Fixes

Expand Down
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ begin
exit 1
end
title 'Running Integration tests'
rm_rf 'tmp'
FileUtils.rm_rf 'tmp'
title 'Building all the fixtures'
sh('bundle exec bacon spec/integration.rb') {}
title 'Storing fixtures'
Expand All @@ -228,8 +228,8 @@ begin
name = source.match(%r{^tmp/(.+)/transformed$})[1]
destination = "spec/cocoapods-integration-specs/#{name}/after"
if File.exist?(destination)
rm_rf destination
mv source, destination
FileUtils.rm_rf destination
FileUtils.mv source, destination
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods/generator/info_plist_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def info
'CFBundleSignature' => '????',
'CFBundleVersion' => '${CURRENT_PROJECT_VERSION}',
'NSPrincipalClass' => '',
'CFBundleDevelopmentRegion' => 'en',
'CFBundleDevelopmentRegion' => '${PODS_DEVELOPMENT_LANGUAGE}',
}

info['CFBundleExecutable'] = '${EXECUTABLE_NAME}' if bundle_package_type != :bndl
Expand Down
5 changes: 5 additions & 0 deletions lib/cocoapods/target/build_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,11 @@ def initialize(target, non_library_spec = nil, configuration: nil)
target.pod_target_srcroot
end

# @return [String]
define_build_settings_method :pods_development_language, :build_setting => true do
'${DEVELOPMENT_LANGUAGE}'
end

#-------------------------------------------------------------------------#

# @!group Frameworks
Expand Down
2 changes: 1 addition & 1 deletion spec/cocoapods-integration-specs
8 changes: 4 additions & 4 deletions spec/unit/generator/info_plist_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module Pod
file = temporary_directory + 'Info.plist'
generator.save_as(file)
Xcodeproj::Plist.read_from_path(file).should == {
'CFBundleDevelopmentRegion' => 'en',
'CFBundleDevelopmentRegion' => '${PODS_DEVELOPMENT_LANGUAGE}',
'CFBundleExecutable' => '${EXECUTABLE_NAME}',
'CFBundleIdentifier' => '${PRODUCT_BUNDLE_IDENTIFIER}',
'CFBundleInfoDictionaryVersion' => '6.0',
Expand All @@ -38,7 +38,7 @@ module Pod
file = temporary_directory + 'Info.plist'
generator.save_as(file)
Xcodeproj::Plist.read_from_path(file).should == {
'CFBundleDevelopmentRegion' => 'en',
'CFBundleDevelopmentRegion' => '${PODS_DEVELOPMENT_LANGUAGE}',
'CFBundleExecutable' => '${EXECUTABLE_NAME}',
'CFBundleIdentifier' => '${PRODUCT_BUNDLE_IDENTIFIER}',
'CFBundleInfoDictionaryVersion' => '6.0',
Expand All @@ -56,7 +56,7 @@ module Pod
file = temporary_directory + 'Info.plist'
generator.save_as(file)
Xcodeproj::Plist.read_from_path(file).should == {
'CFBundleDevelopmentRegion' => 'en',
'CFBundleDevelopmentRegion' => '${PODS_DEVELOPMENT_LANGUAGE}',
'CFBundleExecutable' => '${EXECUTABLE_NAME}',
'CFBundleIdentifier' => '${PRODUCT_BUNDLE_IDENTIFIER}',
'CFBundleInfoDictionaryVersion' => '6.0',
Expand All @@ -74,7 +74,7 @@ module Pod
file = temporary_directory + 'Info.plist'
generator.save_as(file)
Xcodeproj::Plist.read_from_path(file).should == {
'CFBundleDevelopmentRegion' => 'en',
'CFBundleDevelopmentRegion' => '${PODS_DEVELOPMENT_LANGUAGE}',
'CFBundleExecutable' => '${EXECUTABLE_NAME}',
'CFBundleIdentifier' => '${PRODUCT_BUNDLE_IDENTIFIER}',
'CFBundleInfoDictionaryVersion' => '6.0',
Expand Down

0 comments on commit f120f9f

Please sign in to comment.