-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
SPM Target Support #127
Comments
Hmm, the plugin relies on |
I ran into this as well. My SwiftPM schemes were in the The other schemes were visible prior to PR 96. |
Ahhh, so there could be schemes also in |
I will need to investigate it, for now I'm reverting the improvement to find schemes based on generated files. Let me know if it resolves your issue. |
Thanks, that does fix the issue for me. They all show up now! |
If you need a project to test with, this is the one that had the problem: https://github.com/agarrharr/Countable |
I had to revert yesterday's changes because they break other things as now there is no build configuration selection. I missed yesterday that this problem is generally about SPM packages, currently SPM targets are not supported directly. They break some assumptions of the plugin like running the target or getting build settings (which are not available for SPM packages). Could you describe what's your use case for selecting a specific SPM module? To build it faster than when using the wrapping app? If you benefit from using these schemes and it somehow works for you, you can still switch to the previous commit. |
For my use-case, this change was a huge benefit. I have a large macOS project with multiple SPM packages. Working in the project involves changing schemes often, depending on what is being worked on. Building the SPM packages via the parent target is very time consuming, and it does not allow me to use the test explorer to run tests for a specific package. This increases the build/test time significantly. |
Ah, great questions. I don't really need to select them, I was just surprised that they were missing from this list. Technically, it would make it build faster if I was working on one small module at a time. But if I'm working on a SwiftUI view, I have Xcode in the background and I have an AppleScript that automatically switches to that scheme in Xcode when I save a file so that I can see the SwiftUI preview. Now that I think about it though, I would need to select one of them to run their tests, right? |
Currently, tests are supported only via test plans, so if you configure a test plan in your main app that runs tests from specific module you should be able to do that without selecting SPM target. @notlus for now you can switch to specific commit if this solution worked for you. But keep in mind that build configuration detection doesn't work there, so if you use a different build configuration than "Debug" it won't work correctly. I need to figure out if and how to support SPM packages, basically it's a different flow than for apps. I guess I would have to support two modes xcodeproj/xcworkspace and SPM module with a different set of commands and behaviors. |
@wojciech-kulik The main project has multiple peer targets (there is no main app), none of which currently have test plans. I will see whether I can add test plans for them, but it seems like each test plan would need to be configured to run the SPM tests. I also have this issue with sub-projects. The main Xcode project has some dependencies as child Xcode projects and like the SPM schemes, their schemes are not visible. In Xcode, I can select schemes across the projects. For now, I will either stick with the commit or move the SPM schemes into the |
Ok, this is a bug caused by looking for schemes inside a single
If you wrap your main module inside an app project, you can then create a test plan that will include tests from each SPM package, a single test plan. I was using a similar approach in a project where I was working on a modularized application using SPM. We had just a "demo" project to include this package, run tests, and test in general the functionality. |
I'm not sure what the difference is, but I have 2 different projects that are set up in pretty much the same way, with an spm package that has many modules. One of them correctly shows all of the schemes when I run
:XcodebuildSetup
and the other one does not. I can provide more information if needed.This one is correct:
And this one only shows 2 schemes:
The text was updated successfully, but these errors were encountered: