How to Incorporate Swift Package Manager to an Existing Xcode Project? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experience Should we burninate the [wrap] tag?How do I use Swift Package Manager with an existing macOS project?Use swift package manager on existing xcode projectGit ignore file for Xcode projectsHow to “add existing frameworks” in Xcode 4?How can I disable ARC for a single file in a project?How to download Xcode DMG or XIP file?iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 BetaHow to Install Package in Xcode via Swift Package ManagerAdding Swift 3 packages to Xcode 8 using the Swift package managerUse swift package manager on existing xcode projectSwift Package Manager not ImportingCan't import packages using Swift 4 Package Manager

List *all* the tuples!

Do you forfeit tax refunds/credits if you aren't required to and don't file by April 15?

Bonus calculation: Am I making a mountain out of a molehill?

When is phishing education going too far?

Can inflation occur in a positive-sum game currency system such as the Stack Exchange reputation system?

Do I really need recursive chmod to restrict access to a folder?

If Jon Snow became King of the Seven Kingdoms what would his regnal number be?

Antler Helmet: Can it work?

Is there a documented rationale why the House Ways and Means chairman can demand tax info?

What happens to sewage if there is no river near by?

IndentationError when pasting code in Python 3 interpreter mode

ListPlot join points by nearest neighbor rather than order

When to stop saving and start investing?

Are variable time comparisons always a security risk in cryptography code?

Can Pao de Queijo, and similar foods, be kosher for Passover?

How can I make names more distinctive without making them longer?

Is it possible to boil a liquid by just mixing many immiscible liquids together?

Why was Tyrion worried & disapproved of Jon and Dany’s actions on the boat?

What does the "x" in "x86" represent?

Is there a way in Ruby to make just any one out of many keyword arguments required?

Why is "Consequences inflicted." not a sentence?

Does accepting a pardon have any bearing on trying that person for the same crime in a sovereign jurisdiction?

Is it true that "carbohydrates are of no use for the basal metabolic need"?

Why did the IBM 650 use bi-quinary?



How to Incorporate Swift Package Manager to an Existing Xcode Project?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experience
Should we burninate the [wrap] tag?How do I use Swift Package Manager with an existing macOS project?Use swift package manager on existing xcode projectGit ignore file for Xcode projectsHow to “add existing frameworks” in Xcode 4?How can I disable ARC for a single file in a project?How to download Xcode DMG or XIP file?iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 BetaHow to Install Package in Xcode via Swift Package ManagerAdding Swift 3 packages to Xcode 8 using the Swift package managerUse swift package manager on existing xcode projectSwift Package Manager not ImportingCan't import packages using Swift 4 Package Manager



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















I already have a working Xcode project for a MacOS App. However, I would like to add a Swift framework from Github using Swift Package Manager.



I ran "swift package init" inside the project folder. Then I updated Package.swift file. Then I ran "swift package resolve".



However, it still complains no such module when I try to build.



Since I already have a working project, if I run "swift package generate-xcodeproj", it messes up the folder structure as well as removing the storyboard.



How can I tell Xcode to use the module that swift package manager downloaded into the project?



Thank you!










