Comments (5)
It's similar to xcconfigs #include
in the way that it merges files. But instead of just using it for build settings you can split up your whole project spec. For example having one yaml file that has common build settings for different projects, or one that has a few targets, that another one then adds to or overrides specific properties of the targets, for example changing the platform of them all or something.
You can see an example here in the tests https://github.com/yonaskolb/XcodeGen/blob/master/Fixtures/include_test.yml
https://github.com/yonaskolb/XcodeGen/blob/master/Fixtures/included.yml
We use it for white label apps, where some things are defined in a base.yml
and then the different projects have their own project.yml
that include base.yml
to override some settings, and add some project specific targets.
In terms of the name, do you suggest something other than include
to make the purpose clearer? In either case the documentation for this feature should be improved. At the moment it's just documented briefly as a property in the project spec
from xcodegen.
Thanks for sharing the details. I think include
just fits the use-case.👌
It isn't possible to inherit while overriding (like $(inherited)
of Xcode) though, is it?
from xcodegen.
$(inherited)
isn't really part of it, as that is inheriting between different levels of settings (target, target config, project, project config, sdk).
Any property that supports $(inherited)
can actually be an array of values. If you define a setting as an array, then a different spec can add values to this.
This is because the logic of the include merging is as follows:
- if existing value and new value are both dictionaries merge them
- if existing value and new value are both an array then add the value
- otherwise replace the existing value with the new value
This lets you add or replace something deep down in a hierachy. The only downside is that it's not possible to replace a whole dictionary or array as it's additive. I've been thinking of having some sort of syntax for replacing though (something like targets(REPLACE):
)
Not sure if that all makes sense :)
from xcodegen.
Understood. It sounds great!
Because xcconfig's #include
does not allow inheritance or merging, when you have xcconfig from CocoaPods, configuring your xcconfig is kind of troublesome. Resently I presented about this. So for some users, it can be better option to use XcodeGen's include feature than xcconfig.
Only thing to consider is that XcodeGen is a third party, so it might be broken by future release of Xcode. But it's not likely to happen because pbxproj format haven't changed much for years, did it?
Even #include
is a bit troublesome as described in my slide, xcconfig is still a good option, too. Because it's even separated from XcodeGen's spec(project.yml), it's easier to be reviewed by or share with others who don't know about XcodeGen.
Related: #59
from xcodegen.
The :REPLACE
syntax for includes has been added in #68
from xcodegen.
Related Issues (20)
- Why Isn't watchOS a Supported Destination? HOT 2
- Add DESTDIR support to Makefile HOT 2
- Can't specify preferredScreenCaptureFormat in scheme's test actions HOT 1
- XcodeGenKit/resource_bundle_accessor.swift:44: Fatal error: unable to find bundle named XcodeGen_XcodeGenKit HOT 17
- XcodeGen doesn't support the full set of C++ file extensions that Xcode itself does
- [BUG] Optional source path doesn't work if executing xcodegen from outer directory
- Where should I set the App version? HOT 2
- Specify additional build/run targets for target-scheme HOT 2
- Xcodegen cache bug? HOT 2
- Strange behavior of SwiftUI App HOT 2
- Exclude PrivacyInfo.xcprivacy from Copy Bundle Resources HOT 11
- Xcode removing Package.resolved HOT 8
- Indentation options are not applied to files being part of Packages HOT 1
- Deintegration of GraphViz HOT 1
- Using 'supportedDestinations' with watchOS app doesn't generate an 'Embed Watch Content' build phase HOT 12
- Setting a default device target HOT 1
- Prefetch resource tags (ODR, On Demand Resources) HOT 1
- Specify multiple package products broken HOT 1
- settings DEVELOPMENT_TEAM doesn't work HOT 1
- Sources "name" property ignored if specifying "group"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xcodegen.