Skip to content
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

Wrong Docs regarding Package.swift #140

Closed
stherold opened this issue Sep 28, 2020 · 7 comments · Fixed by #150
Closed

Wrong Docs regarding Package.swift #140

stherold opened this issue Sep 28, 2020 · 7 comments · Fixed by #150

Comments

@stherold
Copy link

stherold commented Sep 28, 2020

When using SPM from Xcode there is no Package.swift as suggested in:

If you are using Swift Package Manager inside Xcode, you can use --package-path $PROJECT_FILE_PATH/project.xcworkspace/xcshareddata/swiftpm/Package.swift inside your Run script.

What exactly is meant by this? It should be removed imho. When using SPM from Xcode the resolved package info is stored in
$PROJECT_FILE_PATH/project.xcworkspace/xcshareddata/swiftpm/Package.resolved and the package info itself in project.pbxproj

@buechner
Copy link

buechner commented Nov 1, 2020

For me it looks like the packages are automatically read from the xcode project file. This is awesome and unexpected for me. This should be documented.

@stherold
Copy link
Author

stherold commented Nov 2, 2020

Ahhhh I understand. This is possible...

@markusfassbender-parshipgroup

I had an issue with that one too. The app uses a custom Swift Package Utilities that itself has dependencies for example to swift-log. So the tool didn't find those ones itself.

✅ I solved this by using:
--package-path $SRCROOT/<projectname>.xcworkspace/xcshareddata/swiftpm/Package.resolved

⚠️ @stherold your suggestion of $PROJECT_FILE_PATH/project.xcworkspace/ didn't work for me, because this was looking into the project.xcodeproj/project.xcworkspace, that is not the right one. The right xcworkspace is on the same level as the xcodeproj!

@mono0926 mono0926 linked a pull request Apr 9, 2021 that will close this issue
@mono0926
Copy link
Owner

mono0926 commented Apr 9, 2021

@stherold @markusfassbender-parshipgroup

The fix(#150, created by @yosshi4486 🙏) was merged, and 3.0.7 was released.
Is the problem fixed now?

@yosshi4486
Copy link
Contributor

yosshi4486 commented Apr 9, 2021

@stherold @markusfassbender-parshipgroup
Hi. I found that the implementation eventually use Package.resolved even if you specify Package.swift.

func read() throws -> String? {
if path.lastPathComponent != Consts.packageName && path.lastPathComponent != "Package.resolved" {
throw FileReaderError(path: path)
}
if let content = path.deletingPathExtension().appendingPathExtension("resolved").lp.read() {
return content
}
return path.lp.read()

@yosshi4486
Copy link
Contributor

and I've updated README.md.

スクリーンショット 2021-04-09 14 45 59

@markusfassbender-parshipgroup

Yes thank you, this fixes it and also the documentation is much clearer now. Thank you! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants