From 5f0cace934a20304873d2e639864d6cbe120bd6a Mon Sep 17 00:00:00 2001 From: Dimitris Koutsogiorgas Date: Mon, 3 Jun 2019 23:34:09 -0700 Subject: [PATCH] Support for Xcode 11 new attributes. --- CHANGELOG.md | 4 +++- lib/xcodeproj/constants.rb | 7 ++++--- lib/xcodeproj/project/object.rb | 2 ++ lib/xcodeproj/project/object/build_file.rb | 8 ++++++++ lib/xcodeproj/project/object/native_target.rb | 10 +++++++--- lib/xcodeproj/project/object/root_object.rb | 4 ++++ .../swift_package_product_dependency.rb | 19 +++++++++++++++++++ .../object/swift_package_remote_reference.rb | 19 +++++++++++++++++++ 8 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 lib/xcodeproj/project/object/swift_package_product_dependency.rb create mode 100644 lib/xcodeproj/project/object/swift_package_remote_reference.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 852eb84c8..8211b3d6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,9 @@ ##### Enhancements -* None. +* Updated latest SDK versions for the release of Xcode 11.0. + [Dimitris Koutsogiorgas](https://github.com/dnkoutso) + [#687](https://github.com/CocoaPods/Xcodeproj/pull/687) ##### Bug Fixes diff --git a/lib/xcodeproj/constants.rb b/lib/xcodeproj/constants.rb index c300fda01..5f174434a 100644 --- a/lib/xcodeproj/constants.rb +++ b/lib/xcodeproj/constants.rb @@ -32,15 +32,15 @@ module Constants # @return [String] The last known object version to Xcodeproj. # - LAST_KNOWN_OBJECT_VERSION = 51 + LAST_KNOWN_OBJECT_VERSION = 52 # @return [String] The last known object version to Xcodeproj. # - LAST_UPGRADE_CHECK = '1020' + LAST_UPGRADE_CHECK = '1100' # @return [String] The last known object version to Xcodeproj. # - LAST_SWIFT_UPGRADE_CHECK = '1020' + LAST_SWIFT_UPGRADE_CHECK = '1100' # @return [String] The version of `.xcscheme` files supported by Xcodeproj # @@ -126,6 +126,7 @@ module Constants # @return [Hash] The compatibility version string for different object versions. # COMPATIBILITY_VERSION_BY_OBJECT_VERSION = { + 52 => 'Xcode 11.0', 51 => 'Xcode 10.0', 50 => 'Xcode 9.3', 48 => 'Xcode 8.0', diff --git a/lib/xcodeproj/project/object.rb b/lib/xcodeproj/project/object.rb index 777aaafe0..60ee526e6 100644 --- a/lib/xcodeproj/project/object.rb +++ b/lib/xcodeproj/project/object.rb @@ -518,6 +518,8 @@ def inspect end # Now load the concrete subclasses. +require 'xcodeproj/project/object/swift_package_remote_reference' +require 'xcodeproj/project/object/swift_package_product_dependency' require 'xcodeproj/project/object/build_configuration' require 'xcodeproj/project/object/build_file' require 'xcodeproj/project/object/build_phase' diff --git a/lib/xcodeproj/project/object/build_file.rb b/lib/xcodeproj/project/object/build_file.rb index f1e142c43..eadca3b35 100644 --- a/lib/xcodeproj/project/object/build_file.rb +++ b/lib/xcodeproj/project/object/build_file.rb @@ -31,6 +31,14 @@ class PBXBuildFile < AbstractObject PBXReferenceProxy, ] + # @return TODO + # + has_one :product_ref, XCSwiftPackageProductDependency + + # @return TODO + # + attribute :platform_filter, String + #---------------------------------------------------------------------# public diff --git a/lib/xcodeproj/project/object/native_target.rb b/lib/xcodeproj/project/object/native_target.rb index b1aafcb6c..cf2e9f45a 100644 --- a/lib/xcodeproj/project/object/native_target.rb +++ b/lib/xcodeproj/project/object/native_target.rb @@ -29,6 +29,10 @@ class AbstractTarget < AbstractObject # has_many :dependencies, PBXTargetDependency + # @return [ObjectList] TODO + # + has_many :packageProductDependencies, XCSwiftPackageProductDependency + public # @!group Helpers @@ -309,7 +313,7 @@ def new_shell_script_build_phase(name = nil) # Adds a file reference for one or more system framework to the project # if needed and adds them to the Frameworks build phases. # - # @param [Array, String] name + # @param [Array, String] names # The name or the list of the names of the framework. # # @note Xcode behaviour is following: if the target has the same SDK @@ -359,7 +363,7 @@ def add_system_framework(names) # Adds a file reference for one or more system dylib libraries to the project # if needed and adds them to the Frameworks build phases. # - # @param [Array, String] name + # @param [Array, String] names # The name or the list of the names of the libraries. # # @return [void] @@ -385,7 +389,7 @@ def add_system_library_extension(names, extension) # Adds a file reference for one or more system tbd libraries to the project # if needed and adds them to the Frameworks build phases. # - # @param [Array, String] name + # @param [Array, String] names # The name or the list of the names of the libraries. # # @return [void] diff --git a/lib/xcodeproj/project/object/root_object.rb b/lib/xcodeproj/project/object/root_object.rb index c17104a90..e19392c3d 100644 --- a/lib/xcodeproj/project/object/root_object.rb +++ b/lib/xcodeproj/project/object/root_object.rb @@ -62,6 +62,10 @@ class PBXProject < AbstractObject # attribute :project_root, String, '' + # @return TODO + # + has_many :package_references, XCRemoteSwiftPackageReference + # @return [Array] any reference to other projects. # has_many_references_by_keys :project_references, diff --git a/lib/xcodeproj/project/object/swift_package_product_dependency.rb b/lib/xcodeproj/project/object/swift_package_product_dependency.rb new file mode 100644 index 000000000..5d69b8a1f --- /dev/null +++ b/lib/xcodeproj/project/object/swift_package_product_dependency.rb @@ -0,0 +1,19 @@ +module Xcodeproj + class Project + module Object + # TODO + # + class XCSwiftPackageProductDependency < AbstractObject + # @!group Attributes + + # @return [XCRemoteSwiftPackageReference] TODO + # + has_one :package, XCRemoteSwiftPackageReference + + # @return [String] TODO + # + attribute :product_name, String + end + end + end +end diff --git a/lib/xcodeproj/project/object/swift_package_remote_reference.rb b/lib/xcodeproj/project/object/swift_package_remote_reference.rb new file mode 100644 index 000000000..14f09607b --- /dev/null +++ b/lib/xcodeproj/project/object/swift_package_remote_reference.rb @@ -0,0 +1,19 @@ +module Xcodeproj + class Project + module Object + # TODO + # + class XCRemoteSwiftPackageReference < AbstractObject + # @!group Attributes + + # @return [String] TODO + # + attribute :repositoryURL, String + + # @return [Hash] TODO + # + attribute :requirement, Hash + end + end + end +end