share|improve this question




























    2















    I already have a working Xcode project for a MacOS App. However, I would like to add a Swift framework from Github using Swift Package Manager.



    I ran "swift package init" inside the project folder. Then I updated Package.swift file. Then I ran "swift package resolve".



    However, it still complains no such module when I try to build.



    Since I already have a working project, if I run "swift package generate-xcodeproj", it messes up the folder structure as well as removing the storyboard.



    How can I tell Xcode to use the module that swift package manager downloaded into the project?



    Thank you!










    share|improve this question
























      2












      2








      2


      1






      I already have a working Xcode project for a MacOS App. However, I would like to add a Swift framework from Github using Swift Package Manager.



      I ran "swift package init" inside the project folder. Then I updated Package.swift file. Then I ran "swift package resolve".



      However, it still complains no such module when I try to build.



      Since I already have a working project, if I run "swift package generate-xcodeproj", it messes up the folder structure as well as removing the storyboard.



      How can I tell Xcode to use the module that swift package manager downloaded into the project?



      Thank you!










      share|improve this question














      I already have a working Xcode project for a MacOS App. However, I would like to add a Swift framework from Github using Swift Package Manager.



      I ran "swift package init" inside the project folder. Then I updated Package.swift file. Then I ran "swift package resolve".



      However, it still complains no such module when I try to build.



      Since I already have a working project, if I run "swift package generate-xcodeproj", it messes up the folder structure as well as removing the storyboard.



      How can I tell Xcode to use the module that swift package manager downloaded into the project?



      Thank you!







      swift xcode






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 '17 at 1:55









      jl303jl303

      392315




      392315






















          3 Answers
          3






          active

          oldest

          votes


















          1














          macOS, iOS, tvOS, and watchOS do not support the Swift Package Manger at the time of this writing (Dec 2017). Instead, you will have to add the files from the package directly to your project.



          I would suggest creating a Dependencies group in your project and a group below that with the package name:



          enter image description here



          Then add the files to the group:



          enter image description here



          enter image description here



          I was unable to get this to work if I added folders, so you should add all the files to groups if you want to maintain structure of the package. I might have done this the wrong way though.



          You can then access the code as you usually would when you write it yourself. No imports.



          enter image description here






          share|improve this answer






























            1














            Steps to achieve Swift Package Manager and XCode integration in 2019:



            1) Create Dependencies.swift file
            /yourproject/Dependencies/Sources/Dependencies.swift



            (empty file)


            2) Create macos.xcconfig file
            /yourproject/Dependencies/Sources/macos.xcconfig



            MACOSX_DEPLOYMENT_TARGET = 10.14


            3) Create Package.swift file
            /yourproject/Dependencies/Package.swift



            // swift-tools-version:4.2
            import PackageDescription

            let package = Package(
            name: "Dependencies",
            products: [
            .library(name: "Dependencies", type: .static, targets: ["Dependencies"])
            ],
            dependencies: [
            .package(url: "https://github.com/YourDependency/here.git", .upToNextMinor(from: "0.1.0"))
            ],
            targets: [
            .target(name: "Dependencies", dependencies: ["YourDependency"])
            ]
            )


            4) Generate Dependencies.xcodeproj and drag-and-drop into your existing project



            swift package generate-xcodeproj --xcconfig-overrides Sources/macos.xcconfig


            5) Import your dependency



            import YourDependency


            This is enough to make it work but you can make your life a bit easier with a few extra steps.



            Additional (optional) steps:



            6) Create ios.xcconfig file
            /yourproject/Dependencies/Sources/ios.xcconfig



            SDKROOT = iphoneos
            SUPPORTED_PLATFORMS = iphonesimulator iphoneos
            IPHONEOS_DEPLOYMENT_TARGET = 10.0

            ARCHS = $(ARCHS_STANDARD)
            VALID_ARCHS = $(ARCHS_STANDARD)

            VALIDATE_PRODUCT = YES
            LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
            TARGETED_DEVICE_FAMILY = 1, 2


            7) Add Pre-build action to your main project's iOS and macOS Schemes



            iOS



            echo "Building SPM Dependencies"
            BASE_DIR="$PROJECT_DIR/Dependencies"
            cd $BASE_DIR

            rm -fr Dependencies.xcodeproj
            swift package update
            swift package generate-xcodeproj --xcconfig-overrides Sources/ios.xcconfig

            sleep 3

            until [ -d "Dependencies.xcodeproj" ]
            do
            echo "File not found"
            sleep 0.1
            done
            echo "File found"
            exit


            macOS



            echo "Building SPM Dependencies"
            BASE_DIR="$PROJECT_DIR/Dependencies"
            cd $BASE_DIR

            rm -fr Dependencies.xcodeproj
            swift package update
            swift package generate-xcodeproj --xcconfig-overrides Sources/macos.xcconfig

            sleep 3

            until [ -d "Dependencies.xcodeproj" ]
            do
            echo "File not found"
            sleep 0.1
            done
            echo "File found"
            exit


            8) Run your project and enjoy :)






            share|improve this answer






























              0














              The generated Xcode project from SPM is different from your app's Xcode project/workspace.



              You should generate that Xcode project in another directory eg. "Dependencies".



              Then drag it into your app's, and add the linked framework. I have written a full step-by-step.








              share|improve this answer























                Your Answer






                StackExchange.ifUsing("editor", function ()
                StackExchange.using("externalEditor", function ()
                StackExchange.using("snippets", function ()
                StackExchange.snippets.init();
                );
                );
                , "code-snippets");

                StackExchange.ready(function()
                var channelOptions =
                tags: "".split(" "),
                id: "1"
                ;
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function()
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled)
                StackExchange.using("snippets", function()
                createEditor();
                );

                else
                createEditor();

                );

                function createEditor()
                StackExchange.prepareEditor(
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader:
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                ,
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                );



                );













                draft saved

                draft discarded


















                StackExchange.ready(
                function ()
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47373001%2fhow-to-incorporate-swift-package-manager-to-an-existing-xcode-project%23new-answer', 'question_page');

                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                1














                macOS, iOS, tvOS, and watchOS do not support the Swift Package Manger at the time of this writing (Dec 2017). Instead, you will have to add the files from the package directly to your project.



                I would suggest creating a Dependencies group in your project and a group below that with the package name:



                enter image description here



                Then add the files to the group:



                enter image description here



                enter image description here



                I was unable to get this to work if I added folders, so you should add all the files to groups if you want to maintain structure of the package. I might have done this the wrong way though.



                You can then access the code as you usually would when you write it yourself. No imports.



                enter image description here






                share|improve this answer



























                  1














                  macOS, iOS, tvOS, and watchOS do not support the Swift Package Manger at the time of this writing (Dec 2017). Instead, you will have to add the files from the package directly to your project.



                  I would suggest creating a Dependencies group in your project and a group below that with the package name:



                  enter image description here



                  Then add the files to the group:



                  enter image description here



                  enter image description here



                  I was unable to get this to work if I added folders, so you should add all the files to groups if you want to maintain structure of the package. I might have done this the wrong way though.



                  You can then access the code as you usually would when you write it yourself. No imports.



                  enter image description here






                  share|improve this answer

























                    1












                    1








                    1







                    macOS, iOS, tvOS, and watchOS do not support the Swift Package Manger at the time of this writing (Dec 2017). Instead, you will have to add the files from the package directly to your project.



                    I would suggest creating a Dependencies group in your project and a group below that with the package name:



                    enter image description here



                    Then add the files to the group:



                    enter image description here



                    enter image description here



                    I was unable to get this to work if I added folders, so you should add all the files to groups if you want to maintain structure of the package. I might have done this the wrong way though.



                    You can then access the code as you usually would when you write it yourself. No imports.



                    enter image description here






                    share|improve this answer













                    macOS, iOS, tvOS, and watchOS do not support the Swift Package Manger at the time of this writing (Dec 2017). Instead, you will have to add the files from the package directly to your project.



                    I would suggest creating a Dependencies group in your project and a group below that with the package name:



                    enter image description here



                    Then add the files to the group:



                    enter image description here



                    enter image description here



                    I was unable to get this to work if I added folders, so you should add all the files to groups if you want to maintain structure of the package. I might have done this the wrong way though.



                    You can then access the code as you usually would when you write it yourself. No imports.



                    enter image description here







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 23 '17 at 16:26









                    Caleb KleveterCaleb Kleveter

                    7,64784171




                    7,64784171























                        1














                        Steps to achieve Swift Package Manager and XCode integration in 2019:



                        1) Create Dependencies.swift file
                        /yourproject/Dependencies/Sources/Dependencies.swift



                        (empty file)


                        2) Create macos.xcconfig file
                        /yourproject/Dependencies/Sources/macos.xcconfig



                        MACOSX_DEPLOYMENT_TARGET = 10.14


                        3) Create Package.swift file
                        /yourproject/Dependencies/Package.swift



                        // swift-tools-version:4.2
                        import PackageDescription

                        let package = Package(
                        name: "Dependencies",
                        products: [
                        .library(name: "Dependencies", type: .static, targets: ["Dependencies"])
                        ],
                        dependencies: [
                        .package(url: "https://github.com/YourDependency/here.git", .upToNextMinor(from: "0.1.0"))
                        ],
                        targets: [
                        .target(name: "Dependencies", dependencies: ["YourDependency"])
                        ]
                        )


                        4) Generate Dependencies.xcodeproj and drag-and-drop into your existing project



                        swift package generate-xcodeproj --xcconfig-overrides Sources/macos.xcconfig


                        5) Import your dependency



                        import YourDependency


                        This is enough to make it work but you can make your life a bit easier with a few extra steps.



                        Additional (optional) steps:



                        6) Create ios.xcconfig file
                        /yourproject/Dependencies/Sources/ios.xcconfig



                        SDKROOT = iphoneos
                        SUPPORTED_PLATFORMS = iphonesimulator iphoneos
                        IPHONEOS_DEPLOYMENT_TARGET = 10.0

                        ARCHS = $(ARCHS_STANDARD)
                        VALID_ARCHS = $(ARCHS_STANDARD)

                        VALIDATE_PRODUCT = YES
                        LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
                        TARGETED_DEVICE_FAMILY = 1, 2


                        7) Add Pre-build action to your main project's iOS and macOS Schemes



                        iOS



                        echo "Building SPM Dependencies"
                        BASE_DIR="$PROJECT_DIR/Dependencies"
                        cd $BASE_DIR

                        rm -fr Dependencies.xcodeproj
                        swift package update
                        swift package generate-xcodeproj --xcconfig-overrides Sources/ios.xcconfig

                        sleep 3

                        until [ -d "Dependencies.xcodeproj" ]
                        do
                        echo "File not found"
                        sleep 0.1
                        done
                        echo "File found"
                        exit


                        macOS



                        echo "Building SPM Dependencies"
                        BASE_DIR="$PROJECT_DIR/Dependencies"
                        cd $BASE_DIR

                        rm -fr Dependencies.xcodeproj
                        swift package update
                        swift package generate-xcodeproj --xcconfig-overrides Sources/macos.xcconfig

                        sleep 3

                        until [ -d "Dependencies.xcodeproj" ]
                        do
                        echo "File not found"
                        sleep 0.1
                        done
                        echo "File found"
                        exit


                        8) Run your project and enjoy :)






                        share|improve this answer



























                          1














                          Steps to achieve Swift Package Manager and XCode integration in 2019:



                          1) Create Dependencies.swift file
                          /yourproject/Dependencies/Sources/Dependencies.swift



                          (empty file)


                          2) Create macos.xcconfig file
                          /yourproject/Dependencies/Sources/macos.xcconfig



                          MACOSX_DEPLOYMENT_TARGET = 10.14


                          3) Create Package.swift file
                          /yourproject/Dependencies/Package.swift



                          // swift-tools-version:4.2
                          import PackageDescription

                          let package = Package(
                          name: "Dependencies",
                          products: [
                          .library(name: "Dependencies", type: .static, targets: ["Dependencies"])
                          ],
                          dependencies: [
                          .package(url: "https://github.com/YourDependency/here.git", .upToNextMinor(from: "0.1.0"))
                          ],
                          targets: [
                          .target(name: "Dependencies", dependencies: ["YourDependency"])
                          ]
                          )


                          4) Generate Dependencies.xcodeproj and drag-and-drop into your existing project



                          swift package generate-xcodeproj --xcconfig-overrides Sources/macos.xcconfig


                          5) Import your dependency



                          import YourDependency


                          This is enough to make it work but you can make your life a bit easier with a few extra steps.



                          Additional (optional) steps:



                          6) Create ios.xcconfig file
                          /yourproject/Dependencies/Sources/ios.xcconfig



                          SDKROOT = iphoneos
                          SUPPORTED_PLATFORMS = iphonesimulator iphoneos
                          IPHONEOS_DEPLOYMENT_TARGET = 10.0

                          ARCHS = $(ARCHS_STANDARD)
                          VALID_ARCHS = $(ARCHS_STANDARD)

                          VALIDATE_PRODUCT = YES
                          LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
                          TARGETED_DEVICE_FAMILY = 1, 2


                          7) Add Pre-build action to your main project's iOS and macOS Schemes



                          iOS



                          echo "Building SPM Dependencies"
                          BASE_DIR="$PROJECT_DIR/Dependencies"
                          cd $BASE_DIR

                          rm -fr Dependencies.xcodeproj
                          swift package update
                          swift package generate-xcodeproj --xcconfig-overrides Sources/ios.xcconfig

                          sleep 3

                          until [ -d "Dependencies.xcodeproj" ]
                          do
                          echo "File not found"
                          sleep 0.1
                          done
                          echo "File found"
                          exit


                          macOS



                          echo "Building SPM Dependencies"
                          BASE_DIR="$PROJECT_DIR/Dependencies"
                          cd $BASE_DIR

                          rm -fr Dependencies.xcodeproj
                          swift package update
                          swift package generate-xcodeproj --xcconfig-overrides Sources/macos.xcconfig

                          sleep 3

                          until [ -d "Dependencies.xcodeproj" ]
                          do
                          echo "File not found"
                          sleep 0.1
                          done
                          echo "File found"
                          exit


                          8) Run your project and enjoy :)






                          share|improve this answer

























                            1












                            1








                            1







                            Steps to achieve Swift Package Manager and XCode integration in 2019:



                            1) Create Dependencies.swift file
                            /yourproject/Dependencies/Sources/Dependencies.swift



                            (empty file)


                            2) Create macos.xcconfig file
                            /yourproject/Dependencies/Sources/macos.xcconfig



                            MACOSX_DEPLOYMENT_TARGET = 10.14


                            3) Create Package.swift file
                            /yourproject/Dependencies/Package.swift



                            // swift-tools-version:4.2
                            import PackageDescription

                            let package = Package(
                            name: "Dependencies",
                            products: [
                            .library(name: "Dependencies", type: .static, targets: ["Dependencies"])
                            ],
                            dependencies: [
                            .package(url: "https://github.com/YourDependency/here.git", .upToNextMinor(from: "0.1.0"))
                            ],
                            targets: [
                            .target(name: "Dependencies", dependencies: ["YourDependency"])
                            ]
                            )


                            4) Generate Dependencies.xcodeproj and drag-and-drop into your existing project



                            swift package generate-xcodeproj --xcconfig-overrides Sources/macos.xcconfig


                            5) Import your dependency



                            import YourDependency


                            This is enough to make it work but you can make your life a bit easier with a few extra steps.



                            Additional (optional) steps:



                            6) Create ios.xcconfig file
                            /yourproject/Dependencies/Sources/ios.xcconfig



                            SDKROOT = iphoneos
                            SUPPORTED_PLATFORMS = iphonesimulator iphoneos
                            IPHONEOS_DEPLOYMENT_TARGET = 10.0

                            ARCHS = $(ARCHS_STANDARD)
                            VALID_ARCHS = $(ARCHS_STANDARD)

                            VALIDATE_PRODUCT = YES
                            LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
                            TARGETED_DEVICE_FAMILY = 1, 2


                            7) Add Pre-build action to your main project's iOS and macOS Schemes



                            iOS



                            echo "Building SPM Dependencies"
                            BASE_DIR="$PROJECT_DIR/Dependencies"
                            cd $BASE_DIR

                            rm -fr Dependencies.xcodeproj
                            swift package update
                            swift package generate-xcodeproj --xcconfig-overrides Sources/ios.xcconfig

                            sleep 3

                            until [ -d "Dependencies.xcodeproj" ]
                            do
                            echo "File not found"
                            sleep 0.1
                            done
                            echo "File found"
                            exit


                            macOS



                            echo "Building SPM Dependencies"
                            BASE_DIR="$PROJECT_DIR/Dependencies"
                            cd $BASE_DIR

                            rm -fr Dependencies.xcodeproj
                            swift package update
                            swift package generate-xcodeproj --xcconfig-overrides Sources/macos.xcconfig

                            sleep 3

                            until [ -d "Dependencies.xcodeproj" ]
                            do
                            echo "File not found"
                            sleep 0.1
                            done
                            echo "File found"
                            exit


                            8) Run your project and enjoy :)






                            share|improve this answer













                            Steps to achieve Swift Package Manager and XCode integration in 2019:



                            1) Create Dependencies.swift file
                            /yourproject/Dependencies/Sources/Dependencies.swift



                            (empty file)


                            2) Create macos.xcconfig file
                            /yourproject/Dependencies/Sources/macos.xcconfig



                            MACOSX_DEPLOYMENT_TARGET = 10.14


                            3) Create Package.swift file
                            /yourproject/Dependencies/Package.swift



                            // swift-tools-version:4.2
                            import PackageDescription

                            let package = Package(
                            name: "Dependencies",
                            products: [
                            .library(name: "Dependencies", type: .static, targets: ["Dependencies"])
                            ],
                            dependencies: [
                            .package(url: "https://github.com/YourDependency/here.git", .upToNextMinor(from: "0.1.0"))
                            ],
                            targets: [
                            .target(name: "Dependencies", dependencies: ["YourDependency"])
                            ]
                            )


                            4) Generate Dependencies.xcodeproj and drag-and-drop into your existing project



                            swift package generate-xcodeproj --xcconfig-overrides Sources/macos.xcconfig


                            5) Import your dependency



                            import YourDependency


                            This is enough to make it work but you can make your life a bit easier with a few extra steps.



                            Additional (optional) steps:



                            6) Create ios.xcconfig file
                            /yourproject/Dependencies/Sources/ios.xcconfig



                            SDKROOT = iphoneos
                            SUPPORTED_PLATFORMS = iphonesimulator iphoneos
                            IPHONEOS_DEPLOYMENT_TARGET = 10.0

                            ARCHS = $(ARCHS_STANDARD)
                            VALID_ARCHS = $(ARCHS_STANDARD)

                            VALIDATE_PRODUCT = YES
                            LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks
                            TARGETED_DEVICE_FAMILY = 1, 2


                            7) Add Pre-build action to your main project's iOS and macOS Schemes



                            iOS



                            echo "Building SPM Dependencies"
                            BASE_DIR="$PROJECT_DIR/Dependencies"
                            cd $BASE_DIR

                            rm -fr Dependencies.xcodeproj
                            swift package update
                            swift package generate-xcodeproj --xcconfig-overrides Sources/ios.xcconfig

                            sleep 3

                            until [ -d "Dependencies.xcodeproj" ]
                            do
                            echo "File not found"
                            sleep 0.1
                            done
                            echo "File found"
                            exit


                            macOS



                            echo "Building SPM Dependencies"
                            BASE_DIR="$PROJECT_DIR/Dependencies"
                            cd $BASE_DIR

                            rm -fr Dependencies.xcodeproj
                            swift package update
                            swift package generate-xcodeproj --xcconfig-overrides Sources/macos.xcconfig

                            sleep 3

                            until [ -d "Dependencies.xcodeproj" ]
                            do
                            echo "File not found"
                            sleep 0.1
                            done
                            echo "File found"
                            exit


                            8) Run your project and enjoy :)







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Feb 15 at 2:16









                            AlexAlex

                            25934




                            25934





















                                0














                                The generated Xcode project from SPM is different from your app's Xcode project/workspace.



                                You should generate that Xcode project in another directory eg. "Dependencies".



                                Then drag it into your app's, and add the linked framework. I have written a full step-by-step.








                                share|improve this answer



























                                  0














                                  The generated Xcode project from SPM is different from your app's Xcode project/workspace.



                                  You should generate that Xcode project in another directory eg. "Dependencies".



                                  Then drag it into your app's, and add the linked framework. I have written a full step-by-step.








                                  share|improve this answer

























                                    0












                                    0








                                    0







                                    The generated Xcode project from SPM is different from your app's Xcode project/workspace.



                                    You should generate that Xcode project in another directory eg. "Dependencies".



                                    Then drag it into your app's, and add the linked framework. I have written a full step-by-step.








                                    share|improve this answer













                                    The generated Xcode project from SPM is different from your app's Xcode project/workspace.



                                    You should generate that Xcode project in another directory eg. "Dependencies".



                                    Then drag it into your app's, and add the linked framework. I have written a full step-by-step.









                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Mar 22 at 8:13









                                    samwizesamwize

                                    15k882140




                                    15k882140



























                                        draft saved

                                        draft discarded
















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid


                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.

                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47373001%2fhow-to-incorporate-swift-package-manager-to-an-existing-xcode-project%23new-answer', 'question_page');

                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                                        용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                                        155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해