Skip to content

Commit

Permalink
[PBXContainerItemProxy] Make also container_portal a weak reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiopelosin committed Oct 15, 2012
1 parent ae897f1 commit 0ec8329
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
14 changes: 10 additions & 4 deletions lib/xcodeproj/project/object/container_item_proxy.rb
Expand Up @@ -8,24 +8,30 @@ 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.
#
# - {PBXNativeTarget} is `1`.
#
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.
Expand Down
2 changes: 1 addition & 1 deletion spec/project/object/configuration_list_spec.rb
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/project/object/container_item_proxy_spec.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/project/object/target_dependency_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 0ec8329

Please sign in to comment.