diff --git a/lib/synx.rb b/lib/synx.rb index 77c2bc9..8931932 100644 --- a/lib/synx.rb +++ b/lib/synx.rb @@ -3,7 +3,7 @@ require "synx/pbx_file_reference" require "synx/pbx_group" require "synx/abstract_object" -require "synx/pbx_native_target" +require "synx/abstract_target" require "synx/pbx_variant_group" require "synx/tabber" diff --git a/lib/synx/pbx_native_target.rb b/lib/synx/abstract_target.rb similarity index 88% rename from lib/synx/pbx_native_target.rb rename to lib/synx/abstract_target.rb index 416587a..ca2489b 100644 --- a/lib/synx/pbx_native_target.rb +++ b/lib/synx/abstract_target.rb @@ -3,7 +3,7 @@ module Xcodeproj class Project module Object - class PBXNativeTarget + class AbstractTarget def each_build_settings build_configurations.each { |bc| yield bc.build_settings } diff --git a/spec/dummy/dummy.xcodeproj/project.pbxproj b/spec/dummy/dummy.xcodeproj/project.pbxproj index b661ce4..43479ba 100644 --- a/spec/dummy/dummy.xcodeproj/project.pbxproj +++ b/spec/dummy/dummy.xcodeproj/project.pbxproj @@ -6,6 +6,19 @@ objectVersion = 46; objects = { +/* Begin PBXAggregateTarget section */ + 8CDA046A1937DDAA004435A1 /* Aggregate Target */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 8CDA046D1937DDAA004435A1 /* Build configuration list for PBXAggregateTarget "Aggregate Target" */; + buildPhases = ( + ); + dependencies = ( + ); + name = "Aggregate Target"; + productName = "Aggregate Target"; + }; +/* End PBXAggregateTarget section */ + /* Begin PBXBuildFile section */ 8C2DEB7F191D3F5C003A1F44 /* ManyFiles.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2DEB7E191D3F5C003A1F44 /* ManyFiles.m */; }; 8C2DEB82191D3F68003A1F44 /* Wow.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C2DEB81191D3F68003A1F44 /* Wow.m */; }; @@ -303,6 +316,7 @@ targets = ( 8C848C47190DB9B300E9727B /* dummy */, 8C848C57190DB9B300E9727B /* dummyTests */, + 8CDA046A1937DDAA004435A1 /* Aggregate Target */, ); }; /* End PBXProject section */ @@ -492,6 +506,20 @@ }; name = Release; }; + 8CDA046B1937DDAA004435A1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 8CDA046C1937DDAA004435A1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -522,6 +550,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 8CDA046D1937DDAA004435A1 /* Build configuration list for PBXAggregateTarget "Aggregate Target" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8CDA046B1937DDAA004435A1 /* Debug */, + 8CDA046C1937DDAA004435A1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; /* End XCConfigurationList section */ /* Begin XCVersionGroup section */ diff --git a/spec/dummy/dummy.xcodeproj/xcuserdata/marklarsen.xcuserdatad/xcschemes/xcschememanagement.plist b/spec/dummy/dummy.xcodeproj/xcuserdata/marklarsen.xcuserdatad/xcschemes/xcschememanagement.plist index 0a29c65..3928877 100644 --- a/spec/dummy/dummy.xcodeproj/xcuserdata/marklarsen.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/spec/dummy/dummy.xcodeproj/xcuserdata/marklarsen.xcuserdatad/xcschemes/xcschememanagement.plist @@ -22,6 +22,11 @@ primary + 8CDA046A1937DDAA004435A1 + + primary + + diff --git a/spec/synx/project_spec.rb b/spec/synx/project_spec.rb index 4417c83..e4a98aa 100644 --- a/spec/synx/project_spec.rb +++ b/spec/synx/project_spec.rb @@ -102,7 +102,7 @@ def expected_group_structure end # dummyTests target - DUMMY_SYNX_TEST_PROJECT.targets.last.each_build_settings do |bs| + DUMMY_SYNX_TEST_PROJECT.targets[1].each_build_settings do |bs| expect(bs["GCC_PREFIX_HEADER"]).to eq("dummyTests/Supporting Files/dummyTests-Prefix.pch") expect(bs["INFOPLIST_FILE"]).to eq("dummyTests/Supporting Files/dummyTests-Info.plist") end