-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate copy-frameworks
command?
#2605
Comments
Hi @dimazen
Why not just iterate over |
Hi, @blender ! |
Ah! Right, good point. |
Yeah, in the end if team would accept extra dependency, I can then update existing |
Maybe you want to take a look at this issue? #2477 |
@dimazen we wrote a tool to do just this, as well as other Carthage-related tasks. From the ReadMe: " The Carthage team has been reluctant to read Xcode project files (as mentioned in #2477). To eliminate the need to read the project file, and eliminate the dependency on One advantage of the "Input Files"/"Output Files" mechanism built in to Xcode is that it will check timestamps of the input and output files and do nothing if the output file is already up-to-date. Ideally a tool that automatically sets the |
@bwhiteley wow, your tool looks solid 🚀. Haven't heard of it before. Let see what Carthage team will decide with 3rd party dependencies for .xcodeproj ready. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Anybody coming across this issue nowadays, please checkout my comment here. |
Hello Carthage team!
As you know in order to get things done we need to invoke
copy-frameworks
at the Build Phase. This also involves specifying a list of input files for each linked framework. This seems to be a good subject for an automation. Currently it might be a little annoying to keep this list in sync and to manually fill it in. This is the main motivation.From my attempt to make a draft of such functionality here is what I found:
Initially we need to grab list of the linked frameworks that was built by Carthage. Turns out that they are stored in the
Frameworks Build Phase
. Unfortunately built-in toolxcodebuild
doesn't allow us to read such information, therefore we used to read contents of the.xcodeproj
itself. There are well-known tools such as gem xcodeproj and its Swift counterpart xcodeproj.First of all we're reading contents of the Frameworks Build Phase. The rest of the process is very simple: select only those frameworks that are located in
Carthage/Build
but not in theStatic
subfolder.Then we simply iterating over found frameworks and filling in env variables like
SCRIPT_INPUT_FILE_
and so on.Below you can find working draft in ruby:
Simply put it to the new build phase and invoke as follow:
Important: script requires
Xcodeproj
gem. Therefore is case you're managing ruby viarbenv
, please use following script:The only downside at this point is that this automation would require from Carthage to add one more dependency (ruby gem or swift counterpart).
UPD:
Alternatives considered:
Simply copy contents of the
Carthage/Build/...
to the destination.Pros: removes extra dependency
Cons: copies frameworks from other targets (if any) to the destination target.
The text was updated successfully, but these errors were encountered: