mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Merge pull request #46 from yonaskolb/application_platform_templates
Product + Platform setting presets
This commit is contained in:
@@ -365,7 +365,6 @@
|
||||
XCBC19846901 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
@@ -453,7 +452,6 @@
|
||||
XCBC60448901 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = TestProjectTests/Info.plist;
|
||||
@@ -530,7 +528,6 @@
|
||||
XCBC89077001 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = TestProjectTests/Info.plist;
|
||||
@@ -548,7 +545,6 @@
|
||||
XCBC89204001 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
|
||||
@@ -3,4 +3,3 @@ SDKROOT: iphoneos
|
||||
IPHONEOS_DEPLOYMENT_TARGET: 10.0
|
||||
TARGETED_DEVICE_FAMILY: '1,2'
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon
|
||||
CODE_SIGN_IDENTITY[sdk=iphoneos*]: iPhone Developer
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
CODE_SIGN_IDENTITY[sdk=iphoneos*]: iPhone Developer
|
||||
@@ -34,6 +34,7 @@ extension ProjectSpec {
|
||||
|
||||
buildSettings += SettingsPresetFile.platform(target.platform).getBuildSettings()
|
||||
buildSettings += SettingsPresetFile.product(target.type).getBuildSettings()
|
||||
buildSettings += SettingsPresetFile.productPlatform(target.type, target.platform).getBuildSettings()
|
||||
buildSettings += getBuildSettings(settings: target.settings, config: config)
|
||||
|
||||
return buildSettings
|
||||
@@ -76,7 +77,7 @@ extension SettingsPresetFile {
|
||||
switch self {
|
||||
case .base, .config, .platform:
|
||||
print("No \"\(name)\" settings found at \(settingsPath)")
|
||||
case .product:
|
||||
case .product, .productPlatform:
|
||||
break
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -14,6 +14,7 @@ public enum SettingsPresetFile {
|
||||
case config(ConfigType)
|
||||
case platform(Platform)
|
||||
case product(PBXProductType)
|
||||
case productPlatform(PBXProductType,Platform)
|
||||
case base
|
||||
|
||||
var path: String {
|
||||
@@ -21,6 +22,7 @@ public enum SettingsPresetFile {
|
||||
case let .config(config): return "Configs/\(config.rawValue)"
|
||||
case let .platform(platform): return "Platforms/\(platform.rawValue)"
|
||||
case let .product(product): return "Products/\(product.name)"
|
||||
case let .productPlatform(product, platform): return "Product_Platform/\(product.name)_\(platform.rawValue)"
|
||||
case .base: return "base"
|
||||
}
|
||||
}
|
||||
@@ -30,6 +32,7 @@ public enum SettingsPresetFile {
|
||||
case let .config(config): return "\(config.rawValue) config"
|
||||
case let .platform(platform): return platform.rawValue
|
||||
case let .product(product): return product.name
|
||||
case let .productPlatform(product, platform): return "\(platform) \(product)"
|
||||
case .base: return "base"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,8 +66,9 @@ func projectGeneratorTests() {
|
||||
try expect(debugProjectSettings.equals(buildSettings)).beTrue()
|
||||
|
||||
var expectedTargetDebugSettings = BuildSettings()
|
||||
expectedTargetDebugSettings += SettingsPresetFile.product(.application).getBuildSettings()
|
||||
expectedTargetDebugSettings += SettingsPresetFile.platform(.iOS).getBuildSettings()
|
||||
expectedTargetDebugSettings += SettingsPresetFile.product(.application).getBuildSettings()
|
||||
expectedTargetDebugSettings += SettingsPresetFile.productPlatform(.application,.iOS).getBuildSettings()
|
||||
expectedTargetDebugSettings += ["SETTING 2": "value 2", "SETTING 3": "value 3", "SETTING": "value"]
|
||||
|
||||
try expect(targetDebugSettings.equals(expectedTargetDebugSettings)).beTrue()
|
||||
|
||||
Reference in New Issue
Block a user