From 0ec832952a3321c932150570769e2095e13db09c Mon Sep 17 00:00:00 2001 From: Fabio Pelosin Date: Tue, 16 Oct 2012 00:32:02 +0200 Subject: [PATCH] [PBXContainerItemProxy] Make also container_portal a weak reference. --- .../project/object/container_item_proxy.rb | 14 ++++++++++---- spec/project/object/configuration_list_spec.rb | 2 +- spec/project/object/container_item_proxy_spec.rb | 4 ++-- spec/project/object/target_dependency_spec.rb | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/xcodeproj/project/object/container_item_proxy.rb b/lib/xcodeproj/project/object/container_item_proxy.rb index e394ef9ca..1afca40b2 100644 --- a/lib/xcodeproj/project/object/container_item_proxy.rb +++ b/lib/xcodeproj/project/object/container_item_proxy.rb @@ -8,16 +8,22 @@ module Object # This class is referenced by {PBXTargetDependency}; for information # about it usage see the specs of that class. # + # @note This class references the other objects by uuid instead of + # creating proper relationships because the other objects might be + # part of another project. This implies that the references to + # other objects should not increase the retain coutn of the + # targets. + # # @todo: this class needs some work to support targets accross workspaces, # as the container portal might not be initialized leading # xcodproj to raise because ti can't find the UUID. # class PBXContainerItemProxy < AbstractObject - # @return [PBXProject] apparently the root object of the project - # containing the represented object. + # @return [String] apparently the UUID of the root object + # {PBXProject} of the project containing the represented object. # - has_one :container_portal, PBXProject + attribute :container_portal, String # @return [String] the type of the proxy. # @@ -25,7 +31,7 @@ class PBXContainerItemProxy < AbstractObject # attribute :proxy_type, String - # @return [AbstractObject] apparently the UUID of the represented + # @return [String] apparently the UUID of the represented # object. # # @note If the object is in another project this will return nil. diff --git a/spec/project/object/configuration_list_spec.rb b/spec/project/object/configuration_list_spec.rb index 296fa8305..280b6ad8c 100644 --- a/spec/project/object/configuration_list_spec.rb +++ b/spec/project/object/configuration_list_spec.rb @@ -7,7 +7,7 @@ module ProjectSpecs @list = @project.new(XCConfigurationList) end - it "by the default the default configutation is not visible" do + it "by the default the default configuration is not visible" do @list.default_configuration_is_visible.should == '0' end diff --git a/spec/project/object/container_item_proxy_spec.rb b/spec/project/object/container_item_proxy_spec.rb index 0f61f2691..f0b115a86 100644 --- a/spec/project/object/container_item_proxy_spec.rb +++ b/spec/project/object/container_item_proxy_spec.rb @@ -8,8 +8,8 @@ module ProjectSpecs end it "returns the container portal" do - @proxy.container_portal = @project.root_object - @proxy.container_portal.should == @project.root_object + @proxy.container_portal = @project.root_object.uuid + @proxy.container_portal.should == @project.root_object.uuid end it "returns the type of the proxy" do diff --git a/spec/project/object/target_dependency_spec.rb b/spec/project/object/target_dependency_spec.rb index 6ccd72eb4..ac24ce2b3 100644 --- a/spec/project/object/target_dependency_spec.rb +++ b/spec/project/object/target_dependency_spec.rb @@ -16,7 +16,7 @@ module ProjectSpecs target = @project.new_target(:static, "Pods", :ios) proxy = @project.new(PBXContainerItemProxy) - proxy.container_portal = @project.root_object + proxy.container_portal = @project.root_object.uuid proxy.remote_info = "Pods" proxy.proxy_type = "1" proxy.remote_global_id_string = target.uuid