Using Decodable is nice but the errors it will raise for missing keys are not as nice as the ones this project originally reported.
e.g. compare
keyNotFound(CodingKeys(stringValue: "CONFIGURATION_BUILD_DIR", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"CONFIGURATION_BUILD_DIR\", intValue: nil) (\"CONFIGURATION_BUILD_DIR\").", underlyingError: nil))
Fatal error: file /Users/paul/src/swift/Guise/Sources/GuiseFramework/BuildArguments.swift, line 46
with
CONFIGURATION_BUILD_DIR is required to be set
The first commit in this PR maps missing keys to the frameworks own error type APIGeneratorError.buildArgumentRequired(name:) that has nicer reporting to the user.
In the change we also lost the helpful message when deploymentTarget could not be resolved e.g.
IPHONEOS_DEPLOYMENT_TARGET or MACOSX_DEPLOYMENT_TARGET is required to be set
The second commit - actively queries if IPHONEOS_DEPLOYMENT_TARGET or MACOSX_DEPLOYMENT_TARGET have been set and throws APIGeneratorError.buildArgumentRequired(name:) if not.
Using
Decodable
is nice but the errors it will raise for missing keys are not as nice as the ones this project originally reported.e.g. compare
with
The first commit in this PR maps missing keys to the frameworks own error type
APIGeneratorError.buildArgumentRequired(name:)
that has nicer reporting to the user.In the change we also lost the helpful message when
deploymentTarget
could not be resolved e.g.The second commit - actively queries if
IPHONEOS_DEPLOYMENT_TARGET
orMACOSX_DEPLOYMENT_TARGET
have been set and throwsAPIGeneratorError.buildArgumentRequired(name:)
if not.