├── .gitignore ├── .gitmodules ├── Frameworks └── YAML.framework │ ├── Headers │ ├── Resources │ ├── Versions │ ├── A │ │ ├── Headers │ │ │ └── YAMLSerialization.h │ │ ├── Resources │ │ │ ├── English.lproj │ │ │ │ └── InfoPlist.strings │ │ │ └── Info.plist │ │ └── YAML │ └── Current │ └── YAML ├── LICENSE ├── Makefile ├── README.md ├── Sample ├── Sample.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── Sample │ ├── Config.h │ ├── config.yaml │ └── main.m ├── xcconf.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── xcconf ├── Sources │ ├── CodeGen │ │ ├── XCCConfigurationCodeGenerator.h │ │ ├── XCCConfigurationCodeGenerator.m │ │ ├── XCCParametersCodeGenerator.h │ │ ├── XCCParametersCodeGenerator.m │ │ ├── XCCParametersCodeGeneratorProtocol.h │ │ ├── XCCSecureParametersCodeGenerator.h │ │ ├── XCCSecureParametersCodeGenerator.m │ │ ├── XCCSecureXORParametersCodeGenerator.h │ │ └── XCCSecureXORParametersCodeGenerator.m │ ├── Driver │ │ ├── XCCDiagnosticsEngine.h │ │ ├── XCCDiagnosticsEngine.m │ │ ├── XCCDriver.h │ │ ├── XCCDriver.m │ │ ├── XCCDriverOptions.h │ │ ├── XCCDriverOptions.m │ │ ├── XCCDriverOptionsBuilder.h │ │ ├── XCCDriverOptionsBuilder.m │ │ └── XCCDriverOptionsBuilder_Internal.h │ ├── Models │ │ ├── XCCEnvironment.h │ │ ├── XCCEnvironment.m │ │ ├── XCCYAMLConfiguration.h │ │ └── XCCYAMLConfiguration.m │ └── Parser │ │ ├── XCCConfigurationParser.h │ │ └── XCCConfigurationParser.m └── main.m └── xcconf_tests ├── Fixtures └── Valid.yaml ├── Specs ├── CodeGen │ ├── XCCConfigurationCodeGeneratorSpec.mm │ ├── XCCParameterCodeGeneratorSpec.mm │ ├── XCCSecureParametersCodeGeneratorSpec.mm │ └── XCCSecureXORParametersCodeGeneratorSpec.mm ├── Driver │ └── XCCDriverOptionsBuilderSpec.mm ├── Models │ ├── XCCEnvironmentSpec.mm │ └── XCCYAMLConfigurationSpec.mm └── Parser │ └── XCCConfigurationParserSpec.mm └── SupportingFiles ├── Rakefile ├── main.m └── xcconf_tests-Prefix.pch /.gitignore: -------------------------------------------------------------------------------- 1 | xcconf.xcodeproj/xcuserdata 2 | xcconf.xcodeproj/project.xcworkspace/xcuserdata 3 | build 4 | Sample/Sample.xcodeproj/xcuserdata 5 | Sample/Sample.xcodeproj/project.xcworkspace/xcuserdata 6 | xcconf.xcodeproj/project.xcworkspace/xcshareddata 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "xcconf_tests/Vendor/Cedar"] 2 | path = xcconf_tests/Vendor/Cedar 3 | url=https://github.com/pivotal/cedar.git 4 | -------------------------------------------------------------------------------- /Frameworks/YAML.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Frameworks/YAML.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Frameworks/YAML.framework/Versions/A/Headers/YAMLSerialization.h: -------------------------------------------------------------------------------- 1 | // 2 | // YAMLSerialization.h 3 | // YAML Serialization support by Mirek Rusin based on C library LibYAML by Kirill Simonov 4 | // Released under MIT License 5 | // 6 | // Copyright 2010 Mirek Rusin 7 | // Copyright 2010 Stanislav Yudin 8 | // 9 | 10 | #import 11 | 12 | // Mimics NSPropertyListMutabilityOptions 13 | typedef enum { 14 | kYAMLReadOptionImmutable = 0x0000000000000001, 15 | kYAMLReadOptionMutableContainers = 0x0000000000000010, 16 | kYAMLReadOptionMutableContainersAndLeaves = 0x0000000000000110, 17 | kYAMLReadOptionStringScalars = 0x0000000000001000 18 | } YAMLReadOptions; 19 | 20 | typedef enum { 21 | kYAMLErrorNoErrors, 22 | kYAMLErrorCodeParserInitializationFailed, 23 | kYAMLErrorCodeParseError, 24 | kYAMLErrorCodeEmitterError, 25 | kYAMLErrorInvalidOptions, 26 | kYAMLErrorCodeOutOfMemory, 27 | kYAMLErrorInvalidYamlObject, 28 | } YAMLErrorCode; 29 | 30 | typedef enum { 31 | kYAMLWriteOptionSingleDocument = 0x0000000000000001, 32 | kYAMLWriteOptionMultipleDocuments = 0x0000000000000010, 33 | } YAMLWriteOptions; 34 | 35 | extern NSString *const YAMLErrorDomain; 36 | 37 | @interface YAMLSerialization : NSObject 38 | 39 | #pragma mark YAML reading 40 | 41 | // Returns all document objects from parsed YAML stream. 42 | + (NSMutableArray *) objectsWithYAMLStream: (NSInputStream *) stream 43 | options: (YAMLReadOptions) opt 44 | error: (NSError **) error; 45 | 46 | // Returns all document objects from parsed YAML data. 47 | + (NSMutableArray *) objectsWithYAMLData: (NSData *) data 48 | options: (YAMLReadOptions) opt 49 | error: (NSError **) error; 50 | 51 | // Returns all document objects from parsed YAML string. 52 | + (NSMutableArray *) objectsWithYAMLString: (NSString *) string 53 | options: (YAMLReadOptions) opt 54 | error: (NSError **) error; 55 | 56 | // Returns first object from parsed YAML stream. 57 | + (id) objectWithYAMLStream: (NSInputStream *) stream 58 | options: (YAMLReadOptions) opt 59 | error: (NSError **) error; 60 | 61 | // Returns first object from parsed YAML data. 62 | + (id) objectWithYAMLData: (NSData *) data 63 | options: (YAMLReadOptions) opt 64 | error: (NSError **) error; 65 | 66 | // Returns first object from parsed YAML string. 67 | + (id) objectWithYAMLString: (NSString *) string 68 | options: (YAMLReadOptions) opt 69 | error: (NSError **) error; 70 | 71 | #pragma mark Writing YAML 72 | 73 | // Returns YES on success, NO otherwise. 74 | + (BOOL) writeObject: (id) object 75 | toYAMLStream: (NSOutputStream *) stream 76 | options: (YAMLWriteOptions) opt 77 | error: (NSError **) error; 78 | 79 | // Caller is responsible for releasing returned object. 80 | + (NSData *) createYAMLDataWithObject: (id) object 81 | options: (YAMLWriteOptions) opt 82 | error: (NSError **) error NS_RETURNS_RETAINED; 83 | 84 | // Returns autoreleased object. 85 | + (NSData *) YAMLDataWithObject: (id) object 86 | options: (YAMLWriteOptions) opt 87 | error: (NSError **) error; 88 | 89 | // Caller is responsible for releasing returned object. 90 | + (NSString *) createYAMLStringWithObject: (id) object 91 | options: (YAMLWriteOptions) opt 92 | error: (NSError **) error NS_RETURNS_RETAINED; 93 | 94 | // Returns autoreleased object. 95 | + (NSString *) YAMLStringWithObject: (id) object 96 | options: (YAMLWriteOptions) opt 97 | error: (NSError **) error; 98 | 99 | #pragma mark Deprecated 100 | 101 | // Deprecated, use objectsWithYAMLStream:options:error or objectWithYAMLStream:options:error instead. 102 | + (NSMutableArray *) YAMLWithStream: (NSInputStream *) stream options: (YAMLReadOptions) opt error: (NSError **) error __attribute__((deprecated)); 103 | 104 | // Deprecated, use objectsWithYAMLData:options:error or objectWithYAMLData:options:error instead. 105 | + (NSMutableArray *) YAMLWithData: (NSData *) data options: (YAMLReadOptions) opt error: (NSError **) error __attribute__((deprecated)); 106 | 107 | // Deprecated, use YAMLDataWithObject:options:error or createYAMLDataWithObject:options:error instead. 108 | + (NSData *) dataFromYAML: (id) object options: (YAMLWriteOptions) opt error: (NSError **) error __attribute__((deprecated)); 109 | 110 | // Deprecated, use writeYAMLObject:toStream:options:error instead. 111 | + (BOOL) writeYAML: (id) object toStream: (NSOutputStream *) stream options: (YAMLWriteOptions) opt error: (NSError **) error __attribute__((deprecated)); 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /Frameworks/YAML.framework/Versions/A/Resources/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexDenisov/xcconf/fd9da367e479661015200d52eb5ca0dc1605740c/Frameworks/YAML.framework/Versions/A/Resources/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Frameworks/YAML.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 14C109 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | YAML 11 | CFBundleIdentifier 12 | com.yourcompany.YAML 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | YAML 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 6A2008a 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 14A382 33 | DTSDKName 34 | macosx10.10 35 | DTXcode 36 | 0611 37 | DTXcodeBuild 38 | 6A2008a 39 | 40 | 41 | -------------------------------------------------------------------------------- /Frameworks/YAML.framework/Versions/A/YAML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexDenisov/xcconf/fd9da367e479661015200d52eb5ca0dc1605740c/Frameworks/YAML.framework/Versions/A/YAML -------------------------------------------------------------------------------- /Frameworks/YAML.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Frameworks/YAML.framework/YAML: -------------------------------------------------------------------------------- 1 | Versions/Current/YAML -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Alex Denisov 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PREFIX?=/usr/local 2 | BIN_DIR=${PREFIX}/bin 3 | 4 | all: build 5 | 6 | install: 7 | mkdir -p ${BIN_DIR} 8 | cp ./build/Release/xcconf ${BIN_DIR}/xcconf 9 | 10 | .PHONY: build 11 | build: 12 | xcodebuild -target xcconf -configuration Release 13 | 14 | clean: 15 | rm -rf build 16 | 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### xcconf 2 | 3 | Generates a compile-time, NSString only, app configuration from a YAML-file 4 | 5 | More details can be found [here](http://lowlevelbits.org/yaml-based-configuration-for-objc-projects/) 6 | 7 | #### Installation 8 | 9 | **Homebrew** 10 | 11 | ```bash 12 | brew install alexdenisov/xcconf/xcconf 13 | ``` 14 | 15 | **Manually** 16 | 17 | Just clone project and run `make install`. It will build the project and put executable into `/usr/local/bin` 18 | 19 | ```bash 20 | git clone git@github.com:AlexDenisov/xcconf.git 21 | cd xcconf 22 | make && make install 23 | ``` 24 | 25 | #### Try it out 26 | 27 | Install `xcconf`, open and run `Sample/Sample.xcodeproj` 28 | 29 | Take a look at this article for more details: http://alexdenisov.github.io/blog/yaml-based-configuration-for-objc-projects 30 | 31 | #### License 32 | 33 | Distributed under MIT license, see LICENSE file for details 34 | 35 | #### Contacts 36 | 37 | https://github.com/AlexDenisov 38 | 39 | https://twitter.com/1101_debian 40 | 41 | -------------------------------------------------------------------------------- /Sample/Sample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 46C02BEF1A83E40C004DEA43 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 46C02BEE1A83E40C004DEA43 /* main.m */; }; 11 | 46C02BF61A83E425004DEA43 /* config.yaml in Sources */ = {isa = PBXBuildFile; fileRef = 46C02BF51A83E41A004DEA43 /* config.yaml */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXBuildRule section */ 15 | 46C02BF71A83E429004DEA43 /* PBXBuildRule */ = { 16 | isa = PBXBuildRule; 17 | compilerSpec = com.apple.compilers.proxy.script; 18 | filePatterns = "*.yaml"; 19 | fileType = pattern.proxy; 20 | isEditable = 1; 21 | name = "Compile config.yaml"; 22 | outputFiles = ( 23 | "$(DERIVED_FILE_DIR)/xcconf.m", 24 | ); 25 | script = /usr/local/bin/xcconf; 26 | }; 27 | /* End PBXBuildRule section */ 28 | 29 | /* Begin PBXCopyFilesBuildPhase section */ 30 | 46C02BE91A83E40C004DEA43 /* CopyFiles */ = { 31 | isa = PBXCopyFilesBuildPhase; 32 | buildActionMask = 2147483647; 33 | dstPath = /usr/share/man/man1/; 34 | dstSubfolderSpec = 0; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 1; 38 | }; 39 | /* End PBXCopyFilesBuildPhase section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 46C02BEB1A83E40C004DEA43 /* Sample */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Sample; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 46C02BEE1A83E40C004DEA43 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 44 | 46C02BF51A83E41A004DEA43 /* config.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = config.yaml; sourceTree = ""; }; 45 | 46C02BF81A83E45A004DEA43 /* Config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Config.h; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | 46C02BE81A83E40C004DEA43 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | 46C02BE21A83E40C004DEA43 = { 60 | isa = PBXGroup; 61 | children = ( 62 | 46C02BED1A83E40C004DEA43 /* Sample */, 63 | 46C02BEC1A83E40C004DEA43 /* Products */, 64 | ); 65 | sourceTree = ""; 66 | }; 67 | 46C02BEC1A83E40C004DEA43 /* Products */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 46C02BEB1A83E40C004DEA43 /* Sample */, 71 | ); 72 | name = Products; 73 | sourceTree = ""; 74 | }; 75 | 46C02BED1A83E40C004DEA43 /* Sample */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 46C02BEE1A83E40C004DEA43 /* main.m */, 79 | 46C02BF51A83E41A004DEA43 /* config.yaml */, 80 | 46C02BF81A83E45A004DEA43 /* Config.h */, 81 | ); 82 | path = Sample; 83 | sourceTree = ""; 84 | }; 85 | /* End PBXGroup section */ 86 | 87 | /* Begin PBXNativeTarget section */ 88 | 46C02BEA1A83E40C004DEA43 /* Sample */ = { 89 | isa = PBXNativeTarget; 90 | buildConfigurationList = 46C02BF21A83E40C004DEA43 /* Build configuration list for PBXNativeTarget "Sample" */; 91 | buildPhases = ( 92 | 46C02BE71A83E40C004DEA43 /* Sources */, 93 | 46C02BE81A83E40C004DEA43 /* Frameworks */, 94 | 46C02BE91A83E40C004DEA43 /* CopyFiles */, 95 | ); 96 | buildRules = ( 97 | 46C02BF71A83E429004DEA43 /* PBXBuildRule */, 98 | ); 99 | dependencies = ( 100 | ); 101 | name = Sample; 102 | productName = Sample; 103 | productReference = 46C02BEB1A83E40C004DEA43 /* Sample */; 104 | productType = "com.apple.product-type.tool"; 105 | }; 106 | /* End PBXNativeTarget section */ 107 | 108 | /* Begin PBXProject section */ 109 | 46C02BE31A83E40C004DEA43 /* Project object */ = { 110 | isa = PBXProject; 111 | attributes = { 112 | LastUpgradeCheck = 0610; 113 | ORGANIZATIONNAME = AlexDenisov; 114 | TargetAttributes = { 115 | 46C02BEA1A83E40C004DEA43 = { 116 | CreatedOnToolsVersion = 6.1.1; 117 | }; 118 | }; 119 | }; 120 | buildConfigurationList = 46C02BE61A83E40C004DEA43 /* Build configuration list for PBXProject "Sample" */; 121 | compatibilityVersion = "Xcode 3.2"; 122 | developmentRegion = English; 123 | hasScannedForEncodings = 0; 124 | knownRegions = ( 125 | en, 126 | ); 127 | mainGroup = 46C02BE21A83E40C004DEA43; 128 | productRefGroup = 46C02BEC1A83E40C004DEA43 /* Products */; 129 | projectDirPath = ""; 130 | projectRoot = ""; 131 | targets = ( 132 | 46C02BEA1A83E40C004DEA43 /* Sample */, 133 | ); 134 | }; 135 | /* End PBXProject section */ 136 | 137 | /* Begin PBXSourcesBuildPhase section */ 138 | 46C02BE71A83E40C004DEA43 /* Sources */ = { 139 | isa = PBXSourcesBuildPhase; 140 | buildActionMask = 2147483647; 141 | files = ( 142 | 46C02BF61A83E425004DEA43 /* config.yaml in Sources */, 143 | 46C02BEF1A83E40C004DEA43 /* main.m in Sources */, 144 | ); 145 | runOnlyForDeploymentPostprocessing = 0; 146 | }; 147 | /* End PBXSourcesBuildPhase section */ 148 | 149 | /* Begin XCBuildConfiguration section */ 150 | 46C02BF01A83E40C004DEA43 /* Debug */ = { 151 | isa = XCBuildConfiguration; 152 | buildSettings = { 153 | ALWAYS_SEARCH_USER_PATHS = NO; 154 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 155 | CLANG_CXX_LIBRARY = "libc++"; 156 | CLANG_ENABLE_MODULES = YES; 157 | CLANG_ENABLE_OBJC_ARC = YES; 158 | CLANG_WARN_BOOL_CONVERSION = YES; 159 | CLANG_WARN_CONSTANT_CONVERSION = YES; 160 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 161 | CLANG_WARN_EMPTY_BODY = YES; 162 | CLANG_WARN_ENUM_CONVERSION = YES; 163 | CLANG_WARN_INT_CONVERSION = YES; 164 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 165 | CLANG_WARN_UNREACHABLE_CODE = YES; 166 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 167 | COPY_PHASE_STRIP = NO; 168 | ENABLE_STRICT_OBJC_MSGSEND = YES; 169 | GCC_C_LANGUAGE_STANDARD = gnu99; 170 | GCC_DYNAMIC_NO_PIC = NO; 171 | GCC_OPTIMIZATION_LEVEL = 0; 172 | GCC_PREPROCESSOR_DEFINITIONS = ( 173 | "DEBUG=1", 174 | "$(inherited)", 175 | ); 176 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 177 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 178 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 179 | GCC_WARN_UNDECLARED_SELECTOR = YES; 180 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 181 | GCC_WARN_UNUSED_FUNCTION = YES; 182 | GCC_WARN_UNUSED_VARIABLE = YES; 183 | MACOSX_DEPLOYMENT_TARGET = 10.10; 184 | MTL_ENABLE_DEBUG_INFO = YES; 185 | ONLY_ACTIVE_ARCH = YES; 186 | SDKROOT = macosx; 187 | }; 188 | name = Debug; 189 | }; 190 | 46C02BF11A83E40C004DEA43 /* Release */ = { 191 | isa = XCBuildConfiguration; 192 | buildSettings = { 193 | ALWAYS_SEARCH_USER_PATHS = NO; 194 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 195 | CLANG_CXX_LIBRARY = "libc++"; 196 | CLANG_ENABLE_MODULES = YES; 197 | CLANG_ENABLE_OBJC_ARC = YES; 198 | CLANG_WARN_BOOL_CONVERSION = YES; 199 | CLANG_WARN_CONSTANT_CONVERSION = YES; 200 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 201 | CLANG_WARN_EMPTY_BODY = YES; 202 | CLANG_WARN_ENUM_CONVERSION = YES; 203 | CLANG_WARN_INT_CONVERSION = YES; 204 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 205 | CLANG_WARN_UNREACHABLE_CODE = YES; 206 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 207 | COPY_PHASE_STRIP = YES; 208 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 209 | ENABLE_NS_ASSERTIONS = NO; 210 | ENABLE_STRICT_OBJC_MSGSEND = YES; 211 | GCC_C_LANGUAGE_STANDARD = gnu99; 212 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 213 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 214 | GCC_WARN_UNDECLARED_SELECTOR = YES; 215 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 216 | GCC_WARN_UNUSED_FUNCTION = YES; 217 | GCC_WARN_UNUSED_VARIABLE = YES; 218 | MACOSX_DEPLOYMENT_TARGET = 10.10; 219 | MTL_ENABLE_DEBUG_INFO = NO; 220 | SDKROOT = macosx; 221 | }; 222 | name = Release; 223 | }; 224 | 46C02BF31A83E40C004DEA43 /* Debug */ = { 225 | isa = XCBuildConfiguration; 226 | buildSettings = { 227 | PRODUCT_NAME = "$(TARGET_NAME)"; 228 | }; 229 | name = Debug; 230 | }; 231 | 46C02BF41A83E40C004DEA43 /* Release */ = { 232 | isa = XCBuildConfiguration; 233 | buildSettings = { 234 | PRODUCT_NAME = "$(TARGET_NAME)"; 235 | }; 236 | name = Release; 237 | }; 238 | /* End XCBuildConfiguration section */ 239 | 240 | /* Begin XCConfigurationList section */ 241 | 46C02BE61A83E40C004DEA43 /* Build configuration list for PBXProject "Sample" */ = { 242 | isa = XCConfigurationList; 243 | buildConfigurations = ( 244 | 46C02BF01A83E40C004DEA43 /* Debug */, 245 | 46C02BF11A83E40C004DEA43 /* Release */, 246 | ); 247 | defaultConfigurationIsVisible = 0; 248 | defaultConfigurationName = Release; 249 | }; 250 | 46C02BF21A83E40C004DEA43 /* Build configuration list for PBXNativeTarget "Sample" */ = { 251 | isa = XCConfigurationList; 252 | buildConfigurations = ( 253 | 46C02BF31A83E40C004DEA43 /* Debug */, 254 | 46C02BF41A83E40C004DEA43 /* Release */, 255 | ); 256 | defaultConfigurationIsVisible = 0; 257 | }; 258 | /* End XCConfigurationList section */ 259 | }; 260 | rootObject = 46C02BE31A83E40C004DEA43 /* Project object */; 261 | } 262 | -------------------------------------------------------------------------------- /Sample/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Sample/Sample/Config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Config.h 3 | // Sample 4 | // 5 | // Created by AlexDenisov on 05/02/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Config : NSObject 12 | 13 | - (NSString *)serverAddress; 14 | - (NSString *)analyticsKey; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Sample/Sample/config.yaml: -------------------------------------------------------------------------------- 1 | principalClass: Config 2 | 3 | Debug: 4 | serverAddress: https://fooo-bar.buzz 5 | analyticsKey: debug_key_123 6 | 7 | Release: 8 | serverAddress: https://prod.fooo-bar.buzz 9 | analyticsKey: production_key_123 10 | -------------------------------------------------------------------------------- /Sample/Sample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Sample 4 | // 5 | // Created by AlexDenisov on 05/02/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Config.h" 11 | 12 | int main(int argc, const char * argv[]) { 13 | @autoreleasepool { 14 | Config *config = [Config new]; 15 | NSLog(@"%@ %@", config.serverAddress, config.analyticsKey); 16 | } 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /xcconf.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 27D2861E1B4B8E0E003114F9 /* XCCSecureXORParametersCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D2861D1B4B8E0E003114F9 /* XCCSecureXORParametersCodeGenerator.m */; }; 11 | 27D2862C1B4B8F31003114F9 /* XCCSecureXORParametersCodeGeneratorSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 27D2862B1B4B8F31003114F9 /* XCCSecureXORParametersCodeGeneratorSpec.mm */; }; 12 | 27D2862D1B4B90B7003114F9 /* XCCSecureXORParametersCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D2861D1B4B8E0E003114F9 /* XCCSecureXORParametersCodeGenerator.m */; }; 13 | 46033E761AAB7F3A00046796 /* XCCDiagnosticsEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 46033E751AAB7F3A00046796 /* XCCDiagnosticsEngine.m */; }; 14 | 46033E771AAB7F3A00046796 /* XCCDiagnosticsEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 46033E751AAB7F3A00046796 /* XCCDiagnosticsEngine.m */; }; 15 | 4661610B1B38131D00386ACD /* XCCDriverOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4661610A1B38131D00386ACD /* XCCDriverOptions.m */; }; 16 | 4661611A1B3814D500386ACD /* XCCDriverOptionsBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 466161191B3814D500386ACD /* XCCDriverOptionsBuilder.m */; }; 17 | 4661611C1B38151400386ACD /* XCCDriverOptionsBuilderSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4661611B1B38151400386ACD /* XCCDriverOptionsBuilderSpec.mm */; }; 18 | 4661611D1B38181800386ACD /* XCCDriverOptionsBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 466161191B3814D500386ACD /* XCCDriverOptionsBuilder.m */; }; 19 | 466161341B38225800386ACD /* XCCDriverOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4661610A1B38131D00386ACD /* XCCDriverOptions.m */; }; 20 | 466161381B3824B800386ACD /* XCCSecureParametersCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 466161371B3824B800386ACD /* XCCSecureParametersCodeGenerator.m */; }; 21 | 466161391B3824B800386ACD /* XCCSecureParametersCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 466161371B3824B800386ACD /* XCCSecureParametersCodeGenerator.m */; }; 22 | 4661613B1B38251300386ACD /* XCCSecureParametersCodeGeneratorSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4661613A1B38251300386ACD /* XCCSecureParametersCodeGeneratorSpec.mm */; }; 23 | 46C02AEB1A82CBB0004DEA43 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 46C02AEA1A82CBB0004DEA43 /* main.m */; }; 24 | 46C02B421A82D205004DEA43 /* Cedar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46C02B2B1A82D1E8004DEA43 /* Cedar.framework */; }; 25 | 46C02B461A82D2E4004DEA43 /* YAML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46C02B451A82D2E4004DEA43 /* YAML.framework */; }; 26 | 46C02B471A82D2E4004DEA43 /* YAML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46C02B451A82D2E4004DEA43 /* YAML.framework */; }; 27 | 46C02B961A82DC73004DEA43 /* Valid.yaml in CopyFiles */ = {isa = PBXBuildFile; fileRef = 46C02B791A82D78C004DEA43 /* Valid.yaml */; }; 28 | 46C02BE01A83D275004DEA43 /* XCCDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 46C02BDF1A83D275004DEA43 /* XCCDriver.m */; }; 29 | 46C02BE11A83D275004DEA43 /* XCCDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 46C02BDF1A83D275004DEA43 /* XCCDriver.m */; }; 30 | 6B8762C7F247B9AF83E4358E /* XCCConfigurationParserSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6B8765FB42DE74340DB55E2E /* XCCConfigurationParserSpec.mm */; }; 31 | 6B87650EA0469979CE4A8BB3 /* XCCEnvironment.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B876800B796EE840B9A16BF /* XCCEnvironment.m */; }; 32 | 6B87662A110FBAF34B9BE28D /* XCCConfigurationCodeGeneratorSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6B876ACA622537DA2A81924C /* XCCConfigurationCodeGeneratorSpec.mm */; }; 33 | 6B8766E0624E22E8E1A95E5B /* XCCConfigurationParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8768E1FD3FC9A32B3380E1 /* XCCConfigurationParser.m */; }; 34 | 6B876774D7377B3E9FDE1B94 /* XCCParametersCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B87682FEA3C7E8E469FD41D /* XCCParametersCodeGenerator.m */; }; 35 | 6B8767A663447D9CAE63CCE1 /* XCCEnvironmentSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6B876C8006218DDC43999D41 /* XCCEnvironmentSpec.mm */; }; 36 | 6B8767DE665E2181CFB953FD /* XCCParametersCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B87682FEA3C7E8E469FD41D /* XCCParametersCodeGenerator.m */; }; 37 | 6B87685105B16FBB956207FE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B876A1ADBB157BCE3899AAD /* main.m */; }; 38 | 6B87686317B12341ED5F44B5 /* XCCYAMLConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8767C8330885BFE5A670F7 /* XCCYAMLConfiguration.m */; }; 39 | 6B87690D6A134317D45AE37F /* XCCConfigurationCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8766AA7AC6A17635668DC3 /* XCCConfigurationCodeGenerator.m */; }; 40 | 6B876974325C7F23F26319E6 /* XCCYAMLConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8767C8330885BFE5A670F7 /* XCCYAMLConfiguration.m */; }; 41 | 6B876BDE919DEFF90AB89D5F /* XCCConfigurationParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8768E1FD3FC9A32B3380E1 /* XCCConfigurationParser.m */; }; 42 | 6B876CA05648E28C44ADED6C /* XCCEnvironment.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B876800B796EE840B9A16BF /* XCCEnvironment.m */; }; 43 | 6B876CACF50AE301E28B8015 /* XCCParameterCodeGeneratorSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6B876754199E6DE92F0A7A62 /* XCCParameterCodeGeneratorSpec.mm */; }; 44 | 6B876E95BEA8C1EC11AD9797 /* XCCYAMLConfigurationSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6B8768772E34C4078EC127BA /* XCCYAMLConfigurationSpec.mm */; }; 45 | 6B876F62B619F1BC54A86AEE /* XCCConfigurationCodeGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8766AA7AC6A17635668DC3 /* XCCConfigurationCodeGenerator.m */; }; 46 | /* End PBXBuildFile section */ 47 | 48 | /* Begin PBXContainerItemProxy section */ 49 | 466CD7C81AAB7B0C009A029F /* PBXContainerItemProxy */ = { 50 | isa = PBXContainerItemProxy; 51 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 52 | proxyType = 1; 53 | remoteGlobalIDString = AEEE1FB511DC271300029872; 54 | remoteInfo = Cedar; 55 | }; 56 | 46C02B2A1A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 57 | isa = PBXContainerItemProxy; 58 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 59 | proxyType = 2; 60 | remoteGlobalIDString = AEEE1FB611DC271300029872; 61 | remoteInfo = Cedar; 62 | }; 63 | 46C02B2C1A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 64 | isa = PBXContainerItemProxy; 65 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 66 | proxyType = 2; 67 | remoteGlobalIDString = AEEE218611DC28E200029872; 68 | remoteInfo = "Cedar OS X Specs"; 69 | }; 70 | 46C02B2E1A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 71 | isa = PBXContainerItemProxy; 72 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 73 | proxyType = 2; 74 | remoteGlobalIDString = 96A07F0813F276640021974D; 75 | remoteInfo = "Cedar OS X FocusedSpecs"; 76 | }; 77 | 46C02B301A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 78 | isa = PBXContainerItemProxy; 79 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 80 | proxyType = 2; 81 | remoteGlobalIDString = AEEE222911DC2B0600029872; 82 | remoteInfo = "Cedar-StaticLib"; 83 | }; 84 | 46C02B321A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 85 | isa = PBXContainerItemProxy; 86 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 87 | proxyType = 2; 88 | remoteGlobalIDString = AEEE227611DC2CF900029872; 89 | remoteInfo = "Cedar iOS Specs"; 90 | }; 91 | 46C02B341A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 92 | isa = PBXContainerItemProxy; 93 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 94 | proxyType = 2; 95 | remoteGlobalIDString = AE02E7E4184EABCD00414F19; 96 | remoteInfo = "Cedar iOS FrameworkSpecs"; 97 | }; 98 | 46C02B361A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 99 | isa = PBXContainerItemProxy; 100 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 101 | proxyType = 2; 102 | remoteGlobalIDString = 96B5F9F6144A81A7000A6A5D; 103 | remoteInfo = "Cedar iOS Host App"; 104 | }; 105 | 46C02B381A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 106 | isa = PBXContainerItemProxy; 107 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 108 | proxyType = 2; 109 | remoteGlobalIDString = 96B5FA11144A81A8000A6A5D; 110 | remoteInfo = "Cedar iOS SenTestingKit Tests"; 111 | }; 112 | 46C02B3A1A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 113 | isa = PBXContainerItemProxy; 114 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 115 | proxyType = 2; 116 | remoteGlobalIDString = 1F45A3DD180E4796003C1E36; 117 | remoteInfo = "Cedar iOS XCTest Tests"; 118 | }; 119 | 46C02B3C1A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 120 | isa = PBXContainerItemProxy; 121 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 122 | proxyType = 2; 123 | remoteGlobalIDString = AE248F9819DCD52500092C14; 124 | remoteInfo = "Cedar OS X Host App"; 125 | }; 126 | 46C02B3E1A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 127 | isa = PBXContainerItemProxy; 128 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 129 | proxyType = 2; 130 | remoteGlobalIDString = AE248FAA19DCD52500092C14; 131 | remoteInfo = "Cedar OS X Host AppTests"; 132 | }; 133 | 46C02B401A82D1E8004DEA43 /* PBXContainerItemProxy */ = { 134 | isa = PBXContainerItemProxy; 135 | containerPortal = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 136 | proxyType = 2; 137 | remoteGlobalIDString = AEB8818719DCD62D00F081BA; 138 | remoteInfo = "Cedar OS X Failing Test Bundle"; 139 | }; 140 | /* End PBXContainerItemProxy section */ 141 | 142 | /* Begin PBXCopyFilesBuildPhase section */ 143 | 46C02AE51A82CBB0004DEA43 /* CopyFiles */ = { 144 | isa = PBXCopyFilesBuildPhase; 145 | buildActionMask = 2147483647; 146 | dstPath = /usr/share/man/man1/; 147 | dstSubfolderSpec = 0; 148 | files = ( 149 | ); 150 | runOnlyForDeploymentPostprocessing = 1; 151 | }; 152 | 46C02B881A82DC69004DEA43 /* CopyFiles */ = { 153 | isa = PBXCopyFilesBuildPhase; 154 | buildActionMask = 2147483647; 155 | dstPath = ""; 156 | dstSubfolderSpec = 7; 157 | files = ( 158 | 46C02B961A82DC73004DEA43 /* Valid.yaml in CopyFiles */, 159 | ); 160 | runOnlyForDeploymentPostprocessing = 0; 161 | }; 162 | /* End PBXCopyFilesBuildPhase section */ 163 | 164 | /* Begin PBXFileReference section */ 165 | 27D2861C1B4B8E0E003114F9 /* XCCSecureXORParametersCodeGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCSecureXORParametersCodeGenerator.h; sourceTree = ""; }; 166 | 27D2861D1B4B8E0E003114F9 /* XCCSecureXORParametersCodeGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCSecureXORParametersCodeGenerator.m; sourceTree = ""; }; 167 | 27D2862B1B4B8F31003114F9 /* XCCSecureXORParametersCodeGeneratorSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XCCSecureXORParametersCodeGeneratorSpec.mm; sourceTree = ""; }; 168 | 46033E741AAB7F3A00046796 /* XCCDiagnosticsEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCDiagnosticsEngine.h; sourceTree = ""; }; 169 | 46033E751AAB7F3A00046796 /* XCCDiagnosticsEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCDiagnosticsEngine.m; sourceTree = ""; }; 170 | 466161091B38131D00386ACD /* XCCDriverOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCDriverOptions.h; sourceTree = ""; }; 171 | 4661610A1B38131D00386ACD /* XCCDriverOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCDriverOptions.m; sourceTree = ""; }; 172 | 466161181B3814D500386ACD /* XCCDriverOptionsBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCDriverOptionsBuilder.h; sourceTree = ""; }; 173 | 466161191B3814D500386ACD /* XCCDriverOptionsBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCDriverOptionsBuilder.m; sourceTree = ""; }; 174 | 4661611B1B38151400386ACD /* XCCDriverOptionsBuilderSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XCCDriverOptionsBuilderSpec.mm; sourceTree = ""; }; 175 | 466161351B3822A800386ACD /* XCCDriverOptionsBuilder_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCDriverOptionsBuilder_Internal.h; sourceTree = ""; }; 176 | 466161361B3824B800386ACD /* XCCSecureParametersCodeGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCSecureParametersCodeGenerator.h; sourceTree = ""; }; 177 | 466161371B3824B800386ACD /* XCCSecureParametersCodeGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCSecureParametersCodeGenerator.m; sourceTree = ""; }; 178 | 4661613A1B38251300386ACD /* XCCSecureParametersCodeGeneratorSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XCCSecureParametersCodeGeneratorSpec.mm; sourceTree = ""; }; 179 | 4661613C1B38303D00386ACD /* XCCParametersCodeGeneratorProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCParametersCodeGeneratorProtocol.h; sourceTree = ""; }; 180 | 46C02AE71A82CBB0004DEA43 /* xcconf */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = xcconf; sourceTree = BUILT_PRODUCTS_DIR; }; 181 | 46C02AEA1A82CBB0004DEA43 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 182 | 46C02B0B1A82D0B5004DEA43 /* xcconf_tests */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = xcconf_tests; sourceTree = BUILT_PRODUCTS_DIR; }; 183 | 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Cedar.xcodeproj; path = Cedar/Cedar.xcodeproj; sourceTree = ""; }; 184 | 46C02B451A82D2E4004DEA43 /* YAML.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = YAML.framework; sourceTree = ""; }; 185 | 46C02B791A82D78C004DEA43 /* Valid.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Valid.yaml; sourceTree = ""; }; 186 | 46C02BDE1A83D275004DEA43 /* XCCDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCDriver.h; sourceTree = ""; }; 187 | 46C02BDF1A83D275004DEA43 /* XCCDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCDriver.m; sourceTree = ""; }; 188 | 6B8761C1DFD97345FAF26699 /* XCCParametersCodeGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCParametersCodeGenerator.h; sourceTree = ""; }; 189 | 6B8762EB5852F3E1AA490F63 /* Rakefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Rakefile; sourceTree = ""; }; 190 | 6B87635E42B002FB2B162D10 /* XCCEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCEnvironment.h; sourceTree = ""; }; 191 | 6B87652CC09997AE8E8BF777 /* XCCConfigurationCodeGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCConfigurationCodeGenerator.h; sourceTree = ""; }; 192 | 6B8765C1ABC57632BAE6B38A /* xcconf_tests-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "xcconf_tests-Prefix.pch"; sourceTree = ""; }; 193 | 6B8765FB42DE74340DB55E2E /* XCCConfigurationParserSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XCCConfigurationParserSpec.mm; sourceTree = ""; }; 194 | 6B8766AA7AC6A17635668DC3 /* XCCConfigurationCodeGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCConfigurationCodeGenerator.m; sourceTree = ""; }; 195 | 6B876754199E6DE92F0A7A62 /* XCCParameterCodeGeneratorSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XCCParameterCodeGeneratorSpec.mm; sourceTree = ""; }; 196 | 6B8767C8330885BFE5A670F7 /* XCCYAMLConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCYAMLConfiguration.m; sourceTree = ""; }; 197 | 6B876800B796EE840B9A16BF /* XCCEnvironment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCEnvironment.m; sourceTree = ""; }; 198 | 6B87682FEA3C7E8E469FD41D /* XCCParametersCodeGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCParametersCodeGenerator.m; sourceTree = ""; }; 199 | 6B8768772E34C4078EC127BA /* XCCYAMLConfigurationSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XCCYAMLConfigurationSpec.mm; sourceTree = ""; }; 200 | 6B8768E1FD3FC9A32B3380E1 /* XCCConfigurationParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCCConfigurationParser.m; sourceTree = ""; }; 201 | 6B876A1ADBB157BCE3899AAD /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 202 | 6B876ABF87FADD458ADEEFCA /* XCCConfigurationParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCConfigurationParser.h; sourceTree = ""; }; 203 | 6B876ACA622537DA2A81924C /* XCCConfigurationCodeGeneratorSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XCCConfigurationCodeGeneratorSpec.mm; sourceTree = ""; }; 204 | 6B876C8006218DDC43999D41 /* XCCEnvironmentSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = XCCEnvironmentSpec.mm; sourceTree = ""; }; 205 | 6B876CCE13A78C344701AFCE /* XCCYAMLConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCCYAMLConfiguration.h; sourceTree = ""; }; 206 | /* End PBXFileReference section */ 207 | 208 | /* Begin PBXFrameworksBuildPhase section */ 209 | 46C02AE41A82CBB0004DEA43 /* Frameworks */ = { 210 | isa = PBXFrameworksBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | 46C02B461A82D2E4004DEA43 /* YAML.framework in Frameworks */, 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | }; 217 | 46C02B091A82D0B5004DEA43 /* Frameworks */ = { 218 | isa = PBXFrameworksBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | 46C02B421A82D205004DEA43 /* Cedar.framework in Frameworks */, 222 | 46C02B471A82D2E4004DEA43 /* YAML.framework in Frameworks */, 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | }; 226 | /* End PBXFrameworksBuildPhase section */ 227 | 228 | /* Begin PBXGroup section */ 229 | 46C02ADE1A82CBB0004DEA43 = { 230 | isa = PBXGroup; 231 | children = ( 232 | 46C02AE91A82CBB0004DEA43 /* xcconf */, 233 | 46C02B0F1A82D0B5004DEA43 /* xcconf_tests */, 234 | 46C02AE81A82CBB0004DEA43 /* Products */, 235 | 6B876C4226F13DE461A2A2B2 /* Frameworks */, 236 | ); 237 | sourceTree = ""; 238 | }; 239 | 46C02AE81A82CBB0004DEA43 /* Products */ = { 240 | isa = PBXGroup; 241 | children = ( 242 | 46C02AE71A82CBB0004DEA43 /* xcconf */, 243 | 46C02B0B1A82D0B5004DEA43 /* xcconf_tests */, 244 | ); 245 | name = Products; 246 | sourceTree = ""; 247 | }; 248 | 46C02AE91A82CBB0004DEA43 /* xcconf */ = { 249 | isa = PBXGroup; 250 | children = ( 251 | 46C02AEA1A82CBB0004DEA43 /* main.m */, 252 | 6B876E6BD68D1DC8589179AE /* Sources */, 253 | ); 254 | path = xcconf; 255 | sourceTree = ""; 256 | }; 257 | 46C02B0F1A82D0B5004DEA43 /* xcconf_tests */ = { 258 | isa = PBXGroup; 259 | children = ( 260 | 6B876E90EEEC1F815146260E /* SupportingFiles */, 261 | 6B87686217290086A2F3FAF7 /* Vendor */, 262 | 6B876604724C509DD8EB073C /* Specs */, 263 | 6B8763C7105B935D43516F01 /* Fixtures */, 264 | ); 265 | path = xcconf_tests; 266 | sourceTree = ""; 267 | }; 268 | 46C02B1B1A82D1E8004DEA43 /* Products */ = { 269 | isa = PBXGroup; 270 | children = ( 271 | 46C02B2B1A82D1E8004DEA43 /* Cedar.framework */, 272 | 46C02B2D1A82D1E8004DEA43 /* Cedar OS X Specs */, 273 | 46C02B2F1A82D1E8004DEA43 /* Cedar OS X FocusedSpecs */, 274 | 46C02B311A82D1E8004DEA43 /* libCedar-StaticLib.a */, 275 | 46C02B331A82D1E8004DEA43 /* Cedar iOS Specs.app */, 276 | 46C02B351A82D1E8004DEA43 /* Cedar iOS FrameworkSpecs.app */, 277 | 46C02B371A82D1E8004DEA43 /* Cedar iOS Host App.app */, 278 | 46C02B391A82D1E8004DEA43 /* Cedar iOS SenTestingKit Tests.octest */, 279 | 46C02B3B1A82D1E8004DEA43 /* XCUnitAppTests.xctest */, 280 | 46C02B3D1A82D1E8004DEA43 /* Cedar OS X Host App.app */, 281 | 46C02B3F1A82D1E8004DEA43 /* Cedar OS X Host AppTests.xctest */, 282 | 46C02B411A82D1E8004DEA43 /* Cedar OS X Failing Test Bundle.octest */, 283 | ); 284 | name = Products; 285 | sourceTree = ""; 286 | }; 287 | 6B876045475ABA26C948AF5B /* Models */ = { 288 | isa = PBXGroup; 289 | children = ( 290 | 6B8768772E34C4078EC127BA /* XCCYAMLConfigurationSpec.mm */, 291 | 6B876C8006218DDC43999D41 /* XCCEnvironmentSpec.mm */, 292 | ); 293 | path = Models; 294 | sourceTree = ""; 295 | }; 296 | 6B876180866B9C547D4927DA /* Models */ = { 297 | isa = PBXGroup; 298 | children = ( 299 | 6B876CCE13A78C344701AFCE /* XCCYAMLConfiguration.h */, 300 | 6B8767C8330885BFE5A670F7 /* XCCYAMLConfiguration.m */, 301 | 6B87635E42B002FB2B162D10 /* XCCEnvironment.h */, 302 | 6B876800B796EE840B9A16BF /* XCCEnvironment.m */, 303 | ); 304 | path = Models; 305 | sourceTree = ""; 306 | }; 307 | 6B876341E3B94F5603CA3396 /* CodeGen */ = { 308 | isa = PBXGroup; 309 | children = ( 310 | 6B876ACA622537DA2A81924C /* XCCConfigurationCodeGeneratorSpec.mm */, 311 | 6B876754199E6DE92F0A7A62 /* XCCParameterCodeGeneratorSpec.mm */, 312 | 4661613A1B38251300386ACD /* XCCSecureParametersCodeGeneratorSpec.mm */, 313 | 27D2862B1B4B8F31003114F9 /* XCCSecureXORParametersCodeGeneratorSpec.mm */, 314 | ); 315 | path = CodeGen; 316 | sourceTree = ""; 317 | }; 318 | 6B8763C7105B935D43516F01 /* Fixtures */ = { 319 | isa = PBXGroup; 320 | children = ( 321 | 46C02B791A82D78C004DEA43 /* Valid.yaml */, 322 | ); 323 | path = Fixtures; 324 | sourceTree = ""; 325 | }; 326 | 6B876453836900DC782B2CFA /* Parser */ = { 327 | isa = PBXGroup; 328 | children = ( 329 | 6B876ABF87FADD458ADEEFCA /* XCCConfigurationParser.h */, 330 | 6B8768E1FD3FC9A32B3380E1 /* XCCConfigurationParser.m */, 331 | ); 332 | path = Parser; 333 | sourceTree = ""; 334 | }; 335 | 6B8765EAE32F3DA06CCC9AD5 /* CodeGen */ = { 336 | isa = PBXGroup; 337 | children = ( 338 | 6B87652CC09997AE8E8BF777 /* XCCConfigurationCodeGenerator.h */, 339 | 6B8766AA7AC6A17635668DC3 /* XCCConfigurationCodeGenerator.m */, 340 | 4661613C1B38303D00386ACD /* XCCParametersCodeGeneratorProtocol.h */, 341 | 6B8761C1DFD97345FAF26699 /* XCCParametersCodeGenerator.h */, 342 | 6B87682FEA3C7E8E469FD41D /* XCCParametersCodeGenerator.m */, 343 | 466161361B3824B800386ACD /* XCCSecureParametersCodeGenerator.h */, 344 | 466161371B3824B800386ACD /* XCCSecureParametersCodeGenerator.m */, 345 | 27D2861C1B4B8E0E003114F9 /* XCCSecureXORParametersCodeGenerator.h */, 346 | 27D2861D1B4B8E0E003114F9 /* XCCSecureXORParametersCodeGenerator.m */, 347 | ); 348 | path = CodeGen; 349 | sourceTree = ""; 350 | }; 351 | 6B876604724C509DD8EB073C /* Specs */ = { 352 | isa = PBXGroup; 353 | children = ( 354 | 6B876341E3B94F5603CA3396 /* CodeGen */, 355 | 6B8768BC50FCC285C9B51694 /* Parser */, 356 | 6B876045475ABA26C948AF5B /* Models */, 357 | 6B876A9A0C3A0B2DEEED5924 /* Driver */, 358 | ); 359 | path = Specs; 360 | sourceTree = ""; 361 | }; 362 | 6B87686217290086A2F3FAF7 /* Vendor */ = { 363 | isa = PBXGroup; 364 | children = ( 365 | 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */, 366 | ); 367 | path = Vendor; 368 | sourceTree = ""; 369 | }; 370 | 6B8768BC50FCC285C9B51694 /* Parser */ = { 371 | isa = PBXGroup; 372 | children = ( 373 | 6B8765FB42DE74340DB55E2E /* XCCConfigurationParserSpec.mm */, 374 | ); 375 | path = Parser; 376 | sourceTree = ""; 377 | }; 378 | 6B876A9A0C3A0B2DEEED5924 /* Driver */ = { 379 | isa = PBXGroup; 380 | children = ( 381 | 4661611B1B38151400386ACD /* XCCDriverOptionsBuilderSpec.mm */, 382 | ); 383 | path = Driver; 384 | sourceTree = ""; 385 | }; 386 | 6B876C4226F13DE461A2A2B2 /* Frameworks */ = { 387 | isa = PBXGroup; 388 | children = ( 389 | 46C02B451A82D2E4004DEA43 /* YAML.framework */, 390 | ); 391 | path = Frameworks; 392 | sourceTree = ""; 393 | }; 394 | 6B876CF1BF975F267A0F3A36 /* Driver */ = { 395 | isa = PBXGroup; 396 | children = ( 397 | 46C02BDE1A83D275004DEA43 /* XCCDriver.h */, 398 | 46C02BDF1A83D275004DEA43 /* XCCDriver.m */, 399 | 46033E741AAB7F3A00046796 /* XCCDiagnosticsEngine.h */, 400 | 46033E751AAB7F3A00046796 /* XCCDiagnosticsEngine.m */, 401 | 466161091B38131D00386ACD /* XCCDriverOptions.h */, 402 | 4661610A1B38131D00386ACD /* XCCDriverOptions.m */, 403 | 466161351B3822A800386ACD /* XCCDriverOptionsBuilder_Internal.h */, 404 | 466161181B3814D500386ACD /* XCCDriverOptionsBuilder.h */, 405 | 466161191B3814D500386ACD /* XCCDriverOptionsBuilder.m */, 406 | ); 407 | path = Driver; 408 | sourceTree = ""; 409 | }; 410 | 6B876E6BD68D1DC8589179AE /* Sources */ = { 411 | isa = PBXGroup; 412 | children = ( 413 | 6B876180866B9C547D4927DA /* Models */, 414 | 6B876453836900DC782B2CFA /* Parser */, 415 | 6B8765EAE32F3DA06CCC9AD5 /* CodeGen */, 416 | 6B876CF1BF975F267A0F3A36 /* Driver */, 417 | ); 418 | path = Sources; 419 | sourceTree = ""; 420 | }; 421 | 6B876E90EEEC1F815146260E /* SupportingFiles */ = { 422 | isa = PBXGroup; 423 | children = ( 424 | 6B876A1ADBB157BCE3899AAD /* main.m */, 425 | 6B8762EB5852F3E1AA490F63 /* Rakefile */, 426 | 6B8765C1ABC57632BAE6B38A /* xcconf_tests-Prefix.pch */, 427 | ); 428 | path = SupportingFiles; 429 | sourceTree = ""; 430 | }; 431 | /* End PBXGroup section */ 432 | 433 | /* Begin PBXNativeTarget section */ 434 | 46C02AE61A82CBB0004DEA43 /* xcconf */ = { 435 | isa = PBXNativeTarget; 436 | buildConfigurationList = 46C02AEE1A82CBB0004DEA43 /* Build configuration list for PBXNativeTarget "xcconf" */; 437 | buildPhases = ( 438 | 46C02AE31A82CBB0004DEA43 /* Sources */, 439 | 46C02AE41A82CBB0004DEA43 /* Frameworks */, 440 | 46C02AE51A82CBB0004DEA43 /* CopyFiles */, 441 | ); 442 | buildRules = ( 443 | ); 444 | dependencies = ( 445 | ); 446 | name = xcconf; 447 | productName = xcconf; 448 | productReference = 46C02AE71A82CBB0004DEA43 /* xcconf */; 449 | productType = "com.apple.product-type.tool"; 450 | }; 451 | 46C02B0A1A82D0B5004DEA43 /* xcconf_tests */ = { 452 | isa = PBXNativeTarget; 453 | buildConfigurationList = 46C02B171A82D0B5004DEA43 /* Build configuration list for PBXNativeTarget "xcconf_tests" */; 454 | buildPhases = ( 455 | 46C02B081A82D0B5004DEA43 /* Sources */, 456 | 46C02B091A82D0B5004DEA43 /* Frameworks */, 457 | 46C02B881A82DC69004DEA43 /* CopyFiles */, 458 | ); 459 | buildRules = ( 460 | ); 461 | dependencies = ( 462 | 466CD7C91AAB7B0C009A029F /* PBXTargetDependency */, 463 | ); 464 | name = xcconf_tests; 465 | productName = xcconf_tests; 466 | productReference = 46C02B0B1A82D0B5004DEA43 /* xcconf_tests */; 467 | productType = "com.apple.product-type.tool"; 468 | }; 469 | /* End PBXNativeTarget section */ 470 | 471 | /* Begin PBXProject section */ 472 | 46C02ADF1A82CBB0004DEA43 /* Project object */ = { 473 | isa = PBXProject; 474 | attributes = { 475 | CLASSPREFIX = XCC; 476 | LastUpgradeCheck = 0610; 477 | ORGANIZATIONNAME = AlexDenisov; 478 | TargetAttributes = { 479 | 46C02AE61A82CBB0004DEA43 = { 480 | CreatedOnToolsVersion = 6.1.1; 481 | }; 482 | 46C02B0A1A82D0B5004DEA43 = { 483 | CreatedOnToolsVersion = 6.1.1; 484 | }; 485 | }; 486 | }; 487 | buildConfigurationList = 46C02AE21A82CBB0004DEA43 /* Build configuration list for PBXProject "xcconf" */; 488 | compatibilityVersion = "Xcode 3.2"; 489 | developmentRegion = English; 490 | hasScannedForEncodings = 0; 491 | knownRegions = ( 492 | en, 493 | ); 494 | mainGroup = 46C02ADE1A82CBB0004DEA43; 495 | productRefGroup = 46C02AE81A82CBB0004DEA43 /* Products */; 496 | projectDirPath = ""; 497 | projectReferences = ( 498 | { 499 | ProductGroup = 46C02B1B1A82D1E8004DEA43 /* Products */; 500 | ProjectRef = 46C02B1A1A82D1E8004DEA43 /* Cedar.xcodeproj */; 501 | }, 502 | ); 503 | projectRoot = ""; 504 | targets = ( 505 | 46C02AE61A82CBB0004DEA43 /* xcconf */, 506 | 46C02B0A1A82D0B5004DEA43 /* xcconf_tests */, 507 | ); 508 | }; 509 | /* End PBXProject section */ 510 | 511 | /* Begin PBXReferenceProxy section */ 512 | 46C02B2B1A82D1E8004DEA43 /* Cedar.framework */ = { 513 | isa = PBXReferenceProxy; 514 | fileType = wrapper.framework; 515 | path = Cedar.framework; 516 | remoteRef = 46C02B2A1A82D1E8004DEA43 /* PBXContainerItemProxy */; 517 | sourceTree = BUILT_PRODUCTS_DIR; 518 | }; 519 | 46C02B2D1A82D1E8004DEA43 /* Cedar OS X Specs */ = { 520 | isa = PBXReferenceProxy; 521 | fileType = "compiled.mach-o.executable"; 522 | path = "Cedar OS X Specs"; 523 | remoteRef = 46C02B2C1A82D1E8004DEA43 /* PBXContainerItemProxy */; 524 | sourceTree = BUILT_PRODUCTS_DIR; 525 | }; 526 | 46C02B2F1A82D1E8004DEA43 /* Cedar OS X FocusedSpecs */ = { 527 | isa = PBXReferenceProxy; 528 | fileType = "compiled.mach-o.executable"; 529 | path = "Cedar OS X FocusedSpecs"; 530 | remoteRef = 46C02B2E1A82D1E8004DEA43 /* PBXContainerItemProxy */; 531 | sourceTree = BUILT_PRODUCTS_DIR; 532 | }; 533 | 46C02B311A82D1E8004DEA43 /* libCedar-StaticLib.a */ = { 534 | isa = PBXReferenceProxy; 535 | fileType = archive.ar; 536 | path = "libCedar-StaticLib.a"; 537 | remoteRef = 46C02B301A82D1E8004DEA43 /* PBXContainerItemProxy */; 538 | sourceTree = BUILT_PRODUCTS_DIR; 539 | }; 540 | 46C02B331A82D1E8004DEA43 /* Cedar iOS Specs.app */ = { 541 | isa = PBXReferenceProxy; 542 | fileType = wrapper.application; 543 | path = "Cedar iOS Specs.app"; 544 | remoteRef = 46C02B321A82D1E8004DEA43 /* PBXContainerItemProxy */; 545 | sourceTree = BUILT_PRODUCTS_DIR; 546 | }; 547 | 46C02B351A82D1E8004DEA43 /* Cedar iOS FrameworkSpecs.app */ = { 548 | isa = PBXReferenceProxy; 549 | fileType = wrapper.application; 550 | path = "Cedar iOS FrameworkSpecs.app"; 551 | remoteRef = 46C02B341A82D1E8004DEA43 /* PBXContainerItemProxy */; 552 | sourceTree = BUILT_PRODUCTS_DIR; 553 | }; 554 | 46C02B371A82D1E8004DEA43 /* Cedar iOS Host App.app */ = { 555 | isa = PBXReferenceProxy; 556 | fileType = wrapper.application; 557 | path = "Cedar iOS Host App.app"; 558 | remoteRef = 46C02B361A82D1E8004DEA43 /* PBXContainerItemProxy */; 559 | sourceTree = BUILT_PRODUCTS_DIR; 560 | }; 561 | 46C02B391A82D1E8004DEA43 /* Cedar iOS SenTestingKit Tests.octest */ = { 562 | isa = PBXReferenceProxy; 563 | fileType = wrapper.cfbundle; 564 | path = "Cedar iOS SenTestingKit Tests.octest"; 565 | remoteRef = 46C02B381A82D1E8004DEA43 /* PBXContainerItemProxy */; 566 | sourceTree = BUILT_PRODUCTS_DIR; 567 | }; 568 | 46C02B3B1A82D1E8004DEA43 /* XCUnitAppTests.xctest */ = { 569 | isa = PBXReferenceProxy; 570 | fileType = wrapper.cfbundle; 571 | path = XCUnitAppTests.xctest; 572 | remoteRef = 46C02B3A1A82D1E8004DEA43 /* PBXContainerItemProxy */; 573 | sourceTree = BUILT_PRODUCTS_DIR; 574 | }; 575 | 46C02B3D1A82D1E8004DEA43 /* Cedar OS X Host App.app */ = { 576 | isa = PBXReferenceProxy; 577 | fileType = wrapper.application; 578 | path = "Cedar OS X Host App.app"; 579 | remoteRef = 46C02B3C1A82D1E8004DEA43 /* PBXContainerItemProxy */; 580 | sourceTree = BUILT_PRODUCTS_DIR; 581 | }; 582 | 46C02B3F1A82D1E8004DEA43 /* Cedar OS X Host AppTests.xctest */ = { 583 | isa = PBXReferenceProxy; 584 | fileType = wrapper.cfbundle; 585 | path = "Cedar OS X Host AppTests.xctest"; 586 | remoteRef = 46C02B3E1A82D1E8004DEA43 /* PBXContainerItemProxy */; 587 | sourceTree = BUILT_PRODUCTS_DIR; 588 | }; 589 | 46C02B411A82D1E8004DEA43 /* Cedar OS X Failing Test Bundle.octest */ = { 590 | isa = PBXReferenceProxy; 591 | fileType = wrapper.cfbundle; 592 | path = "Cedar OS X Failing Test Bundle.octest"; 593 | remoteRef = 46C02B401A82D1E8004DEA43 /* PBXContainerItemProxy */; 594 | sourceTree = BUILT_PRODUCTS_DIR; 595 | }; 596 | /* End PBXReferenceProxy section */ 597 | 598 | /* Begin PBXSourcesBuildPhase section */ 599 | 46C02AE31A82CBB0004DEA43 /* Sources */ = { 600 | isa = PBXSourcesBuildPhase; 601 | buildActionMask = 2147483647; 602 | files = ( 603 | 27D2861E1B4B8E0E003114F9 /* XCCSecureXORParametersCodeGenerator.m in Sources */, 604 | 46C02AEB1A82CBB0004DEA43 /* main.m in Sources */, 605 | 4661610B1B38131D00386ACD /* XCCDriverOptions.m in Sources */, 606 | 6B87686317B12341ED5F44B5 /* XCCYAMLConfiguration.m in Sources */, 607 | 4661611A1B3814D500386ACD /* XCCDriverOptionsBuilder.m in Sources */, 608 | 6B87650EA0469979CE4A8BB3 /* XCCEnvironment.m in Sources */, 609 | 466161381B3824B800386ACD /* XCCSecureParametersCodeGenerator.m in Sources */, 610 | 46C02BE01A83D275004DEA43 /* XCCDriver.m in Sources */, 611 | 6B876BDE919DEFF90AB89D5F /* XCCConfigurationParser.m in Sources */, 612 | 46033E761AAB7F3A00046796 /* XCCDiagnosticsEngine.m in Sources */, 613 | 6B8767DE665E2181CFB953FD /* XCCParametersCodeGenerator.m in Sources */, 614 | 6B87690D6A134317D45AE37F /* XCCConfigurationCodeGenerator.m in Sources */, 615 | ); 616 | runOnlyForDeploymentPostprocessing = 0; 617 | }; 618 | 46C02B081A82D0B5004DEA43 /* Sources */ = { 619 | isa = PBXSourcesBuildPhase; 620 | buildActionMask = 2147483647; 621 | files = ( 622 | 6B87685105B16FBB956207FE /* main.m in Sources */, 623 | 46033E771AAB7F3A00046796 /* XCCDiagnosticsEngine.m in Sources */, 624 | 6B876974325C7F23F26319E6 /* XCCYAMLConfiguration.m in Sources */, 625 | 466161391B3824B800386ACD /* XCCSecureParametersCodeGenerator.m in Sources */, 626 | 27D2862D1B4B90B7003114F9 /* XCCSecureXORParametersCodeGenerator.m in Sources */, 627 | 466161341B38225800386ACD /* XCCDriverOptions.m in Sources */, 628 | 4661611D1B38181800386ACD /* XCCDriverOptionsBuilder.m in Sources */, 629 | 6B876CA05648E28C44ADED6C /* XCCEnvironment.m in Sources */, 630 | 6B8766E0624E22E8E1A95E5B /* XCCConfigurationParser.m in Sources */, 631 | 46C02BE11A83D275004DEA43 /* XCCDriver.m in Sources */, 632 | 6B876774D7377B3E9FDE1B94 /* XCCParametersCodeGenerator.m in Sources */, 633 | 6B876F62B619F1BC54A86AEE /* XCCConfigurationCodeGenerator.m in Sources */, 634 | 4661611C1B38151400386ACD /* XCCDriverOptionsBuilderSpec.mm in Sources */, 635 | 6B87662A110FBAF34B9BE28D /* XCCConfigurationCodeGeneratorSpec.mm in Sources */, 636 | 27D2862C1B4B8F31003114F9 /* XCCSecureXORParametersCodeGeneratorSpec.mm in Sources */, 637 | 6B876CACF50AE301E28B8015 /* XCCParameterCodeGeneratorSpec.mm in Sources */, 638 | 6B8762C7F247B9AF83E4358E /* XCCConfigurationParserSpec.mm in Sources */, 639 | 4661613B1B38251300386ACD /* XCCSecureParametersCodeGeneratorSpec.mm in Sources */, 640 | 6B876E95BEA8C1EC11AD9797 /* XCCYAMLConfigurationSpec.mm in Sources */, 641 | 6B8767A663447D9CAE63CCE1 /* XCCEnvironmentSpec.mm in Sources */, 642 | ); 643 | runOnlyForDeploymentPostprocessing = 0; 644 | }; 645 | /* End PBXSourcesBuildPhase section */ 646 | 647 | /* Begin PBXTargetDependency section */ 648 | 466CD7C91AAB7B0C009A029F /* PBXTargetDependency */ = { 649 | isa = PBXTargetDependency; 650 | name = Cedar; 651 | targetProxy = 466CD7C81AAB7B0C009A029F /* PBXContainerItemProxy */; 652 | }; 653 | /* End PBXTargetDependency section */ 654 | 655 | /* Begin XCBuildConfiguration section */ 656 | 46C02AEC1A82CBB0004DEA43 /* Debug */ = { 657 | isa = XCBuildConfiguration; 658 | buildSettings = { 659 | ALWAYS_SEARCH_USER_PATHS = NO; 660 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 661 | CLANG_CXX_LIBRARY = "libc++"; 662 | CLANG_ENABLE_MODULES = YES; 663 | CLANG_ENABLE_OBJC_ARC = YES; 664 | CLANG_WARN_BOOL_CONVERSION = YES; 665 | CLANG_WARN_CONSTANT_CONVERSION = YES; 666 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 667 | CLANG_WARN_EMPTY_BODY = YES; 668 | CLANG_WARN_ENUM_CONVERSION = YES; 669 | CLANG_WARN_INT_CONVERSION = YES; 670 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 671 | CLANG_WARN_UNREACHABLE_CODE = YES; 672 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 673 | COPY_PHASE_STRIP = NO; 674 | ENABLE_STRICT_OBJC_MSGSEND = YES; 675 | GCC_C_LANGUAGE_STANDARD = gnu99; 676 | GCC_DYNAMIC_NO_PIC = NO; 677 | GCC_OPTIMIZATION_LEVEL = 0; 678 | GCC_PREPROCESSOR_DEFINITIONS = ( 679 | "DEBUG=1", 680 | "$(inherited)", 681 | ); 682 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 683 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 684 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 685 | GCC_WARN_UNDECLARED_SELECTOR = YES; 686 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 687 | GCC_WARN_UNUSED_FUNCTION = YES; 688 | GCC_WARN_UNUSED_VARIABLE = YES; 689 | MACOSX_DEPLOYMENT_TARGET = 10.10; 690 | MTL_ENABLE_DEBUG_INFO = YES; 691 | ONLY_ACTIVE_ARCH = YES; 692 | SDKROOT = macosx; 693 | }; 694 | name = Debug; 695 | }; 696 | 46C02AED1A82CBB0004DEA43 /* Release */ = { 697 | isa = XCBuildConfiguration; 698 | buildSettings = { 699 | ALWAYS_SEARCH_USER_PATHS = NO; 700 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 701 | CLANG_CXX_LIBRARY = "libc++"; 702 | CLANG_ENABLE_MODULES = YES; 703 | CLANG_ENABLE_OBJC_ARC = YES; 704 | CLANG_WARN_BOOL_CONVERSION = YES; 705 | CLANG_WARN_CONSTANT_CONVERSION = YES; 706 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 707 | CLANG_WARN_EMPTY_BODY = YES; 708 | CLANG_WARN_ENUM_CONVERSION = YES; 709 | CLANG_WARN_INT_CONVERSION = YES; 710 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 711 | CLANG_WARN_UNREACHABLE_CODE = YES; 712 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 713 | COPY_PHASE_STRIP = YES; 714 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 715 | ENABLE_NS_ASSERTIONS = NO; 716 | ENABLE_STRICT_OBJC_MSGSEND = YES; 717 | GCC_C_LANGUAGE_STANDARD = gnu99; 718 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 719 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 720 | GCC_WARN_UNDECLARED_SELECTOR = YES; 721 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 722 | GCC_WARN_UNUSED_FUNCTION = YES; 723 | GCC_WARN_UNUSED_VARIABLE = YES; 724 | MACOSX_DEPLOYMENT_TARGET = 10.10; 725 | MTL_ENABLE_DEBUG_INFO = NO; 726 | SDKROOT = macosx; 727 | }; 728 | name = Release; 729 | }; 730 | 46C02AEF1A82CBB0004DEA43 /* Debug */ = { 731 | isa = XCBuildConfiguration; 732 | buildSettings = { 733 | FRAMEWORK_SEARCH_PATHS = ( 734 | "$(inherited)", 735 | "$(PROJECT_DIR)/Frameworks", 736 | ); 737 | PRODUCT_NAME = "$(TARGET_NAME)"; 738 | }; 739 | name = Debug; 740 | }; 741 | 46C02AF01A82CBB0004DEA43 /* Release */ = { 742 | isa = XCBuildConfiguration; 743 | buildSettings = { 744 | FRAMEWORK_SEARCH_PATHS = ( 745 | "$(inherited)", 746 | "$(PROJECT_DIR)/Frameworks", 747 | ); 748 | PRODUCT_NAME = "$(TARGET_NAME)"; 749 | }; 750 | name = Release; 751 | }; 752 | 46C02B181A82D0B5004DEA43 /* Debug */ = { 753 | isa = XCBuildConfiguration; 754 | buildSettings = { 755 | FRAMEWORK_SEARCH_PATHS = ( 756 | "$(inherited)", 757 | "$(PROJECT_DIR)/Frameworks", 758 | ); 759 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 760 | GCC_PREFIX_HEADER = "xcconf_tests/SupportingFiles/xcconf_tests-Prefix.pch"; 761 | GCC_PREPROCESSOR_DEFINITIONS = ( 762 | "DEBUG=1", 763 | "$(inherited)", 764 | ); 765 | PRODUCT_NAME = "$(TARGET_NAME)"; 766 | }; 767 | name = Debug; 768 | }; 769 | 46C02B191A82D0B5004DEA43 /* Release */ = { 770 | isa = XCBuildConfiguration; 771 | buildSettings = { 772 | FRAMEWORK_SEARCH_PATHS = ( 773 | "$(inherited)", 774 | "$(PROJECT_DIR)/Frameworks", 775 | ); 776 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 777 | GCC_PREFIX_HEADER = "xcconf_tests/SupportingFiles/xcconf_tests-Prefix.pch"; 778 | PRODUCT_NAME = "$(TARGET_NAME)"; 779 | }; 780 | name = Release; 781 | }; 782 | /* End XCBuildConfiguration section */ 783 | 784 | /* Begin XCConfigurationList section */ 785 | 46C02AE21A82CBB0004DEA43 /* Build configuration list for PBXProject "xcconf" */ = { 786 | isa = XCConfigurationList; 787 | buildConfigurations = ( 788 | 46C02AEC1A82CBB0004DEA43 /* Debug */, 789 | 46C02AED1A82CBB0004DEA43 /* Release */, 790 | ); 791 | defaultConfigurationIsVisible = 0; 792 | defaultConfigurationName = Release; 793 | }; 794 | 46C02AEE1A82CBB0004DEA43 /* Build configuration list for PBXNativeTarget "xcconf" */ = { 795 | isa = XCConfigurationList; 796 | buildConfigurations = ( 797 | 46C02AEF1A82CBB0004DEA43 /* Debug */, 798 | 46C02AF01A82CBB0004DEA43 /* Release */, 799 | ); 800 | defaultConfigurationIsVisible = 0; 801 | defaultConfigurationName = Release; 802 | }; 803 | 46C02B171A82D0B5004DEA43 /* Build configuration list for PBXNativeTarget "xcconf_tests" */ = { 804 | isa = XCConfigurationList; 805 | buildConfigurations = ( 806 | 46C02B181A82D0B5004DEA43 /* Debug */, 807 | 46C02B191A82D0B5004DEA43 /* Release */, 808 | ); 809 | defaultConfigurationIsVisible = 0; 810 | defaultConfigurationName = Release; 811 | }; 812 | /* End XCConfigurationList section */ 813 | }; 814 | rootObject = 46C02ADF1A82CBB0004DEA43 /* Project object */; 815 | } 816 | -------------------------------------------------------------------------------- /xcconf.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /xcconf/Sources/CodeGen/XCCConfigurationCodeGenerator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by AlexDenisov on 06/02/15. 3 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @class XCCYAMLConfiguration; 9 | @class XCCDiagnosticsEngine; 10 | 11 | @interface XCCConfigurationCodeGenerator : NSObject 12 | 13 | @property (nonatomic, strong) XCCDiagnosticsEngine *diagnosticEngine; 14 | 15 | - (instancetype)initWithConfig:(XCCYAMLConfiguration *)config environmentName:(NSString *)environmentName; 16 | - (instancetype)initWithConfig:(XCCYAMLConfiguration *)config environmentName:(NSString *)environmentName secureMode:(BOOL)isSecureMode; 17 | - (instancetype)initWithConfig:(XCCYAMLConfiguration *)config environmentName:(NSString *)environmentName secureMode:(BOOL)isSecureMode paranoidMode:(BOOL)isParanoidMode; 18 | - (NSString *)generateCode; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /xcconf/Sources/CodeGen/XCCConfigurationCodeGenerator.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by AlexDenisov on 06/02/15. 3 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 4 | // 5 | 6 | #import "XCCConfigurationCodeGenerator.h" 7 | #import "XCCParametersCodeGeneratorProtocol.h" 8 | #import "XCCParametersCodeGenerator.h" 9 | #import "XCCSecureParametersCodeGenerator.h" 10 | #import "XCCSecureXORParametersCodeGenerator.h" 11 | #import "XCCYAMLConfiguration.h" 12 | #import "XCCDiagnosticsEngine.h" 13 | 14 | @interface XCCConfigurationCodeGenerator () 15 | 16 | @property (strong) XCCYAMLConfiguration *config; 17 | @property (copy) NSString *environmentName; 18 | @property BOOL secure; 19 | @property BOOL paranoid; 20 | 21 | @end 22 | 23 | @implementation XCCConfigurationCodeGenerator 24 | 25 | - (instancetype)initWithConfig:(XCCYAMLConfiguration *)config environmentName:(NSString *)environmentName { 26 | return [self initWithConfig:config environmentName:environmentName secureMode:NO]; 27 | } 28 | 29 | - (instancetype)initWithConfig:(XCCYAMLConfiguration *)config environmentName:(NSString *)environmentName secureMode:(BOOL)isSecureMode { 30 | return [self initWithConfig:config environmentName:environmentName secureMode:isSecureMode paranoidMode:NO]; 31 | } 32 | 33 | - (instancetype)initWithConfig:(XCCYAMLConfiguration *)config environmentName:(NSString *)environmentName secureMode:(BOOL)isSecureMode paranoidMode:(BOOL)isParanoidMode { 34 | self = [super init]; 35 | 36 | self.config = config; 37 | self.environmentName = environmentName; 38 | self.secure = isSecureMode; 39 | self.paranoid = isParanoidMode; 40 | 41 | return self; 42 | } 43 | 44 | 45 | - (NSString *)generateCode { 46 | NSMutableString *code = [NSMutableString new]; 47 | 48 | [code appendString:self.import]; 49 | [code appendString:self.interface]; 50 | [code appendString:self.implementation]; 51 | [code appendString:self.parameters]; 52 | [code appendString:self.end]; 53 | 54 | return [code copy]; 55 | } 56 | 57 | - (NSString *)parameters { 58 | XCCEnvironment *environment = self.config[self.environmentName]; 59 | if (!environment) { 60 | NSString *error = [NSString stringWithFormat:@"'%@' not found at config file", 61 | self.environmentName]; 62 | [self.diagnosticEngine criticalError:error]; 63 | } 64 | id codeGen = [self codeGenWithEnvironment:environment]; 65 | NSString *code = [codeGen generateCode]; 66 | if (code.length) { 67 | code = [code stringByAppendingString:@"\n"]; 68 | } 69 | 70 | return code; 71 | } 72 | 73 | - (id)codeGenWithEnvironment:(XCCEnvironment *)environment { 74 | if (self.secure) { 75 | return [[XCCSecureParametersCodeGenerator alloc] initWithEnvironment:environment]; 76 | } else if (self.paranoid) { 77 | return [[XCCSecureXORParametersCodeGenerator alloc] initWithEnvironment:environment]; 78 | } else { 79 | return [[XCCParametersCodeGenerator alloc] initWithEnvironment:environment]; 80 | } 81 | } 82 | 83 | - (NSString *)import { 84 | return @"#import \n"; 85 | } 86 | 87 | - (NSString *)interface { 88 | return [NSString stringWithFormat:@"@interface %@ : NSObject @end\n", self.config.principalClassName]; 89 | } 90 | 91 | - (NSString *)implementation { 92 | return [NSString stringWithFormat:@"@implementation %@\n", self.config.principalClassName]; 93 | } 94 | 95 | - (NSString *)end { 96 | return @"@end\n"; 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /xcconf/Sources/CodeGen/XCCParametersCodeGenerator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by AlexDenisov on 06/02/15. 3 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 4 | // 5 | 6 | #import 7 | #import "XCCParametersCodeGeneratorProtocol.h" 8 | 9 | @interface XCCParametersCodeGenerator : NSObject 10 | 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /xcconf/Sources/CodeGen/XCCParametersCodeGenerator.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by AlexDenisov on 06/02/15. 3 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 4 | // 5 | 6 | #import "XCCParametersCodeGenerator.h" 7 | #import "XCCEnvironment.h" 8 | 9 | @interface XCCParametersCodeGenerator () 10 | 11 | @property (strong) XCCEnvironment *environment; 12 | 13 | @end 14 | 15 | @implementation XCCParametersCodeGenerator 16 | 17 | - (instancetype)initWithEnvironment:(XCCEnvironment *)environment { 18 | self = [super init]; 19 | 20 | self.environment = environment; 21 | 22 | return self; 23 | } 24 | 25 | - (NSString *)generateCode { 26 | NSDictionary *parameters = self.environment.parameters; 27 | NSMutableArray *codeChunks = [NSMutableArray new]; 28 | 29 | if (self.environment.name) { 30 | NSString *environment = [self codeForValue:self.environment.name withKey:@"environment"]; 31 | [codeChunks addObject:environment]; 32 | } 33 | 34 | for (NSString *key in parameters.allKeys) { 35 | NSString *chunk = [self codeForValue:parameters[key] withKey:key]; 36 | [codeChunks addObject:chunk]; 37 | } 38 | return [codeChunks componentsJoinedByString:@"\n"]; 39 | } 40 | 41 | - (NSString *)codeForValue:(NSString *)value withKey:(NSString *)key { 42 | NSString *format = @"- (NSString *)%@ { return @\"%@\"; }"; 43 | NSString *method = [NSString stringWithFormat:format, key, value]; 44 | return method; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /xcconf/Sources/CodeGen/XCCParametersCodeGeneratorProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // XCCParametersCodeGeneratorProtocol.h 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 22/06/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XCCEnvironment; 12 | 13 | @protocol XCCParametersCodeGeneratorProtocol 14 | 15 | - (instancetype)initWithEnvironment:(XCCEnvironment *)environment; 16 | - (NSString *)generateCode; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /xcconf/Sources/CodeGen/XCCSecureParametersCodeGenerator.h: -------------------------------------------------------------------------------- 1 | // 2 | // XCCSecureParametersCodeGenerator.h 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 22/06/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "XCCParametersCodeGeneratorProtocol.h" 11 | 12 | @interface XCCSecureParametersCodeGenerator : NSObject 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /xcconf/Sources/CodeGen/XCCSecureParametersCodeGenerator.m: -------------------------------------------------------------------------------- 1 | // 2 | // XCCSecureParametersCodeGenerator.m 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 22/06/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import "XCCSecureParametersCodeGenerator.h" 10 | #import "XCCEnvironment.h" 11 | 12 | @interface XCCSecureParametersCodeGenerator () 13 | 14 | @property (strong) XCCEnvironment *environment; 15 | 16 | @end 17 | 18 | @implementation XCCSecureParametersCodeGenerator 19 | 20 | - (instancetype)initWithEnvironment:(XCCEnvironment *)environment { 21 | self = [super init]; 22 | 23 | self.environment = environment; 24 | 25 | return self; 26 | } 27 | 28 | - (NSString *)generateCode { 29 | NSDictionary *parameters = self.environment.parameters; 30 | NSMutableArray *codeChunks = [NSMutableArray new]; 31 | 32 | if (self.environment.name) { 33 | NSString *environment = [self codeForValue:self.environment.name withKey:@"environment"]; 34 | [codeChunks addObject:environment]; 35 | } 36 | 37 | for (NSString *key in parameters.allKeys) { 38 | NSString *chunk = [self codeForValue:parameters[key] withKey:key]; 39 | [codeChunks addObject:chunk]; 40 | } 41 | return [codeChunks componentsJoinedByString:@"\n"]; 42 | } 43 | 44 | - (NSString *)codeForValue:(NSString *)value withKey:(NSString *)key { 45 | NSString *format = @"- (NSString *)%@ { %@ }"; 46 | NSString *encryptedBody = [self encryptBody:value]; 47 | NSString *method = [NSString stringWithFormat:format, key, encryptedBody]; 48 | return method; 49 | } 50 | 51 | - (NSString *)encryptBody:(NSString *)value { 52 | const char *rawValue = value.UTF8String; 53 | const unsigned long valueLength = strlen(rawValue); 54 | 55 | NSMutableString *encryptedValue = [NSMutableString new]; 56 | for (unsigned long i = 0; i < valueLength; i++) { 57 | NSString *encryptedCharacter = [NSString stringWithFormat:@"s[%lu] = '%c'; ", i, rawValue[i]]; 58 | [encryptedValue appendString:encryptedCharacter]; 59 | } 60 | NSString *encryptedCharacter = [NSString stringWithFormat:@"s[%lu] = 0x00; ", valueLength]; 61 | [encryptedValue appendString:encryptedCharacter]; 62 | 63 | return [NSString stringWithFormat:@"char s[%lu]; %@return @(s);", valueLength + 1, encryptedValue]; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /xcconf/Sources/CodeGen/XCCSecureXORParametersCodeGenerator.h: -------------------------------------------------------------------------------- 1 | // 2 | // XCCSecureXORParametersCodeGenerator.h 3 | // xcconf 4 | // 5 | // Created by Aleksei Shevchenko on 06/07/15. 6 | // Copyright (c) 2015 Aleksei Shevchenko. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "XCCSecureParametersCodeGenerator.h" 11 | 12 | @interface XCCSecureXORParametersCodeGenerator : XCCSecureParametersCodeGenerator 13 | 14 | /** 15 | * cypherKey is optional, if not set, random key will be generated for each value 16 | **/ 17 | - (instancetype)initWithEnvironment:(XCCEnvironment *)environment cypherKey:(NSData*)cypherKey; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /xcconf/Sources/CodeGen/XCCSecureXORParametersCodeGenerator.m: -------------------------------------------------------------------------------- 1 | // 2 | // XCCSecureXORParametersCodeGenerator.m 3 | // xcconf 4 | // 5 | // Created by Aleksei Shevchenko on 06/07/15. 6 | // Copyright (c) 2015 Aleksei Shevchenko. All rights reserved. 7 | // 8 | 9 | #import "XCCSecureXORParametersCodeGenerator.h" 10 | #import "XCCEnvironment.h" 11 | #include 12 | #include 13 | 14 | @interface XCCSecureXORParametersCodeGenerator () 15 | ///Static cypher key, if not set, new key will be generated for each value 16 | @property (strong) NSData * cypherKey; 17 | @end 18 | 19 | @implementation XCCSecureXORParametersCodeGenerator 20 | 21 | - (instancetype)initWithEnvironment:(XCCEnvironment *)environment cypherKey:(NSData*)cypherKey{ 22 | self = [super initWithEnvironment:environment]; 23 | 24 | self.cypherKey = cypherKey; 25 | 26 | return self; 27 | } 28 | 29 | - (NSString *)codeForValue:(NSString *)value withKey:(NSString *)key { 30 | NSString *format = @"#pragma clang optimize off\n- (NSString *)%@ { %@ }"; 31 | NSString *encryptedBody = [self encryptBody:value]; 32 | NSString *method = [NSString stringWithFormat:format, key, encryptedBody]; 33 | return method; 34 | } 35 | 36 | 37 | - (NSString *)encryptBody:(NSString *)value { 38 | const char *rawValue = value.UTF8String; 39 | const unsigned long valueLength = strlen(rawValue); 40 | NSData * cypher = (self.cypherKey && self.cypherKey.length) ? self.cypherKey: [self generateCypherKey]; 41 | const char * cypherBytes = cypher.bytes; 42 | 43 | NSMutableString *encryptedValue = [NSMutableString new]; 44 | for (unsigned long i = 0; i < valueLength; i++) { 45 | const char cypherByte = *(cypherBytes + (i % cypher.length)); 46 | NSString *encryptedCharacter = [NSString stringWithFormat:@"s[%lu] = %luul ^ %luul; ", i, (unsigned long)rawValue[i]^cypherByte, (unsigned long)cypherByte]; 47 | [encryptedValue appendString:encryptedCharacter]; 48 | } 49 | NSString *encryptedCharacter = [NSString stringWithFormat:@"s[%lu] = 0x00; ", valueLength]; 50 | [encryptedValue appendString:encryptedCharacter]; 51 | 52 | return [NSString stringWithFormat:@"char s[%lu]; %@return @(s);", valueLength + 1, encryptedValue]; 53 | } 54 | 55 | - (NSData*) generateCypherKey { 56 | arc4random_stir(); 57 | const int cypherLength = 32; 58 | char iv[cypherLength]; 59 | arc4random_buf(&iv, cypherLength); 60 | return [[NSData alloc] initWithBytes:&iv length:cypherLength]; 61 | } 62 | 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /xcconf/Sources/Driver/XCCDiagnosticsEngine.h: -------------------------------------------------------------------------------- 1 | // 2 | // XCCDiagnosticsEngine.h 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 07/03/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XCCDiagnosticsEngine : NSObject 12 | 13 | - (void)criticalError:(NSString *)message; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /xcconf/Sources/Driver/XCCDiagnosticsEngine.m: -------------------------------------------------------------------------------- 1 | // 2 | // XCCDiagnosticsEngine.m 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 07/03/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import "XCCDiagnosticsEngine.h" 10 | 11 | @implementation XCCDiagnosticsEngine 12 | 13 | - (void)criticalError:(NSString *)message { 14 | printf("xcconf: %s\n", message.UTF8String); 15 | exit(1); 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /xcconf/Sources/Driver/XCCDriver.h: -------------------------------------------------------------------------------- 1 | // 2 | // XCCDriver.h 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 05/02/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XCCDiagnosticsEngine; 12 | @class XCCDriverOptions; 13 | 14 | @interface XCCDriver : NSObject 15 | 16 | @property (nonatomic, strong) XCCDiagnosticsEngine *diagnosticsEngine; 17 | 18 | - (instancetype)initWithOptions:(XCCDriverOptions *)options; 19 | 20 | - (void)generateAndSaveOutputFile; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /xcconf/Sources/Driver/XCCDriver.m: -------------------------------------------------------------------------------- 1 | // 2 | // XCCDriver.m 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 05/02/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import "XCCDriver.h" 10 | #import "XCCYAMLConfiguration.h" 11 | #import "XCCConfigurationParser.h" 12 | #import "XCCConfigurationCodeGenerator.h" 13 | #import "XCCDriverOptions.h" 14 | 15 | @interface XCCDriver () 16 | 17 | @property XCCDriverOptions *options; 18 | 19 | @end 20 | 21 | @implementation XCCDriver 22 | 23 | - (instancetype)initWithOptions:(XCCDriverOptions *)options { 24 | self = [super init]; 25 | 26 | self.options = options; 27 | 28 | return self; 29 | } 30 | 31 | - (void)generateAndSaveOutputFile { 32 | NSString *yaml = [NSString stringWithContentsOfFile:self.options.inputPath 33 | encoding:NSUTF8StringEncoding 34 | error:nil]; 35 | 36 | XCCConfigurationParser *parser = [XCCConfigurationParser new]; 37 | XCCYAMLConfiguration *configuration = [parser parseYAML:yaml]; 38 | 39 | XCCConfigurationCodeGenerator *codeGen = [[XCCConfigurationCodeGenerator alloc] initWithConfig:configuration 40 | environmentName:self.options.configurationName 41 | secureMode:self.options.isSecure 42 | paranoidMode:self.options.isParanoid]; 43 | codeGen.diagnosticEngine = self.diagnosticsEngine; 44 | NSString *code = [codeGen generateCode]; 45 | [code writeToFile:self.options.outputPath 46 | atomically:YES 47 | encoding:NSUTF8StringEncoding 48 | error:nil]; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /xcconf/Sources/Driver/XCCDriverOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // XCCDriverOptions.h 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 22/06/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface XCCDriverOptions : NSObject 12 | 13 | @property (copy) NSString *inputPath; 14 | @property (copy) NSString *outputPath; 15 | @property (copy) NSString *configurationName; 16 | @property BOOL isSecure; 17 | @property BOOL isParanoid; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /xcconf/Sources/Driver/XCCDriverOptions.m: -------------------------------------------------------------------------------- 1 | // 2 | // XCCDriverOptions.m 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 22/06/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import "XCCDriverOptions.h" 10 | 11 | @implementation XCCDriverOptions 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /xcconf/Sources/Driver/XCCDriverOptionsBuilder.h: -------------------------------------------------------------------------------- 1 | // 2 | // XCCDriverOptionsBuilder.h 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 22/06/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class XCCDriverOptions; 12 | @class XCCDiagnosticsEngine; 13 | 14 | @interface XCCDriverOptionsBuilder : NSObject 15 | 16 | @property XCCDiagnosticsEngine *diagnosticsEngine; 17 | 18 | - (XCCDriverOptions *)buildOptionsFromArgC:(const int)argc ArgV:(const char **)argv; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /xcconf/Sources/Driver/XCCDriverOptionsBuilder.m: -------------------------------------------------------------------------------- 1 | // 2 | // XCCDriverOptionsBuilder.m 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 22/06/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import "XCCDriverOptionsBuilder_Internal.h" 10 | #import "XCCDiagnosticsEngine.h" 11 | #import "XCCDriverOptions.h" 12 | 13 | @implementation XCCDriverOptionsBuilder 14 | 15 | - (NSString *)getEnvVariable:(NSString *)key { 16 | NSString *variable = @(getenv(key.UTF8String) ?: ""); 17 | if (!variable.length) { 18 | NSString *errMsg = [NSString stringWithFormat:@"%@ not found", key]; 19 | [self.diagnosticsEngine criticalError:errMsg]; 20 | } 21 | return variable; 22 | } 23 | 24 | - (NSString *)inputFile { 25 | return [self getEnvVariable:@"INPUT_FILE_PATH"]; 26 | } 27 | 28 | - (NSString *)outputFile { 29 | return [self getEnvVariable:@"SCRIPT_OUTPUT_FILE_0"]; 30 | } 31 | 32 | - (NSString *)configurationName { 33 | return [self getEnvVariable:@"CONFIGURATION"]; 34 | } 35 | 36 | - (BOOL)isSecure { 37 | return NO; 38 | } 39 | 40 | - (XCCDriverOptions *)buildOptionsFromArgC:(const int)argc ArgV:(const char **)argv { 41 | BOOL secure = NO; 42 | BOOL paranoid = NO; 43 | if (argc == 2) { 44 | secure = strcmp(argv[1], "secure") == 0; 45 | paranoid = strcmp(argv[1], "paranoid") == 0; 46 | } 47 | XCCDriverOptions *options = [XCCDriverOptions new]; 48 | options.isSecure = secure; 49 | options.isParanoid = paranoid; 50 | options.inputPath = [self inputFile]; 51 | options.outputPath = [self outputFile]; 52 | options.configurationName = [self configurationName]; 53 | 54 | return options; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /xcconf/Sources/Driver/XCCDriverOptionsBuilder_Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // XCCDriverOptionsBuilder_Internal.h 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 22/06/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import "XCCDriverOptionsBuilder.h" 10 | 11 | @interface XCCDriverOptionsBuilder () 12 | 13 | - (NSString *)inputFile; 14 | - (NSString *)outputFile; 15 | - (NSString *)configurationName; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /xcconf/Sources/Models/XCCEnvironment.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by AlexDenisov on 05/02/15. 3 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @interface XCCEnvironment : NSObject 9 | 10 | @property (copy, readonly) NSString *name; 11 | @property (copy, readonly) NSDictionary *parameters; 12 | 13 | - (instancetype)initWithName:(NSString *)name parameters:(NSDictionary *)parameters; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /xcconf/Sources/Models/XCCEnvironment.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by AlexDenisov on 05/02/15. 3 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 4 | // 5 | 6 | #import "XCCEnvironment.h" 7 | 8 | @interface XCCEnvironment () 9 | 10 | @property (copy) NSString *name; 11 | @property (copy) NSDictionary *parameters; 12 | 13 | @end 14 | 15 | @implementation XCCEnvironment 16 | 17 | - (instancetype)initWithName:(NSString *)name parameters:(NSDictionary *)parameters { 18 | self = [super init]; 19 | 20 | self.name = name; 21 | self.parameters = parameters; 22 | 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /xcconf/Sources/Models/XCCYAMLConfiguration.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by AlexDenisov on 04/02/15. 3 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @class XCCEnvironment; 9 | 10 | @interface XCCYAMLConfiguration : NSObject 11 | 12 | @property (copy, readonly) NSString *principalClassName; 13 | @property (copy, readonly) NSArray *environments; 14 | 15 | - (instancetype)initWithPrincipalClassName:(NSString *)name environments:(NSArray *)environments NS_DESIGNATED_INITIALIZER; 16 | - (XCCEnvironment *)objectForKeyedSubscript:(NSString *)key; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /xcconf/Sources/Models/XCCYAMLConfiguration.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by AlexDenisov on 04/02/15. 3 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 4 | // 5 | 6 | #import "XCCYAMLConfiguration.h" 7 | #import "XCCEnvironment.h" 8 | 9 | @interface XCCYAMLConfiguration () 10 | 11 | @property (copy) NSString *principalClassName; 12 | @property (copy) NSArray *environments; 13 | 14 | @end 15 | 16 | @implementation XCCYAMLConfiguration 17 | 18 | - (instancetype)initWithPrincipalClassName:(NSString *)name environments:(NSArray *)environments { 19 | self = [super init]; 20 | 21 | self.principalClassName = name; 22 | self.environments = environments; 23 | 24 | return self; 25 | } 26 | 27 | - (XCCEnvironment *)objectForKeyedSubscript:(NSString *)key { 28 | for (XCCEnvironment *environment in self.environments) { 29 | if ([environment.name isEqualToString:key]) { 30 | return environment; 31 | } 32 | } 33 | 34 | return nil; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /xcconf/Sources/Parser/XCCConfigurationParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by AlexDenisov on 04/02/15. 3 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | @class XCCYAMLConfiguration; 9 | @class XCCDiagnosticsEngine; 10 | 11 | @interface XCCConfigurationParser : NSObject 12 | 13 | @property (nonatomic, strong) XCCDiagnosticsEngine *diagnosticsEngine; 14 | 15 | - (XCCYAMLConfiguration *)parseYAML:(NSString *)yaml; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /xcconf/Sources/Parser/XCCConfigurationParser.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by AlexDenisov on 04/02/15. 3 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 4 | // 5 | 6 | #import "XCCConfigurationParser.h" 7 | #import "XCCYAMLConfiguration.h" 8 | #import "XCCEnvironment.h" 9 | #import "XCCDiagnosticsEngine.h" 10 | 11 | #import 12 | 13 | @implementation XCCConfigurationParser 14 | 15 | - (XCCYAMLConfiguration *)parseYAML:(NSString *)yaml { 16 | NSError *error; 17 | NSDictionary *rawConfig = [YAMLSerialization objectWithYAMLString:yaml 18 | options:kYAMLReadOptionStringScalars 19 | error:&error]; 20 | 21 | if (error) { 22 | NSString *message = [NSString stringWithFormat:@"Cannot read YAML file: %@", error]; 23 | [self.diagnosticsEngine criticalError:message]; 24 | } 25 | 26 | NSString *className = rawConfig[@"principalClass"]; 27 | if (!className) { 28 | [self.diagnosticsEngine criticalError:@"principalClass not found"]; 29 | } 30 | 31 | if (!className.length) { 32 | [self.diagnosticsEngine criticalError:@"principalClass can not be empty"]; 33 | } 34 | 35 | NSArray *environments = [self environmentsFromDictionary:rawConfig]; 36 | 37 | XCCYAMLConfiguration *config = [[XCCYAMLConfiguration alloc] initWithPrincipalClassName:className 38 | environments:environments]; 39 | 40 | return config; 41 | } 42 | 43 | - (NSArray *)environmentsFromDictionary:(NSDictionary *)dictionary { 44 | NSMutableArray *environments = [NSMutableArray new]; 45 | for (NSString *key in [dictionary allKeys]) { 46 | if ([key isEqualToString:@"principalClass"]) { 47 | continue; 48 | } 49 | 50 | XCCEnvironment *environment = [[XCCEnvironment alloc] initWithName:key 51 | parameters:dictionary[key]]; 52 | 53 | [environments addObject:environment]; 54 | } 55 | 56 | return environments; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /xcconf/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // xcconf 4 | // 5 | // Created by AlexDenisov on 04/02/15. 6 | // Copyright (c) 2015 AlexDenisov. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "XCCDriver.h" 11 | #import "XCCDiagnosticsEngine.h" 12 | #import "XCCDriverOptionsBuilder.h" 13 | 14 | int main(int argc, const char * argv[]) { 15 | @autoreleasepool { 16 | XCCDiagnosticsEngine *diag = [XCCDiagnosticsEngine new]; 17 | 18 | XCCDriverOptionsBuilder *builder = [XCCDriverOptionsBuilder new]; 19 | builder.diagnosticsEngine = diag; 20 | XCCDriverOptions *options = [builder buildOptionsFromArgC:argc ArgV:argv]; 21 | 22 | XCCDriver *driver = [[XCCDriver alloc] initWithOptions:options]; 23 | driver.diagnosticsEngine = diag; 24 | 25 | [driver generateAndSaveOutputFile]; 26 | } 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /xcconf_tests/Fixtures/Valid.yaml: -------------------------------------------------------------------------------- 1 | principalClass: XCCPrincipalClass 2 | 3 | Debug: &Debug 4 | serverAddress: https://fooo-bar.buzz 5 | APIKey: qwe123!!qwe 6 | 7 | Release: 8 | serverAddress: https://prod.fooo-bar.buzz 9 | APIKey: qwe123qwe 10 | 11 | DebugCopy: *Debug 12 | -------------------------------------------------------------------------------- /xcconf_tests/Specs/CodeGen/XCCConfigurationCodeGeneratorSpec.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "XCCConfigurationCodeGenerator.h" 3 | #import "XCCYAMLConfiguration.h" 4 | #import "XCCEnvironment.h" 5 | 6 | using namespace Cedar::Matchers; 7 | using namespace Cedar::Doubles; 8 | 9 | SPEC_BEGIN(XCCConfigurationCodeGeneratorSpec) 10 | 11 | describe(@"XCCConfigurationCodeGenerator", ^{ 12 | __block XCCConfigurationCodeGenerator *subject; 13 | 14 | beforeEach(^{ 15 | subject = [XCCConfigurationCodeGenerator new]; 16 | }); 17 | 18 | describe(@"has method", ^{ 19 | 20 | it(@"initWithConfig:environmentName:", ^{ 21 | subject should respond_to(@selector(initWithConfig:environmentName:)); 22 | }); 23 | 24 | it(@"generateCode", ^{ 25 | subject should respond_to(@selector(generateCode)); 26 | }); 27 | 28 | }); 29 | 30 | describe(@"generateCode generates code", ^{ 31 | 32 | context(@"non-secure", ^{ 33 | 34 | it(@"without environments", ^{ 35 | XCCYAMLConfiguration *config = [[XCCYAMLConfiguration alloc] initWithPrincipalClassName:@"Configuration" 36 | environments:nil]; 37 | subject = [[XCCConfigurationCodeGenerator alloc] initWithConfig:config environmentName:@"Debug"]; 38 | 39 | NSString *expectedCode = @"#import \n" 40 | @"@interface Configuration : NSObject @end\n" 41 | @"@implementation Configuration\n" 42 | @"@end\n"; 43 | NSString *actualCode = [subject generateCode]; 44 | 45 | actualCode should equal(expectedCode); 46 | }); 47 | 48 | it(@"with environment", ^{ 49 | NSDictionary *debugParameters = @{ @"debugKey" : @"debugValue" }; 50 | XCCEnvironment *debug = [[XCCEnvironment alloc] initWithName:@"Debug" 51 | parameters:debugParameters]; 52 | 53 | NSDictionary *releaseParameters = @{ @"releaseKey" : @"releaseValue" }; 54 | XCCEnvironment *release = [[XCCEnvironment alloc] initWithName:@"Release" 55 | parameters:releaseParameters]; 56 | 57 | NSArray *environments = @[ debug, release ]; 58 | 59 | XCCYAMLConfiguration *config = [[XCCYAMLConfiguration alloc] initWithPrincipalClassName:@"Configuration" 60 | environments:environments]; 61 | subject = [[XCCConfigurationCodeGenerator alloc] initWithConfig:config environmentName:@"Debug"]; 62 | 63 | NSString *expectedCode = @"#import \n" 64 | @"@interface Configuration : NSObject @end\n" 65 | @"@implementation Configuration\n" 66 | @"- (NSString *)environment { return @\"Debug\"; }\n" 67 | @"- (NSString *)debugKey { return @\"debugValue\"; }\n" 68 | @"@end\n"; 69 | NSString *actualCode = [subject generateCode]; 70 | 71 | actualCode should equal(expectedCode); 72 | }); 73 | 74 | }); 75 | 76 | context(@"secure", ^{ 77 | 78 | it(@"without environments", ^{ 79 | XCCYAMLConfiguration *config = [[XCCYAMLConfiguration alloc] initWithPrincipalClassName:@"Configuration" 80 | environments:nil]; 81 | subject = [[XCCConfigurationCodeGenerator alloc] initWithConfig:config environmentName:@"Debug" secureMode:YES]; 82 | 83 | NSString *expectedCode = @"#import \n" 84 | @"@interface Configuration : NSObject @end\n" 85 | @"@implementation Configuration\n" 86 | @"@end\n"; 87 | NSString *actualCode = [subject generateCode]; 88 | 89 | actualCode should equal(expectedCode); 90 | }); 91 | 92 | it(@"with environment", ^{ 93 | NSDictionary *debugParameters = @{ @"debugKey" : @"debugValue" }; 94 | XCCEnvironment *debug = [[XCCEnvironment alloc] initWithName:@"Debug" 95 | parameters:debugParameters]; 96 | 97 | NSDictionary *releaseParameters = @{ @"releaseKey" : @"releaseValue" }; 98 | XCCEnvironment *release = [[XCCEnvironment alloc] initWithName:@"Release" 99 | parameters:releaseParameters]; 100 | 101 | NSArray *environments = @[ debug, release ]; 102 | 103 | XCCYAMLConfiguration *config = [[XCCYAMLConfiguration alloc] initWithPrincipalClassName:@"Configuration" 104 | environments:environments]; 105 | subject = [[XCCConfigurationCodeGenerator alloc] initWithConfig:config environmentName:@"Debug" secureMode:YES]; 106 | 107 | NSString *expectedCode = @"#import \n" 108 | @"@interface Configuration : NSObject @end\n" 109 | @"@implementation Configuration\n" 110 | @"- (NSString *)environment { char s[6]; s[0] = 'D'; s[1] = 'e'; s[2] = 'b'; s[3] = 'u'; s[4] = 'g'; s[5] = 0x00; return @(s); }\n" 111 | @"- (NSString *)debugKey { char s[11]; s[0] = 'd'; s[1] = 'e'; s[2] = 'b'; s[3] = 'u'; s[4] = 'g'; s[5] = 'V'; s[6] = 'a'; s[7] = 'l'; s[8] = 'u'; s[9] = 'e'; s[10] = 0x00; return @(s); }\n" 112 | @"@end\n"; 113 | NSString *actualCode = [subject generateCode]; 114 | 115 | actualCode should equal(expectedCode); 116 | }); 117 | 118 | }); 119 | 120 | 121 | }); 122 | 123 | }); 124 | 125 | SPEC_END 126 | -------------------------------------------------------------------------------- /xcconf_tests/Specs/CodeGen/XCCParameterCodeGeneratorSpec.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "XCCParametersCodeGenerator.h" 3 | #import "XCCEnvironment.h" 4 | 5 | using namespace Cedar::Matchers; 6 | using namespace Cedar::Doubles; 7 | 8 | static XCCEnvironment *environmentWithParameters(NSDictionary *parameters) { 9 | NSString *name = @"some_name"; 10 | XCCEnvironment *environment = [[XCCEnvironment alloc] initWithName:name 11 | parameters:parameters]; 12 | return environment; 13 | } 14 | 15 | SPEC_BEGIN(XCCParameterCodeGeneratorSpec) 16 | 17 | describe(@"XCCParametersCodeGenerator", ^{ 18 | __block XCCParametersCodeGenerator *subject; 19 | 20 | beforeEach(^{ 21 | subject = [XCCParametersCodeGenerator new]; 22 | }); 23 | 24 | describe(@"has method", ^{ 25 | 26 | it(@"initWithEnvironment:", ^{ 27 | subject should respond_to(@selector(initWithEnvironment:)); 28 | }); 29 | 30 | it(@"generateCode", ^{ 31 | subject should respond_to(@selector(generateCode)); 32 | }); 33 | 34 | }); 35 | 36 | describe(@"emits code", ^{ 37 | 38 | it(@"with one parmeter", ^{ 39 | auto parameters = @{ @"key" : @"value" }; 40 | auto env = environmentWithParameters(parameters); 41 | subject = [[XCCParametersCodeGenerator alloc] initWithEnvironment:env]; 42 | 43 | NSString *expectedCode = @"- \(NSString *)environment { return @\"some_name\"; }\n" 44 | @"- \(NSString *)key { return @\"value\"; }"; 45 | NSString *actualCode = [subject generateCode]; 46 | 47 | actualCode should equal(expectedCode); 48 | }); 49 | 50 | it(@"with multiple parameters", ^{ 51 | auto parameters = @{ @"key0" : @"value0", @"key1" : @"value1" }; 52 | auto env = environmentWithParameters(parameters); 53 | subject = [[XCCParametersCodeGenerator alloc] initWithEnvironment:env]; 54 | 55 | NSString *expectedCode = @"- (NSString *)environment { return @\"some_name\"; }\n" 56 | @"- (NSString *)key1 { return @\"value1\"; }\n" 57 | @"- (NSString *)key0 { return @\"value0\"; }"; 58 | NSString *actualCode = [subject generateCode]; 59 | 60 | actualCode should equal(expectedCode); 61 | }); 62 | 63 | }); 64 | 65 | }); 66 | 67 | SPEC_END 68 | -------------------------------------------------------------------------------- /xcconf_tests/Specs/CodeGen/XCCSecureParametersCodeGeneratorSpec.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "XCCSecureParametersCodeGenerator.h" 3 | #import "XCCEnvironment.h" 4 | 5 | using namespace Cedar::Matchers; 6 | using namespace Cedar::Doubles; 7 | 8 | static XCCEnvironment *environmentWithParameters(NSDictionary *parameters) { 9 | NSString *name = @"some_name"; 10 | XCCEnvironment *environment = [[XCCEnvironment alloc] initWithName:name 11 | parameters:parameters]; 12 | return environment; 13 | } 14 | 15 | SPEC_BEGIN(XCCSecureParametersCodeGeneratorSpec) 16 | 17 | describe(@"XCCSecureParametersCodeGenerator", ^{ 18 | __block XCCSecureParametersCodeGenerator *subject; 19 | 20 | describe(@"emits code", ^{ 21 | 22 | it(@"with one parmeter", ^{ 23 | auto parameters = @{ @"key" : @"value" }; 24 | auto env = environmentWithParameters(parameters); 25 | subject = [[XCCSecureParametersCodeGenerator alloc] initWithEnvironment:env]; 26 | 27 | NSString *expectedCode = 28 | @"- \(NSString *)environment { char s[10]; s[0] = 's'; s[1] = 'o'; s[2] = 'm'; s[3] = 'e'; s[4] = '_'; s[5] = 'n'; s[6] = 'a'; s[7] = 'm'; s[8] = 'e'; s[9] = 0x00; return @(s); }\n" 29 | @"- \(NSString *)key { char s[6]; s[0] = 'v'; s[1] = 'a'; s[2] = 'l'; s[3] = 'u'; s[4] = 'e'; s[5] = 0x00; return @(s); }"; 30 | NSString *actualCode = [subject generateCode]; 31 | 32 | actualCode should equal(expectedCode); 33 | }); 34 | 35 | it(@"with multiple parameters", ^{ 36 | auto parameters = @{ @"key0" : @"value0", @"key1" : @"value1" }; 37 | auto env = environmentWithParameters(parameters); 38 | subject = [[XCCSecureParametersCodeGenerator alloc] initWithEnvironment:env]; 39 | 40 | NSString *expectedCode = 41 | @"- (NSString *)environment { char s[10]; s[0] = 's'; s[1] = 'o'; s[2] = 'm'; s[3] = 'e'; s[4] = '_'; s[5] = 'n'; s[6] = 'a'; s[7] = 'm'; s[8] = 'e'; s[9] = 0x00; return @(s); }\n" 42 | @"- (NSString *)key1 { char s[7]; s[0] = 'v'; s[1] = 'a'; s[2] = 'l'; s[3] = 'u'; s[4] = 'e'; s[5] = '1'; s[6] = 0x00; return @(s); }\n" 43 | @"- (NSString *)key0 { char s[7]; s[0] = 'v'; s[1] = 'a'; s[2] = 'l'; s[3] = 'u'; s[4] = 'e'; s[5] = '0'; s[6] = 0x00; return @(s); }"; 44 | NSString *actualCode = [subject generateCode]; 45 | 46 | actualCode should equal(expectedCode); 47 | }); 48 | 49 | }); 50 | }); 51 | 52 | SPEC_END 53 | -------------------------------------------------------------------------------- /xcconf_tests/Specs/CodeGen/XCCSecureXORParametersCodeGeneratorSpec.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "XCCSecureXORParametersCodeGenerator.h" 3 | #import "XCCEnvironment.h" 4 | 5 | using namespace Cedar::Matchers; 6 | using namespace Cedar::Doubles; 7 | 8 | static XCCEnvironment *environmentWithParameters(NSDictionary *parameters) { 9 | NSString *name = @"some_name"; 10 | XCCEnvironment *environment = [[XCCEnvironment alloc] initWithName:name 11 | parameters:parameters]; 12 | return environment; 13 | } 14 | 15 | SPEC_BEGIN(XCCSecureXORParametersCodeGeneratorSpec) 16 | 17 | describe(@"XCCSecureXORParametersCodeGenerator", ^{ 18 | __block XCCSecureXORParametersCodeGenerator *subject; 19 | 20 | describe(@"emits code", ^{ 21 | 22 | it(@"with one parmeter", ^{ 23 | auto parameters = @{ @"key" : @"value" }; 24 | auto env = environmentWithParameters(parameters); 25 | NSData * cypher = [@"secret_key" dataUsingEncoding:NSUTF8StringEncoding]; 26 | subject = [[XCCSecureXORParametersCodeGenerator alloc] initWithEnvironment:env cypherKey:cypher]; 27 | 28 | NSString *expectedCode = 29 | @"#pragma clang optimize off\n- \(NSString *)environment { char s[10]; s[0] = 0ul ^ 115ul; s[1] = 10ul ^ 101ul; s[2] = 14ul ^ 99ul; s[3] = 23ul ^ 114ul; s[4] = 58ul ^ 101ul; s[5] = 26ul ^ 116ul; s[6] = 62ul ^ 95ul; s[7] = 6ul ^ 107ul; s[8] = 0ul ^ 101ul; s[9] = 0x00; return @(s); }\n" 30 | @"#pragma clang optimize off\n- \(NSString *)key { char s[6]; s[0] = 5ul ^ 115ul; s[1] = 4ul ^ 101ul; s[2] = 15ul ^ 99ul; s[3] = 7ul ^ 114ul; s[4] = 0ul ^ 101ul; s[5] = 0x00; return @(s); }"; 31 | NSString *actualCode = [subject generateCode]; 32 | 33 | actualCode should equal(expectedCode); 34 | }); 35 | 36 | it(@"with multiple parameters", ^{ 37 | auto parameters = @{ @"key0" : @"value0", @"key1" : @"value1" }; 38 | auto env = environmentWithParameters(parameters); 39 | NSData * cypher = [@"another_secret_key" dataUsingEncoding:NSUTF8StringEncoding]; 40 | subject = [[XCCSecureXORParametersCodeGenerator alloc] initWithEnvironment:env cypherKey:cypher]; 41 | 42 | NSString *expectedCode = 43 | @"#pragma clang optimize off\n- (NSString *)environment { char s[10]; s[0] = 18ul ^ 97ul; s[1] = 1ul ^ 110ul; s[2] = 2ul ^ 111ul; s[3] = 17ul ^ 116ul; s[4] = 55ul ^ 104ul; s[5] = 11ul ^ 101ul; s[6] = 19ul ^ 114ul; s[7] = 50ul ^ 95ul; s[8] = 22ul ^ 115ul; s[9] = 0x00; return @(s); }\n" 44 | "#pragma clang optimize off\n- (NSString *)key1 { char s[7]; s[0] = 23ul ^ 97ul; s[1] = 15ul ^ 110ul; s[2] = 3ul ^ 111ul; s[3] = 1ul ^ 116ul; s[4] = 13ul ^ 104ul; s[5] = 84ul ^ 101ul; s[6] = 0x00; return @(s); }\n" 45 | "#pragma clang optimize off\n- (NSString *)key0 { char s[7]; s[0] = 23ul ^ 97ul; s[1] = 15ul ^ 110ul; s[2] = 3ul ^ 111ul; s[3] = 1ul ^ 116ul; s[4] = 13ul ^ 104ul; s[5] = 85ul ^ 101ul; s[6] = 0x00; return @(s); }"; 46 | NSString *actualCode = [subject generateCode]; 47 | 48 | actualCode should equal(expectedCode); 49 | }); 50 | 51 | }); 52 | }); 53 | 54 | SPEC_END 55 | -------------------------------------------------------------------------------- /xcconf_tests/Specs/Driver/XCCDriverOptionsBuilderSpec.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "XCCDriverOptionsBuilder_Internal.h" 3 | #import "XCCDiagnosticsEngine.h" 4 | #import "XCCDriverOptions.h" 5 | 6 | using namespace Cedar::Matchers; 7 | using namespace Cedar::Doubles; 8 | 9 | SPEC_BEGIN(XCCDriverOptionsBuilderSpec) 10 | 11 | describe(@"XCCDriverOptionsBuilder", ^{ 12 | __block XCCDriverOptionsBuilder *subject; 13 | 14 | beforeEach(^{ 15 | subject = [XCCDriverOptionsBuilder new]; 16 | }); 17 | 18 | context(@"envirnoment", ^{ 19 | 20 | describe(@"diagnostics", ^{ 21 | __block id diagMock = nil; 22 | 23 | beforeEach(^{ 24 | diagMock = nice_fake_for(XCCDiagnosticsEngine.class); 25 | subject.diagnosticsEngine = diagMock; 26 | }); 27 | 28 | it(@"inputFile", ^{ 29 | [subject inputFile]; 30 | diagMock should have_received(@selector(criticalError:)).with(@"INPUT_FILE_PATH not found"); 31 | }); 32 | 33 | it(@"outputFile", ^{ 34 | [subject outputFile]; 35 | diagMock should have_received(@selector(criticalError:)).with(@"SCRIPT_OUTPUT_FILE_0 not found"); 36 | }); 37 | 38 | it(@"configurationName", ^{ 39 | [subject configurationName]; 40 | diagMock should have_received(@selector(criticalError:)).with(@"CONFIGURATION not found"); 41 | }); 42 | 43 | }); 44 | 45 | describe(@"loads env variables", ^{ 46 | 47 | it(@"inputFile", ^{ 48 | setenv("INPUT_FILE_PATH", "some_file.yaml", 1); 49 | [subject inputFile] should equal(@"some_file.yaml"); 50 | }); 51 | 52 | it(@"outputFile", ^{ 53 | setenv("SCRIPT_OUTPUT_FILE_0", "some_file.m", 1); 54 | [subject outputFile] should equal(@"some_file.m"); 55 | }); 56 | 57 | it(@"configurationName", ^{ 58 | setenv("CONFIGURATION", "Production", 1); 59 | [subject configurationName] should equal(@"Production"); 60 | }); 61 | 62 | }); 63 | 64 | }); 65 | 66 | context(@"command line arguments", ^{ 67 | __block XCCDriverOptions *options = nil; 68 | 69 | describe(@"isSecure", ^{ 70 | 71 | it(@"true", ^{ 72 | const char *argv[] = { "progname", "secure" }; 73 | options = [subject buildOptionsFromArgC:2 ArgV:argv]; 74 | options.isSecure should be_truthy; 75 | }); 76 | 77 | it(@"false", ^{ 78 | const char *argv[] = { "progname", "nonsecure" }; 79 | options = [subject buildOptionsFromArgC:2 ArgV:argv]; 80 | options.isSecure should be_falsy; 81 | }); 82 | 83 | }); 84 | 85 | it(@"inputPath", ^{ 86 | const char *dummyArgv[] = { "progname" }; 87 | setenv("INPUT_FILE_PATH", "some_file.yaml", 1); 88 | options = [subject buildOptionsFromArgC:1 ArgV:dummyArgv]; 89 | 90 | options.inputPath should equal(@"some_file.yaml"); 91 | }); 92 | 93 | it(@"outputPath", ^{ 94 | const char *dummyArgv[] = { "progname" }; 95 | setenv("SCRIPT_OUTPUT_FILE_0", "some_file.m", 1); 96 | options = [subject buildOptionsFromArgC:1 ArgV:dummyArgv]; 97 | 98 | options.outputPath should equal(@"some_file.m"); 99 | }); 100 | 101 | it(@"configurationName", ^{ 102 | const char *dummyArgv[] = { "progname" }; 103 | setenv("CONFIGURATION", "Production", 1); 104 | options = [subject buildOptionsFromArgC:1 ArgV:dummyArgv]; 105 | 106 | options.configurationName should equal(@"Production"); 107 | }); 108 | 109 | }); 110 | 111 | }); 112 | 113 | SPEC_END 114 | -------------------------------------------------------------------------------- /xcconf_tests/Specs/Models/XCCEnvironmentSpec.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "XCCEnvironment.h" 3 | 4 | using namespace Cedar::Matchers; 5 | using namespace Cedar::Doubles; 6 | 7 | SPEC_BEGIN(XCCEnvironmentSpec) 8 | 9 | describe(@"XCCEnvironment", ^{ 10 | __block XCCEnvironment *subject; 11 | 12 | beforeEach(^{ 13 | subject = [XCCEnvironment new]; 14 | }); 15 | 16 | describe(@"has method", ^{ 17 | 18 | it(@"initWithName:parameters:", ^{ 19 | subject should respond_to(@selector(initWithName:parameters:)); 20 | }); 21 | 22 | it(@"name", ^{ 23 | subject should respond_to(@selector(name)); 24 | }); 25 | 26 | it(@"parameters", ^{ 27 | subject should respond_to(@selector(parameters)); 28 | }); 29 | 30 | }); 31 | 32 | }); 33 | 34 | SPEC_END 35 | -------------------------------------------------------------------------------- /xcconf_tests/Specs/Models/XCCYAMLConfigurationSpec.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "XCCYAMLConfiguration.h" 3 | 4 | using namespace Cedar::Matchers; 5 | using namespace Cedar::Doubles; 6 | 7 | SPEC_BEGIN(XCCYAMLConfigurationSpec) 8 | 9 | describe(@"XCCYAMLConfiguration", ^{ 10 | __block XCCYAMLConfiguration *subject; 11 | 12 | beforeEach(^{ 13 | subject = [XCCYAMLConfiguration new]; 14 | }); 15 | 16 | describe(@"has method", ^{ 17 | 18 | it(@"initWithPrincipalClassName:environments:", ^{ 19 | subject should respond_to(@selector(initWithPrincipalClassName:environments:)); 20 | }); 21 | 22 | it(@"principalClass", ^{ 23 | subject should respond_to(@selector(principalClassName)); 24 | }); 25 | 26 | it(@"environments", ^{ 27 | subject should respond_to(@selector(environments)); 28 | }); 29 | 30 | it(@"objectForKeyedSubscript", ^{ 31 | subject[@"key"] should be_nil; 32 | }); 33 | 34 | }); 35 | 36 | }); 37 | 38 | SPEC_END 39 | -------------------------------------------------------------------------------- /xcconf_tests/Specs/Parser/XCCConfigurationParserSpec.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "XCCConfigurationParser.h" 3 | #import "XCCYAMLConfiguration.h" 4 | #import "XCCEnvironment.h" 5 | 6 | using namespace Cedar::Matchers; 7 | using namespace Cedar::Doubles; 8 | 9 | SPEC_BEGIN(XCCConfigurationParserSpec) 10 | 11 | describe(@"XCCConfigurationParser", ^{ 12 | __block XCCConfigurationParser *subject; 13 | 14 | beforeEach(^{ 15 | subject = [XCCConfigurationParser new]; 16 | }); 17 | 18 | describe(@"has method", ^{ 19 | 20 | it(@"parseYAML:", ^{ 21 | subject should respond_to(@selector(parseYAML:)); 22 | }); 23 | 24 | }); 25 | 26 | describe(@"parseYAML:", ^{ 27 | __block XCCYAMLConfiguration *config; 28 | 29 | context(@"valid YAML", ^{ 30 | 31 | beforeEach(^{ 32 | NSString *yamlPath = [[NSBundle mainBundle] pathForResource:@"Valid" 33 | ofType:@"yaml"]; 34 | NSString *yaml = [NSString stringWithContentsOfFile:yamlPath 35 | encoding:NSUTF8StringEncoding 36 | error:nil]; 37 | config = [subject parseYAML:yaml]; 38 | }); 39 | 40 | describe(@"returns XCCYAMLConfiguration", ^{ 41 | 42 | it(@"with principalClassName", ^{ 43 | config.principalClassName should equal(@"XCCPrincipalClass"); 44 | }); 45 | 46 | it(@"with environments", ^{ 47 | config.environments should_not be_nil; 48 | }); 49 | 50 | describe(@"with XCCEnvironment", ^{ 51 | __block XCCEnvironment *env; 52 | 53 | beforeEach(^{ 54 | env = config[@"DebugCopy"]; 55 | }); 56 | 57 | it(@"name", ^{ 58 | env.name should equal(@"DebugCopy"); 59 | }); 60 | 61 | describe(@"parameters", ^{ 62 | 63 | it(@"with serverAddress", ^{ 64 | env.parameters[@"serverAddress"] should equal(@"https://fooo-bar.buzz"); 65 | }); 66 | 67 | it(@"with APIKey", ^{ 68 | env.parameters[@"APIKey"] should equal(@"qwe123!!qwe"); 69 | }); 70 | 71 | }); 72 | 73 | }); 74 | 75 | }); 76 | 77 | }); 78 | 79 | }); 80 | 81 | }); 82 | 83 | SPEC_END 84 | -------------------------------------------------------------------------------- /xcconf_tests/SupportingFiles/Rakefile: -------------------------------------------------------------------------------- 1 | require 'pathname' 2 | 3 | module CedarTargetxcconf_tests 4 | SPECS_TARGET_NAME = "xcconf_tests" 5 | CONFIGURATION = "Release" 6 | 7 | PROJECT_ROOT = Pathname.new(File.dirname(__FILE__)).parent.to_s 8 | BUILD_DIR = File.join(PROJECT_ROOT, "build") 9 | 10 | FileUtils.mkdir_p(File.join(BUILD_DIR, CONFIGURATION)) 11 | 12 | class << self 13 | def in_project_dir 14 | original_dir = Dir.pwd 15 | Dir.chdir(PROJECT_ROOT) 16 | 17 | yield 18 | 19 | ensure 20 | Dir.chdir(original_dir) 21 | end 22 | 23 | def build_dir 24 | File.join(BUILD_DIR, CONFIGURATION) 25 | end 26 | 27 | def system_or_exit(cmd, stdout = nil) 28 | puts "Executing #{cmd}" 29 | cmd += " >#{stdout}" if stdout 30 | system(cmd) or raise "******** Build failed ********" 31 | end 32 | 33 | def with_env_vars(env_vars) 34 | old_values = {} 35 | env_vars.each do |key,new_value| 36 | old_values[key] = ENV[key] 37 | ENV[key] = new_value 38 | end 39 | 40 | yield 41 | 42 | env_vars.each_key do |key| 43 | ENV[key] = old_values[key] 44 | end 45 | end 46 | 47 | def output_file(target) 48 | output_dir = if ENV['IS_CI_BOX'] 49 | ENV['CC_BUILD_ARTIFACTS'] 50 | else 51 | Dir.mkdir(BUILD_DIR) unless File.exists?(BUILD_DIR) 52 | BUILD_DIR 53 | end 54 | 55 | output_file = File.join(output_dir, "#{target}.output") 56 | puts "Output: #{output_file}" 57 | output_file 58 | end 59 | end 60 | end 61 | 62 | desc "Clean build directory" 63 | task :clean_xcconf_tests do 64 | CedarTargetxcconf_tests.system_or_exit "rm -rf #{CedarTargetxcconf_tests::BUILD_DIR}/*", CedarTargetxcconf_tests.output_file("clean") 65 | end 66 | 67 | desc "Build xcconf_tests Specs" 68 | task :build_xcconf_tests do 69 | CedarTargetxcconf_tests.system_or_exit(%Q[pushd #{CedarTargetxcconf_tests::PROJECT_ROOT} ; xcodebuild -target #{CedarTargetxcconf_tests::SPECS_TARGET_NAME} -configuration #{CedarTargetxcconf_tests::CONFIGURATION} clean build SYMROOT=#{CedarTargetxcconf_tests::BUILD_DIR} ; popd ], CedarTargetxcconf_tests.output_file("xcconf_tests")) 70 | end 71 | 72 | desc "Run xcconf_tests Specs" 73 | task :xcconf_tests => :build_xcconf_tests do 74 | CedarTargetxcconf_tests.with_env_vars("DYLD_FRAMEWORK_PATH" => CedarTargetxcconf_tests.build_dir, "CEDAR_REPORTER_CLASS" => "CDRColorizedReporter") do 75 | CedarTargetxcconf_tests.system_or_exit(File.join(CedarTargetxcconf_tests.build_dir, CedarTargetxcconf_tests::SPECS_TARGET_NAME)) 76 | end 77 | end 78 | -------------------------------------------------------------------------------- /xcconf_tests/SupportingFiles/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | int main (int argc, const char *argv[]) { 4 | return CDRRunSpecs(); 5 | } 6 | -------------------------------------------------------------------------------- /xcconf_tests/SupportingFiles/xcconf_tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | --------------------------------------------------------------------------------