Add `enable` option for `include` to enable optional including for addtional spec
Motivation
Currently, we cannot disable the adding additional spec from other file, by include option so it is unable to generate variety project by XcodeGen.
For example, we cannot generate the project which has difference between Debug and Release. We may have the dependency which is not necessary for release environment, like debug logger framework.
Achivement
By this PR, we can achive the such things by XcodeGen. For example,
include:
- path: dependency_for_debug.yml
enable: ${DEBUG_BUILD}
This yml files only imports debug dependency if DEBUG_BUILD environment object is defined as "YES".
We also can specify normal boolean literal.
include:
- path: dependency_for_debug.yml
enable: false
Changes
- Add
enableoption forinclude - Fix checking environment variable in
include
Test
Added to Tests/ProjectSpecTests/SpecLoadingTests.swift
Environment variables are already resolved here. It's strange to resolve variables on SpecFile side. https://github.com/yonaskolb/XcodeGen/blob/34f50d645e6a3b0d9930c2b105c00521bfe2c8cf/Sources/ProjectSpec/SpecLoader.swift#L20
I suggest moving the process resolves variables before including sub specs.
@giginet I fixed by resolving variable here to not make resolve twice. Please check it https://github.com/yonaskolb/XcodeGen/blob/0cfb122a0d35ffeb94a42c247ff470e75e0cb8ce/Sources/ProjectSpec/SpecFile.swift#L72
Hello, when new version of XcodeGen released?
I'm happy if there is new release for using it
2.32.0 released
Thanks!