Closed JulesMoorhouse closed 6 months ago
Xcode 15.3 introduces the 3rd version of the Package.resolved
format. 3.1.0 added support for that in #73 and also changed the error message to indicate the (unsupported) version it received. Your error indicates that you still use 3.0.10 so please make sure you have it correctly installed. You can also give the SPM plugin a shot instead of the manual run script phase, this eliminates any local installation issue automatically, see #build-tool-plugin. Let me know if that helped!
Hmmm, I'm a bit confused as to whats going on.
I reverted back to Xcode 15.2 after I posted earlier and things seemed to be working. However, I didn't go into to acknowledgements screen to see what was being shown.
Before I posted the issue above, I was using Xcode 15.3, and was seeing swift-package-list
4.1.0 in my pacakges, and was getting the error I posted. So what you say confuses me.
Now, I've switched back to 15.3, I'm no longer getting the error, which puzzles me.
I haven't added the build-tool-plugin to my spm, where I'm using swift-package-list
, as I'm a bit confused about what I should add to my package file. I know you have a link the swift forums, but I'm not sure what to add.
Anyways, here's my build phase scripting... which was working previously.
if test -d "/opt/homebrew/bin/"; then
PATH="/opt/homebrew/bin/:${PATH}"
fi
export PATH
if command -v swift-package-list &> /dev/null; then
OUTPUT_PATH=$SOURCE_ROOT/$TARGETNAME
#swift-package-list $PROJECT_FILE_PATH --output-path "$OUTPUT_PATH" --requires-license --file-type plist
#mv "$OUTPUT_PATH/package-list.plist" "$OUTPUT_PATH/../Acknowledgements.plist"
swift-package-list generate "$PROJECT_FILE_PATH" --output-path "$OUTPUT_PATH" --requires-license --file-type plist
else
echo "warning: swift-package-list not installed, https://github.com/FelixHerrmann/swift-package-list"
echo "use brew tap FelixHerrmann/tap"
echo "use brew install swift-package-list"
fi
I've created the file... swift-package-list-config.json
{
"projectPath" : "myapp.xcworkspace",
"project" : {
"outputType" : "plist",
"requiresLicense" : false
},
"targets" : {
"myapp" : {
"outputType" : "plist",
"requiresLicense" : true
}
}
}
I can also see that my package-list.plist
is being updated, but not being changed, git isn't picking up changes, but the file is being modified.
Also, I can't see any of the licenses in my acknowledgements screen.
But I don't have a build error.
As I say I'm a bit confused.
Edit: Now, I've switched back to 15.3, I'm no longer getting the error, which puzzles me. -> Because I have 4.10
It could be the case Xcode 15.2 reverted the Package.resolved format back to v2 and after going to 15.3 it remained like that (I think it only gets upgraded when you trigger an SPM update). Anyways let me clarify the 2 main options you have for you project so you don't mix up things that shouldn't be:
User Script Sandboxing
build settingSwiftPackageListPlugin
to the Run Build Tool Plug-ins
swift-package-list-config.json
in your project's root to configure the pluginI haven't added the build-tool-plugin to my spm, where I'm using swift-package-list, as I'm a bit confused about what I should add to my package file. I know you have a link the swift forums, but I'm not sure what to add.
If you have a normal Xcode project (or workspace) you have to add the plugins via UI:
Thanks for your help. I've got everything working.
There were some changes I wasn't aware of, which weren't immediately apparent.
AcknowledgmentsList(packageProvider: .propertyList())
Also more obvious file-type
to output-type
.
I'm using Xcode 15.3 and the build phase for swift-package-list creates this error
I have the following
Earlier I had the old version 3.0.10, which had the same issue, upgrading didn't help.
Any suggestions please ?
Thanks,
Jules