Commit 4b20d585 authored by Eloy Duran's avatar Eloy Duran

Stash work on product association of a target.

parent 1905f1b3
...@@ -30,9 +30,9 @@ module Pod ...@@ -30,9 +30,9 @@ module Pod
end end
end end
def self.has_one(singular_attr_name) def self.has_one(singular_attr_name, options = {})
uuid_name = "#{singular_attr_name}Reference" uuid_name = options[:uuid] || "#{singular_attr_name}Reference"
attribute(singular_attr_name, uuid_name) attribute(options[:uuid] || singular_attr_name, uuid_name)
define_method(singular_attr_name) do define_method(singular_attr_name) do
uuid = send(uuid_name) uuid = send(uuid_name)
@project.objects[uuid] @project.objects[uuid]
...@@ -189,10 +189,11 @@ module Pod ...@@ -189,10 +189,11 @@ module Pod
end end
class PBXNativeTarget < PBXObject class PBXNativeTarget < PBXObject
attributes :productName, :productReference, :productType, :buildRules, :dependencies attributes :productName, :productType, :buildRules, :dependencies
has_many :buildPhases, :class => PBXBuildPhase has_many :buildPhases, :class => PBXBuildPhase
has_one :buildConfigurationList has_one :buildConfigurationList
has_one :product, :uuid => :productReference
def initialize(project, uuid, attributes) def initialize(project, uuid, attributes)
super super
......
...@@ -143,7 +143,8 @@ describe "Pod::Xcode::Project" do ...@@ -143,7 +143,8 @@ describe "Pod::Xcode::Project" do
it "returns the product" do it "returns the product" do
product = @target.product product = @target.product
product.uuid.should == @target.productReference p product.attributes # TODO continue from here!!
#product.uuid.should == @target.productReference
end end
it "returns that product type is a static library" do it "returns that product type is a static library" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment