mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Merge pull request #527 from yonaskolb/fix_optional_path
Fix error on missing optional sources
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user