diff --git a/Fixtures/TestProject/spec.xcodeproj/project.pbxproj b/Fixtures/TestProject/spec.xcodeproj/project.pbxproj index c9d129b7..dc729383 100644 --- a/Fixtures/TestProject/spec.xcodeproj/project.pbxproj +++ b/Fixtures/TestProject/spec.xcodeproj/project.pbxproj @@ -1,22 +1,20 @@ // !$*UTF8*$! { archiveVersion = 1; - classes = ( - ); + classes = { + }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ - OBJECT_10 = {isa = PBXBuildFile; fileRef = OBJECT_9 /* TestProject.app */; }; - OBJECT_15 /* FrameworkFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJECT_11 /* FrameworkFile.swift */; settings = {}; }; - OBJECT_16 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = OBJECT_12 /* Info.plist */; settings = {}; }; + OBJECT_15 /* FrameworkFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJECT_11 /* FrameworkFile.swift */; }; + OBJECT_16 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = OBJECT_12 /* Info.plist */; }; OBJECT_17 /* MyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = OBJECT_13 /* MyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; - OBJECT_31 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJECT_25 /* AppDelegate.swift */; settings = {}; }; - OBJECT_32 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = OBJECT_26 /* Assets.xcassets */; settings = {}; }; - OBJECT_33 /* Base.lproj in Resources */ = {isa = PBXBuildFile; fileRef = OBJECT_27 /* Base.lproj */; settings = {}; }; - OBJECT_34 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = OBJECT_28 /* Info.plist */; settings = {}; }; - OBJECT_35 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJECT_29 /* ViewController.swift */; settings = {}; }; - OBJECT_7 /* MyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJECT_6 /* MyFramework.framework */; }; + OBJECT_31 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJECT_25 /* AppDelegate.swift */; }; + OBJECT_32 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = OBJECT_26 /* Assets.xcassets */; }; + OBJECT_33 /* Base.lproj in Resources */ = {isa = PBXBuildFile; fileRef = OBJECT_27 /* Base.lproj */; }; + OBJECT_34 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = OBJECT_28 /* Info.plist */; }; + OBJECT_35 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJECT_29 /* ViewController.swift */; }; OBJECT_7 /* MyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJECT_6 /* MyFramework.framework */; }; /* End PBXBuildFile section */ @@ -31,16 +29,16 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - OBJECT_11 /* FrameworkFile.swift */ = {isa = PBXFileReference; path = FrameworkFile.swift; sourceTree = ""; }; - OBJECT_12 /* Info.plist */ = {isa = PBXFileReference; path = Info.plist; sourceTree = ""; }; - OBJECT_13 /* MyFramework.h */ = {isa = PBXFileReference; path = MyFramework.h; sourceTree = ""; }; - OBJECT_25 /* AppDelegate.swift */ = {isa = PBXFileReference; path = AppDelegate.swift; sourceTree = ""; }; - OBJECT_26 /* Assets.xcassets */ = {isa = PBXFileReference; path = Assets.xcassets; sourceTree = ""; }; - OBJECT_27 /* Base.lproj */ = {isa = PBXFileReference; path = Base.lproj; sourceTree = ""; }; - OBJECT_28 /* Info.plist */ = {isa = PBXFileReference; path = Info.plist; sourceTree = ""; }; - OBJECT_29 /* ViewController.swift */ = {isa = PBXFileReference; path = ViewController.swift; sourceTree = ""; }; - OBJECT_6 /* MyFramework.framework */ = {isa = PBXFileReference; explicitFileType = framework; includeInIndex = 0; path = MyFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - OBJECT_9 /* TestProject.app */ = {isa = PBXFileReference; explicitFileType = app; includeInIndex = 0; path = TestProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; + OBJECT_11 /* FrameworkFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrameworkFile.swift; sourceTree = ""; }; + OBJECT_12 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + OBJECT_13 /* MyFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFramework.h; sourceTree = ""; }; + OBJECT_25 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + OBJECT_26 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + OBJECT_27 /* Base.lproj */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Base.lproj; sourceTree = ""; }; + OBJECT_28 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + OBJECT_29 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + OBJECT_6 /* MyFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MyFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + OBJECT_9 /* TestProject.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = TestProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -55,7 +53,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - OBJECT_7, + OBJECT_7 /* MyFramework.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -69,7 +67,6 @@ OBJECT_11 /* FrameworkFile.swift */, OBJECT_12 /* Info.plist */, ); - name = MyFramework; path = MyFramework; sourceTree = ""; }; @@ -82,7 +79,6 @@ OBJECT_29 /* ViewController.swift */, OBJECT_27 /* Base.lproj */, ); - name = TestProject; path = TestProject; sourceTree = ""; }; @@ -107,15 +103,15 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - OBJECT_23 /* Frameworks */ = { + OBJECT_23 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - OBJECT_17, + OBJECT_17 /* MyFramework.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - OBJECT_43 /* Frameworks */ = { + OBJECT_43 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( @@ -139,7 +135,8 @@ dependencies = ( ); name = MyFramework; - productReference = OBJECT_6; + productName = MyFramework; + productReference = OBJECT_6 /* MyFramework.framework */; productType = "com.apple.product-type.framework"; }; OBJECT_8 /* TestProject */ = { @@ -157,7 +154,8 @@ OBJECT_40 /* PBXTargetDependency */, ); name = TestProject; - productReference = OBJECT_9; + productName = TestProject; + productReference = OBJECT_9 /* TestProject.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -167,11 +165,17 @@ isa = PBXProject; attributes = { }; - buildConfigurationList = OBJECT_4 /* Build configuration list for PBXProject */; + buildConfigurationList = OBJECT_4 /* Build configuration list for PBXProject "spec" */; compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; knownRegions = ( + en, + Base, ); mainGroup = OBJECT_46; + projectDirPath = ""; + projectRoot = ""; targets = ( OBJECT_5 /* MyFramework */, OBJECT_8 /* TestProject */, @@ -184,7 +188,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - OBJECT_16, + OBJECT_16 /* Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -192,9 +196,9 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - OBJECT_33, - OBJECT_34, - OBJECT_32, + OBJECT_33 /* Base.lproj in Resources */, + OBJECT_34 /* Info.plist in Resources */, + OBJECT_32 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -229,10 +233,9 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - OBJECT_18 /* debug */ = { + OBJECT_18 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -252,6 +255,7 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -275,12 +279,11 @@ TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; }; - name = debug; + name = Release; }; - OBJECT_19 /* release */ = { + OBJECT_19 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -300,6 +303,7 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; @@ -323,9 +327,22 @@ TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; }; - name = release; + name = Debug; }; - OBJECT_2 /* debug */ = { + OBJECT_2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_WARN_SUSPICIOUS_MOVE = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_OPTIMIZATION_LEVEL = s; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + OBJECT_3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -343,25 +360,11 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; - name = debug; + name = Debug; }; - OBJECT_3 /* release */ = { + OBJECT_36 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_WARN_SUSPICIOUS_MOVE = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - GCC_OPTIMIZATION_LEVEL = s; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VALIDATE_PRODUCT = YES; - }; - name = release; - }; - OBJECT_36 /* debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -382,6 +385,7 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -401,12 +405,11 @@ SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; }; - name = debug; + name = Release; }; - OBJECT_37 /* release */ = { + OBJECT_37 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -427,6 +430,7 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -446,7 +450,7 @@ SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; }; - name = release; + name = Debug; }; /* End XCBuildConfiguration section */ @@ -454,8 +458,8 @@ OBJECT_20 /* Build configuration list for PBXNativeTarget "MyFramework" */ = { isa = XCConfigurationList; buildConfigurations = ( - OBJECT_19 /* release */, - OBJECT_18 /* debug */, + OBJECT_19 /* Debug */, + OBJECT_18 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = ""; @@ -463,20 +467,20 @@ OBJECT_38 /* Build configuration list for PBXNativeTarget "TestProject" */ = { isa = XCConfigurationList; buildConfigurations = ( - OBJECT_36 /* debug */, - OBJECT_37 /* release */, + OBJECT_36 /* Release */, + OBJECT_37 /* Debug */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = ""; }; - OBJECT_4 /* Build configuration list for PBXProject */ = { + OBJECT_4 /* Build configuration list for PBXProject "spec" */ = { isa = XCConfigurationList; buildConfigurations = ( - OBJECT_3 /* release */, - OBJECT_2 /* debug */, + OBJECT_3 /* Debug */, + OBJECT_2 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = debug; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Fixtures/TestProject/spec.yml b/Fixtures/TestProject/spec.yml index d2f7adc7..d1b05106 100644 --- a/Fixtures/TestProject/spec.yml +++ b/Fixtures/TestProject/spec.yml @@ -2,12 +2,12 @@ settingGroups: testGroup: TEST_SETTING: test value configs: - debug: + Debug: type: debug settingGroups: - testGroup buildSettings: - release: + Release: type: release targets: TestProject: diff --git a/Sources/XcodeGenKit/PBXProjGenerator.swift b/Sources/XcodeGenKit/PBXProjGenerator.swift index 904eef3f..3425820e 100644 --- a/Sources/XcodeGenKit/PBXProjGenerator.swift +++ b/Sources/XcodeGenKit/PBXProjGenerator.swift @@ -78,7 +78,8 @@ public class PBXProjGenerator { let mainGroup = PBXGroup(reference: id(), children: topLevelGroups.referenceSet, sourceTree: .group) objects.append(.pbxGroup(mainGroup)) - let pbxProjectRoot = PBXProject(reference: projectReference, buildConfigurationList: buildConfigList.reference, compatibilityVersion: "Xcode 3.2", mainGroup: mainGroup.reference, targets: Array(targetNativeReferences.values)) + let knownRegions: [String] = ["en", "Base"] + let pbxProjectRoot = PBXProject(reference: projectReference, buildConfigurationList: buildConfigList.reference, compatibilityVersion: "Xcode 3.2", mainGroup: mainGroup.reference, developmentRegion: "English", knownRegions: knownRegions, targets: Array(targetNativeReferences.values)) objects.append(.pbxProject(pbxProjectRoot)) return PBXProj(archiveVersion: 1, objectVersion: 46, rootObject: projectReference, objects: objects)