-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add Swift package plugins support #212
Conversation
This reverts commit 8edad30.
This is great and thank you so much! 🥳 I would also suggest to update the Readme.md as this will probably be the future way to go. E.g. there is still
listed while further down there is a section on how to use it with SPM. If this really works well then I'd suggest to move it to the top and recommend SPM integration. |
Even with this PR, And LicensePlist is most helpful for iOS/macOS projects, right? Because the guidelines tell us to provide the acknowledgments somehow. I may be missing a case when acknowledgments are required for a package. Then it'll need a few lines of code to support SPM. |
I was just trying to use this new feature in one of our projects and I think the binary that is included with the SPM package isn't built correctly for Intel macs. If I run the "GenerateAcknowledgementsCommand" manually I can see an error in Xcode with: "Bad CPU type in executable". And I get the same error if I try and run the binary manually from terminal. I tried copying the portable binary from the releases page and replacing the included one with that. This one seems to be working fine. |
@r00li Hi. Could you create a new issue for it? |
No problem. Issue created. |
@vladvlasov256 apologies for the long silence but I am currently working on a release and had no time yet to further investigate. Back then I tried to set it up with the new plugin and failed, maybe because of the same reason as @r00li. I ran out of time and could not yet try it again. Nevertheless, I guess this was a misunderstanding. I thought that in general LicensePlist doesn't support SPM. Maybe it was is the phrasing or I read all too fast. Of course, this lib only makes sense in applications and not packages. Thanks for your amazing work! I just dropped the project a donation, enjoy your 🍺 , ☕ or 🍵 ! |
@vladvlasov256 Thanks for the Plugin support. Generated path:
Copy from:
Is the script generated by |
Hi @Econa77 Xcode plugins produce outputs in their sandboxes. In the case of LicensePlist it happens in: Next, in the build log you can see a message:
Xcode copies the result folder to the app folder. The path is: This happens automatically. So whatever a plugin generates Xcode copies as is to the result app folder. And this is a reason why Thus |
@vladvlasov256 I understand. Thank you for your explanation. My mistake seems to have been an error because I deleted |
Description
This PR adds three Swift package plugins for LicensePlist.
Build Tool Plugin
LicensePlistBuildTool
allows using LicensePlist in "Run Build Tool Plug-ins" section in project build phases.Build tool plugins operate with product build directory files. For a common use case with
Settings.bundle
, it's impossible just to specify the output directory. An additional step is running a script in build phases that copy acknowledgments files:To simplify the build tool plug-in setup,
AddAcknowledgementsCopyScriptCommand
has been added.AddAcknowledgementsCopyScriptCommand
AddAcknowledgementsCopyScriptCommand
automatically adds the script to copy files toSettings.bundle
. The command is accessible in the project contextual menu and in theFile
->Packages
menu.GenerateAcknowledgementsCommand
Unlike automatic build phases,
GenerateAcknowledgementsCommand
allows users to manually run LicensePlist from Xcode.Fixes
AddAcknowledgementsCopyScriptCommand.swift
to add a build phase to target build phases,xcodeproj
files,sandboxMode
parameter to check thatpackageSourcesPath
specified,GeneralOptions
to relative URLs,A few notes for @mono0926
The plugins depend on a binary artifact with the new functionality. Thus when PR is ready it will require you to upload a new artifact and update the binary target definition. Hopefully, it should work automatically with the release script.
Also, the previous issue exists with
testInit_sample()
because it depends on a new config example. Should be fixed automatically after the merge.Link to an uploaded artifact from my branch for test purposes: