igor-makarov / xcake

:cake: Describe Xcode projects in a human readable format and (re)generate one on demand.
MIT License
634 stars 48 forks source link

Work with 3rd-party frameworks #131

Closed rock88 closed 7 years ago

rock88 commented 8 years ago

Hi, Can I add 3rd-party frameworks to Embed Frameworks build phase & Embedded Binaries target section?

jcampbell05 commented 8 years ago

@rock88 Yes just add it to the list of files to be included and Xcake will add it for you

rock88 commented 8 years ago

@jcampbell05 Thanks for answer! I did it:

target.include_files << "Carthage/Build/iOS/Alamofire.framework"

But Alamofire.framework added only to Link Binary with Libraries, not to Embed Frameworks phase

jcampbell05 commented 8 years ago

@rock88 Ah, sorry I mis understood. I guess I'll have to expose a way of adding it to that phase.

jcampbell05 commented 7 years ago

We've exposed a new embed DSL in 0.8.8

RikkiGibson commented 7 years ago

How does the embed DSL work?

RikkiGibson commented 7 years ago

After some hunting, I found creating a block like this does the job.

target.copy_files_build_phase "Embed Frameworks" do |phase|
    phase.files = ["Carthage/Build/iOS/PromiseKit.framework"]
    phase.destination = :frameworks
    phase.code_sign = true
end

Would it be alright for me to try and roll up my sleeves and document some of these features in a way that's somewhat easier to discover?

edit: A few additional things turned out to be needed:

# Depending on how much you're reusing/sharing frameworks
# you may choose to use a pattern like *.framework.
target.include_files << "Carthage/Build/iOS/PromiseKit.framework"
target.all_configurations.each do |configuration|
    configuration.settings["FRAMEWORK_SEARCH_PATHS"] = "Carthage/**"
end
jcampbell05 commented 7 years ago

Yes please