Merge pull request #527 from yonaskolb/fix_optional_path

Fix error on missing optional sources
This commit is contained in:
Yonas Kolb
2019-02-28 19:55:40 +11:00
committed by GitHub
3 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -3,12 +3,12 @@
## Master
#### Added
- Added `missingConfigFiles` to `options.disabledValidations` to optionally skip checking for the existence of config files.
- Added ability to automatically include Carthage related dependencies via `includeRelated: true` [#506](https://github.com/yonaskolb/XcodeGen/pull/506) @rpassis
#### Fixed
- Sources outside a project spec's directory will be correctly referenced as relative paths in the project file. [#524](https://github.com/yonaskolb/XcodeGen/pull/524)
- Fixed error when `optional` path is missing [#527](https://github.com/yonaskolb/XcodeGen/pull/527) @yonaskolb
## 2.2.0
@@ -463,6 +463,11 @@ class SourceGenerator {
/// creates source files
private func getSourceFiles(targetType: PBXProductType, targetSource: TargetSource, path: Path) throws -> [SourceFile] {
if targetSource.optional && !Path(targetSource.path).exists {
// Is optional so if it doesn't exist just return an empty array
return []
}
// generate excluded paths
targetSourceExcludePaths = getSourceExcludes(targetSource: targetSource)
+2
View File
@@ -41,6 +41,8 @@ targets:
- path: App_macOS
- path: StandaloneFiles/Standalone.swift
- path: Vendor/SomeXPCService.xpc
- path: NonExisting
optional: true
dependencies:
- target: Framework_macOS
- target: XPC Service