Skip to content

Commit

Permalink
Merge pull request #767 from CocoaPods/segiddins/xcode-12-beta-1-buil…
Browse files Browse the repository at this point in the history
…d-settings

Xcode 12.0 GM build settings
  • Loading branch information
amorde authored Oct 9, 2020
2 parents 651af88 + 0e96cb6 commit 08ed2bf
Show file tree
Hide file tree
Showing 27 changed files with 51 additions and 46 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
[lemonspike](https://github.com/LemonSpike)
[#785](https://github.com/CocoaPods/Xcodeproj/issues/785)

* Update default build settings for Xcode 12
[Samuel Giddins](https://github.com/segiddins), [Eric Amorde](https://github.com/amorde)
[#767](https://github.com/CocoaPods/Xcodeproj/pull/767)

##### Bug Fixes

* None.
Expand Down
18 changes: 9 additions & 9 deletions lib/xcodeproj/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ module Xcodeproj
module Constants
# @return [String] The last known iOS SDK (stable).
#
LAST_KNOWN_IOS_SDK = '12.2'
LAST_KNOWN_IOS_SDK = '14.0'

# @return [String] The last known OS X SDK (stable).
#
LAST_KNOWN_OSX_SDK = '10.14'
LAST_KNOWN_OSX_SDK = '10.15'

# @return [String] The last known tvOS SDK (stable).
#
LAST_KNOWN_TVOS_SDK = '12.2'
LAST_KNOWN_TVOS_SDK = '14.0'

# @return [String] The last known watchOS SDK (stable).
#
LAST_KNOWN_WATCHOS_SDK = '5.2'
LAST_KNOWN_WATCHOS_SDK = '7.0'

# @return [String] The last known archive version to Xcodeproj.
#
Expand Down Expand Up @@ -204,11 +204,9 @@ module Constants
}.freeze,
[:ios] => {
'SDKROOT' => 'iphoneos',
'CODE_SIGN_IDENTITY' => 'iPhone Developer',
}.freeze,
[:osx] => {
'SDKROOT' => 'macosx',
'CODE_SIGN_IDENTITY' => '-',
}.freeze,
[:tvos] => {
'SDKROOT' => 'appletvos',
Expand Down Expand Up @@ -257,7 +255,6 @@ module Constants
[:debug, :static_library, :swift] => {
}.freeze,
[:framework] => {
'CODE_SIGN_IDENTITY' => '',
'CURRENT_PROJECT_VERSION' => '1',
'DEFINES_MODULE' => 'YES',
'DYLIB_COMPATIBILITY_VERSION' => '1',
Expand All @@ -275,7 +272,6 @@ module Constants
}.freeze,
[:osx, :framework] => {
'COMBINE_HIDPI_IMAGES' => 'YES',
'FRAMEWORK_VERSION' => 'A',
'LD_RUNPATH_SEARCH_PATHS' => '$(inherited) @executable_path/../Frameworks @loader_path/Frameworks',
}.freeze,
[:watchos, :framework] => {
Expand Down Expand Up @@ -317,6 +313,7 @@ module Constants
}.freeze,
[:application] => {
'ASSETCATALOG_COMPILER_APPICON_NAME' => 'AppIcon',
'ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME' => 'AccentColor',
}.freeze,
[:ios, :application] => {
'LD_RUNPATH_SEARCH_PATHS' => '$(inherited) @executable_path/Frameworks',
Expand All @@ -332,10 +329,12 @@ module Constants
}.freeze,
[:tvos, :application] => {
'ASSETCATALOG_COMPILER_APPICON_NAME' => 'App Icon & Top Shelf Image',
'ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME' => 'LaunchImage',
'LD_RUNPATH_SEARCH_PATHS' => '$(inherited) @executable_path/Frameworks',
'TARGETED_DEVICE_FAMILY' => '3',
}.freeze,
[:tvos, :application, :swift] => {
'ENABLE_PREVIEWS' => 'YES',
}.freeze,
[:watchos, :application, :swift] => {
'ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES' => 'YES',
}.freeze,
Expand Down Expand Up @@ -381,6 +380,7 @@ module Constants
'CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF' => 'YES',
'CLANG_WARN_OBJC_LITERAL_CONVERSION' => 'YES',
'CLANG_WARN_OBJC_ROOT_CLASS' => 'YES_ERROR',
'CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER' => 'YES',
'CLANG_WARN_RANGE_LOOP_ANALYSIS' => 'YES',
'CLANG_WARN_STRICT_PROTOTYPES' => 'YES',
'CLANG_WARN_SUSPICIOUS_MOVE' => 'YES',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
CODE_SIGN_IDENTITY = -
COMBINE_HIDPI_IMAGES = YES
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Bundles
MACOSX_DEPLOYMENT_TARGET = ___RUNNINGMACOSVERSION___
MACOSX_DEPLOYMENT_TARGET = ___BESTMACOSVERSION___
PRODUCT_BUNDLE_IDENTIFIER = ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___
SDKROOT = macosx
SKIP_INSTALL = YES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
CODE_SIGN_IDENTITY = -
DYLIB_COMPATIBILITY_VERSION = 1
DYLIB_CURRENT_VERSION = 1
EXECUTABLE_PREFIX = lib
MACOSX_DEPLOYMENT_TARGET = ___RUNNINGMACOSVERSION___
MACOSX_DEPLOYMENT_TARGET = ___BESTMACOSVERSION___
SDKROOT = macosx
SKIP_INSTALL = YES
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
CODE_SIGN_IDENTITY =
COMBINE_HIDPI_IMAGES = YES
CURRENT_PROJECT_VERSION = 1
DEFINES_MODULE = YES
DYLIB_COMPATIBILITY_VERSION = 1
DYLIB_CURRENT_VERSION = 1
DYLIB_INSTALL_NAME_BASE = @rpath
FRAMEWORK_VERSION = A
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/Frameworks
MACOSX_DEPLOYMENT_TARGET = ___RUNNINGMACOSVERSION___
MACOSX_DEPLOYMENT_TARGET = ___BESTMACOSVERSION___
PRODUCT_BUNDLE_IDENTIFIER = ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___
PRODUCT_NAME = $(TARGET_NAME:c99extidentifier)
SDKROOT = macosx
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor
CODE_SIGN_ENTITLEMENTS = ___PACKAGENAME___/___PACKAGENAMEASIDENTIFIER___.entitlements
CODE_SIGN_IDENTITY = -
COMBINE_HIDPI_IMAGES = YES
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks
MACOSX_DEPLOYMENT_TARGET = ___RUNNINGMACOSVERSION___
MACOSX_DEPLOYMENT_TARGET = ___BESTMACOSVERSION___
PRODUCT_BUNDLE_IDENTIFIER = ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___
SDKROOT = macosx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CODE_SIGN_IDENTITY = -
EXECUTABLE_PREFIX = lib
MACOSX_DEPLOYMENT_TARGET = ___RUNNINGMACOSVERSION___
MACOSX_DEPLOYMENT_TARGET = ___BESTMACOSVERSION___
SDKROOT = macosx
SKIP_INSTALL = YES
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CODE_SIGN_IDENTITY =
CURRENT_PROJECT_VERSION = 1
DEFINES_MODULE = YES
DYLIB_COMPATIBILITY_VERSION = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
CODE_SIGN_IDENTITY = iPhone Developer
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
IPHONEOS_DEPLOYMENT_TARGET = latest_iphoneos
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CODE_SIGN_IDENTITY = iPhone Developer
IPHONEOS_DEPLOYMENT_TARGET = latest_iphoneos
OTHER_LDFLAGS = -ObjC
SDKROOT = iphoneos
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CODE_SIGN_IDENTITY =
CURRENT_PROJECT_VERSION = 1
DEFINES_MODULE = YES
DYLIB_COMPATIBILITY_VERSION = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ASSETCATALOG_COMPILER_APPICON_NAME = App Icon & Top Shelf Image
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
PRODUCT_BUNDLE_IDENTIFIER = ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
APPLICATION_EXTENSION_API_ONLY = YES
CODE_SIGN_IDENTITY =
CURRENT_PROJECT_VERSION = 1
DEFINES_MODULE = YES
DYLIB_COMPATIBILITY_VERSION = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor
IBSC_MODULE = ___PACKAGENAMEASIDENTIFIER____Extension
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
PRODUCT_BUNDLE_IDENTIFIER = ___ASSOCIATEDTARGET_bundleIdentifier___.watchkitapp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES
CLANG_WARN_STRICT_PROTOTYPES = YES
CLANG_WARN_SUSPICIOUS_MOVE = YES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
CODE_SIGN_IDENTITY =
COMBINE_HIDPI_IMAGES = YES
CURRENT_PROJECT_VERSION = 1
DEFINES_MODULE = YES
DYLIB_COMPATIBILITY_VERSION = 1
DYLIB_CURRENT_VERSION = 1
DYLIB_INSTALL_NAME_BASE = @rpath
FRAMEWORK_VERSION = A
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/Frameworks
MACOSX_DEPLOYMENT_TARGET = ___RUNNINGMACOSVERSION___
MACOSX_DEPLOYMENT_TARGET = ___BESTMACOSVERSION___
PRODUCT_BUNDLE_IDENTIFIER = ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___
PRODUCT_NAME = $(TARGET_NAME:c99extidentifier)
SDKROOT = macosx
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor
CODE_SIGN_ENTITLEMENTS = ___PACKAGENAME___/___PACKAGENAMEASIDENTIFIER___.entitlements
CODE_SIGN_IDENTITY = -
COMBINE_HIDPI_IMAGES = YES
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks
MACOSX_DEPLOYMENT_TARGET = ___RUNNINGMACOSVERSION___
MACOSX_DEPLOYMENT_TARGET = ___BESTMACOSVERSION___
PRODUCT_BUNDLE_IDENTIFIER = ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___
SDKROOT = macosx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CODE_SIGN_IDENTITY =
CURRENT_PROJECT_VERSION = 1
DEFINES_MODULE = YES
DYLIB_COMPATIBILITY_VERSION = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
CODE_SIGN_IDENTITY = iPhone Developer
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
IPHONEOS_DEPLOYMENT_TARGET = latest_iphoneos
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CODE_SIGN_IDENTITY =
CURRENT_PROJECT_VERSION = 1
DEFINES_MODULE = YES
DYLIB_COMPATIBILITY_VERSION = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ASSETCATALOG_COMPILER_APPICON_NAME = App Icon & Top Shelf Image
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor
ENABLE_PREVIEWS = YES
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
PRODUCT_BUNDLE_IDENTIFIER = ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___PACKAGENAMEASRFC1034IDENTIFIER___
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
APPLICATION_EXTENSION_API_ONLY = YES
CODE_SIGN_IDENTITY =
CURRENT_PROJECT_VERSION = 1
DEFINES_MODULE = YES
DYLIB_COMPATIBILITY_VERSION = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication
ENABLE_PREVIEWS = YES
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @executable_path/../../Frameworks
PRODUCT_BUNDLE_IDENTIFIER = ___ASSOCIATEDTARGET_bundleIdentifier___.watchkitapp.watchkitextension
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor
IBSC_MODULE = ___PACKAGENAMEASIDENTIFIER____Extension
INFOPLIST_FILE = ___PACKAGENAME___/Info.plist
PRODUCT_BUNDLE_IDENTIFIER = ___ASSOCIATEDTARGET_bundleIdentifier___.watchkitapp
Expand Down
24 changes: 17 additions & 7 deletions spec/fixtures/CommonBuildSettings/rebuild_from_xcode
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ puts "\r\033[KRead all templates"
targets = {
'Project' => { 'languageChoice' => 'Swift', :template_identifier => 'com.apple.dt.unit.base' },

'Objc_iOS_Native' => { 'languageChoice' => 'Objective-C', :template_identifier => 'com.apple.dt.unit.masterDetailApplication' },
'Swift_iOS_Native' => { 'languageChoice' => 'Swift', :template_identifier => 'com.apple.dt.unit.masterDetailApplication' },
'Objc_iOS_Framework' => { 'languageChoice' => 'Objective-C', :template_identifier => 'com.apple.dt.unit.cocoaTouchFramework' },
'Swift_iOS_Framework' => { 'languageChoice' => 'Swift', :template_identifier => 'com.apple.dt.unit.cocoaTouchFramework' },
'Objc_iOS_Native' => { 'languageChoice' => 'Objective-C', :template_identifier => 'com.apple.dt.unit.storyboardApplication' },
'Swift_iOS_Native' => { 'languageChoice' => 'Swift', :template_identifier => 'com.apple.dt.unit.storyboardApplication' },
'Objc_iOS_Framework' => { 'languageChoice' => 'Objective-C', :template_identifier => 'com.apple.dt.unit.iosFramework' },
'Swift_iOS_Framework' => { 'languageChoice' => 'Swift', :template_identifier => 'com.apple.dt.unit.iosFramework' },
'Objc_iOS_StaticLibrary' => { 'languageChoice' => 'Objective-C', :template_identifier => 'com.apple.dt.unit.cocoaTouchStaticLibrary' },

'Objc_OSX_Native' => { 'languageChoice' => 'Objective-C', :template_identifier => 'com.apple.dt.unit.cocoaApplication' },
'Swift_OSX_Native' => { 'languageChoice' => 'Swift', :template_identifier => 'com.apple.dt.unit.cocoaApplication' },
'Objc_OSX_Framework' => { 'languageChoice' => 'Objective-C', :template_identifier => 'com.apple.dt.unit.cocoaFramework' },
'Swift_OSX_Framework' => { 'languageChoice' => 'Swift', :template_identifier => 'com.apple.dt.unit.cocoaFramework' },
'Objc_OSX_Framework' => { 'languageChoice' => 'Objective-C', :template_identifier => 'com.apple.dt.unit.macosFramework' },
'Swift_OSX_Framework' => { 'languageChoice' => 'Swift', :template_identifier => 'com.apple.dt.unit.macosFramework' },
'Objc_OSX_StaticLibrary' => { 'languageChoice' => 'Objective-C', :template_identifier => 'com.apple.dt.unit.osxLibrary', 'libraryType' => 'Static' },
'Objc_OSX_DynamicLibrary' => { 'languageChoice' => 'Objective-C', :template_identifier => 'com.apple.dt.unit.osxLibrary', 'libraryType' => 'Dynamic' },
'OSX_Bundle' => { 'languageChoice' => nil, :template_identifier => 'com.apple.dt.unit.osxbundle' },
Expand Down Expand Up @@ -150,13 +150,16 @@ def extract_common_settings!(all_configs, project_configs)
end
end

any_missing = false

project = nil
targets.each do |name, options|
template_identifier = options.delete(:template_identifier)
print "\r\033[KCalculating defaults for #{template_identifier}"
configs = Hash[%w(Debug Release).map do |configuration|
unless template = Template.all_by_identifier[template_identifier]
warn "No template #{template_identifier} for #{name} could be found"
any_missing = true
next [configuration, {}]
end
settings = template.shared_settings(:configuration => configuration, :options => options)
Expand All @@ -174,4 +177,11 @@ targets.each do |name, options|

project = configs if name == 'Project'
end
puts "\r\033[KCalculated default build settings!"

if any_missing
puts "\r\033[K"
warn "Valid template identifiers are:#{Template.all_by_identifier.map { |i, t| "\n- #{i}" }.sort.join}"
exit 1
else
puts "\r\033[KCalculated default build settings!"
end
2 changes: 1 addition & 1 deletion spec/project/object/native_target_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ module ProjectSpecs
it 'adds a file reference for a system framework, in a dedicated subgroup of the Frameworks group' do
@target.add_system_framework('QuartzCore')
file = @project['Frameworks/iOS'].files.first
file.path.should == 'Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/QuartzCore.framework'
file.path.should == 'Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/System/Library/Frameworks/QuartzCore.framework'
file.source_tree.should == 'DEVELOPER_DIR'
end

Expand Down
4 changes: 2 additions & 2 deletions spec/project/project_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ module ProjectSpecs
describe '::common_build_settings' do
it 'returns the build settings for an application by default' do
settings = @helper.common_build_settings(:release, :ios, nil, nil)
settings['CODE_SIGN_IDENTITY'].should == 'iPhone Developer'
settings['ASSETCATALOG_COMPILER_APPICON_NAME'].should == 'AppIcon'
end

it 'returns the build settings for an application' do
settings = @helper.common_build_settings(:release, :ios, nil, Xcodeproj::Constants::PRODUCT_TYPE_UTI[:application])
settings['CODE_SIGN_IDENTITY'].should == 'iPhone Developer'
settings['ASSETCATALOG_COMPILER_APPICON_NAME'].should == 'AppIcon'
end

it 'returns the build settings for a bundle' do
Expand Down

0 comments on commit 08ed2bf

Please sign in to comment.