mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-09-11 12:56:03 +03:00
Display absolute path for invalidBuildScriptPath and invalidTargetConfigFile error print. (#1353)
* Display absolute path in invalidBuildScriptPath error print. With previous implementation, the error message was not clear for end user: Spec validation error: Target "Project" has a script "SwiftLint" which has a path that doesn't exist "../../wrong-dir/scripts/run_swiftlint_in_xcode_wrapper.sh" With new implementation with absolute path, it is easier to validate what is wrong with path: Spec validation error: Target "Project" has a script "SwiftLint" which has a path that doesn't exist "/Users/SomeUser/dev/fancy-project/wrong-dir/scripts/run_swiftlint_in_xcode_wrapper.sh" * Display absolute path for invalidTargetConfigFile error print. Without patch: 2 Spec validations errors: - Target "MM" has invalid config file "../../xcodegen/MM/Build/xcconfig/conan_config.xcconfig" for config "Debug" - Target "MM" has invalid config file "../../xcodegen/MM/Build/xcconfig/conan_config.xcconfig" for config "Release" After fix: 2 Spec validations errors: - Target "MM" has invalid config file path "/Users/MyUser/dev/myproject/xcodegen/MM/Build/xcconfig/conan_config.xcconfig" for config "Release" - Target "MM" has invalid config file path "/Users/MyUser/dev/myproject/xcodegen/MM/Build/xcconfig/conan_config.xcconfig" for config "Debug"
This commit is contained in:
parent
ee60884b13
commit
9766326dcd
@ -81,8 +81,9 @@ extension Project {
|
||||
for target in projectTargets {
|
||||
|
||||
for (config, configFile) in target.configFiles {
|
||||
if !options.disabledValidations.contains(.missingConfigFiles) && !(basePath + configFile).exists {
|
||||
errors.append(.invalidTargetConfigFile(target: target.name, configFile: configFile, config: config))
|
||||
let configPath = basePath + configFile
|
||||
if !options.disabledValidations.contains(.missingConfigFiles) && !configPath.exists {
|
||||
errors.append(.invalidTargetConfigFile(target: target.name, configFile: configPath.string, config: config))
|
||||
}
|
||||
if !options.disabledValidations.contains(.missingConfigs) && getConfig(config) == nil {
|
||||
errors.append(.invalidConfigFileConfig(config))
|
||||
@ -137,7 +138,7 @@ extension Project {
|
||||
if case let .path(pathString) = script.script {
|
||||
let scriptPath = basePath + pathString
|
||||
if !scriptPath.exists {
|
||||
errors.append(.invalidBuildScriptPath(target: target.name, name: script.name, path: pathString))
|
||||
errors.append(.invalidBuildScriptPath(target: target.name, name: script.name, path: scriptPath.string))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public struct SpecValidationError: Error, CustomStringConvertible {
|
||||
case let .invalidTargetDependency(target, dependency):
|
||||
return "Target \(target.quoted) has invalid dependency: \(dependency.quoted)"
|
||||
case let .invalidTargetConfigFile(target, configFile, config):
|
||||
return "Target \(target.quoted) has invalid config file \(configFile.quoted) for config \(config.quoted)"
|
||||
return "Target \(target.quoted) has invalid config file path \(configFile.quoted) for config \(config.quoted)"
|
||||
case let .invalidTargetSource(target, source):
|
||||
return "Target \(target.quoted) has a missing source directory \(source.quoted)"
|
||||
case let .invalidTargetSchemeConfigVariant(target, configVariant, configType):
|
||||
|
Loading…
Reference in New Issue
Block a user