Open mobileben opened 4 years ago
I've made some progress in this, but also some setbacks.
type
== tool
, as trying to use aggregateTargets
is not overly documented and doesn't seem to work in my caseFor example the start of the script in the YAML looks like
preActions:
- name: Bootstrap Script
script: |+
#!/bin/bash
# Update xcconfig and yaml or remove if doesn't exist
# yaml probably should go elsewhere but for making this easier right now, this is where they all go
XCCONFIG="Custom.xcconfig"\n
FRAMEWORKS_YAML="frameworks.yml"
RESOURCES_YAML="resources.yml"
I'm not an YAML expert, but from my understanding |+
should keep newlines. Instead this gets inserted as one full line, which, because there is a she bang and comments up front ... means this script does nothing.
Some other issues I've run in.
The trick seems to use projectReferences
, however I'd like to have a projectReference
where in the end, the project is not inserted in the project. I really only need to scheme to hold the path to the project. But otherwise, this is not needed in my case.
I've noticed an issue where it seems that all pathing is relative to the spec file. It would be nice to be able to make it relative to the project directory. This is important because pathing get get out of sync if the spec file is in a different directory structure. This is particularly important is relative addressing is being created.
In a scheme, if you have a multiple targets, the order is not honored. This is actually important if you turn off parallel builds.
Some of the items listed above still hold (like not being able to define the shell for the preaction).
I'm currently working on a build system that uses prebuilts for dependency frameworks/libraries. We want the ability to use the project file instead of the prebuilt library for debug. I have a model working which I manually built a workspace, but am aiming to build this workspace dynamically with
xcodegen
. This is because the blend of prebuilts to projects is dependent upon the scenario. The main application project always exists in the workspace.The key to how this works is creating a "bootstrap" project. This bootstrap contains an aggregate target which is really just a dummy target for the scheme. The scheme does all the work to make this work. The scheme contains a preaction script. This preaction script copies over necessary configurations (in particular, an
xcconfig
file). The scheme also has the application's target as a build target.There are really 2 issues here I've encountered when trying to get
xcodegen
to generate the bootstrap project file.ExecutionAction
does not support defining the shell to use for the script (BuildScript
does)So the two questions are:
ExecutionAction
?Note I generate the workspace with
XcodeProj
. The code seems relatively difficult for creating the project and adding custom schemes (based on looking at some of theXcodeGen
code). Thus why I'm looking at this. Right now the plan is to call do this via the command line, but ideally I'd like to do this via usingXcodeGen
as a library, but it also isn't clear in this latter case if I lose the niceties done by the generate command.