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
end
end
def self.has_one(singular_attr_name)
uuid_name = "#{singular_attr_name}Reference"
attribute(singular_attr_name, uuid_name)
def self.has_one(singular_attr_name, options = {})
uuid_name = options[:uuid] || "#{singular_attr_name}Reference"
attribute(options[:uuid] || singular_attr_name, uuid_name)
define_method(singular_attr_name) do
uuid = send(uuid_name)
@project.objects[uuid]
......@@ -189,10 +189,11 @@ module Pod
end
class PBXNativeTarget < PBXObject
attributes :productName, :productReference, :productType, :buildRules, :dependencies
attributes :productName, :productType, :buildRules, :dependencies
has_many :buildPhases, :class => PBXBuildPhase
has_one :buildConfigurationList
has_one :product, :uuid => :productReference
def initialize(project, uuid, attributes)
super
......
......@@ -143,7 +143,8 @@ describe "Pod::Xcode::Project" do
it "returns the product" do
product = @target.product
product.uuid.should == @target.productReference
p product.attributes # TODO continue from here!!
#product.uuid.should == @target.productReference
end
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