<div dir="ltr">
















<p class="MsoNormal"><span style="font-size:11pt">Hey all,<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><span> </span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">I apologize if this has
already been sent via the mailing list. I’ve been researching this issues for a
few days now, and am having a bit of trouble understanding how to best
integrate XCode projects with the Swift Package Manager. I’m hoping that, if we’re
able to find a solution, I can post this somewhere for others who may be
running into the same issue. For reference, I’ve tried the solutions provided
the following sites. <span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><span> </span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><a href="https://cjwirth.com/2016/03/07/using-xcode-and-spm-together/">https://cjwirth.com/2016/03/07/using-xcode-and-spm-together/</a><span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><a href="https://honzadvorsky.com/articles/2016-02-25-14-00-3_steps_to_marry_xcode_with_swift_package_manager/">https://honzadvorsky.com/articles/2016-02-25-14-00-3_steps_to_marry_xcode_with_swift_package_manager/</a><span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><a href="https://www.sitepoint.com/introducing-the-swift-package-manager/">https://www.sitepoint.com/introducing-the-swift-package-manager/</a><span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><span> </span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">I essentially have two
projects: The first is a library with a third-party dependency (Alamofire), and
the second is an iOS application. After setting up the Package.swift file for
the library, I’ve run the “swift package generate-xcodeproj” command, which has
created an xcode project. I’ve verified that this project builds correctly. The
project has been checked into a Git repo.<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><span> </span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">I then created a Package.swift
file for the iOS app, and set the library project as a dependency. When I run
the “swift package fetch” command, it pulls both the library project, as well
as the Alamofire project, into my Packages folder. However, if I attempt to
bring the library project’s xcodeproj into my iOS app’s workspace, I get compiler
errors. It seems like the library project is expecting the Alamofire source to
be within the <b>library’s Packages</b>, as
opposed to the iOS app’s Packages.<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><span> </span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">To visualize<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">+ iOS App<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">   + Packages<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">      + MyLib<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">         + Packages<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">            + Alamofire (folder without any
source)<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">      + Alamofire<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><span> </span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">As a workaround, I’m able to
navigate into the “MyLib” folder, and run “swift package fetch”. This fetches
the Alamofire source into the inner Packages folder, but also results in the
project having two version of the source.<span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><span> </span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">I’m guessing that this dependency
flattening is intentional, and that my problem is likely due to my
misunderstanding of the intended workflow. <span></span></span></p>

<p class="MsoNormal"><span style="font-size:11pt"><span> </span></span></p>

<p class="MsoNormal"><span style="font-size:11pt">Thank you in advance for any
help. I promise to return the favor ;). <span></span></span></p>

</div>