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

[SR-15935] Resource files created by build tool plugins aren't handled properly #4345

Closed
abertelrud opened this issue Mar 2, 2022 · 7 comments
Assignees
Labels

Comments

@abertelrud
Copy link
Contributor

Previous ID SR-15935
Radar rdar://problem/89693335
Original Reporter @abertelrud
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee @abertelrud
Priority Medium

md5: ff3606a8574b3b65ab897c084d6bb004

Issue Description:

In SwiftPM 5.6 and later, package plugin build tools can generate source files by defining build commands that have `.swift` source files as outputs. It is supposed to be possible to generate any of the kinds of output files that SwiftPM can handle, such as resources.

But specifying .strings files or .lproj directories as outputs does not seem to work in SwiftPM 5.6 — `swift` `build` emits a warning that it doesn't know what to do about that kind of file.

This bug report tracks making this work so that for example .strings files can be generated by built too plugins.

@abertelrud
Copy link
Contributor Author

@swift-cicreate

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
@doozMen
Copy link

doozMen commented Feb 22, 2023

I have asked this question too on the forum Can the pluginWorkingDirectory contain an asset catalog - Development / Package Manager - Swift Forums

Would love this to be solved! Any update?

@neonichu
Copy link
Member

This should work as long as tools-version 5.7 or newer is used. Was fixed in #4306

@doozMen
Copy link

doozMen commented Feb 23, 2023

Ok will try again and check the tools version. But xcode 14.3 gives me a warning now that it has no rule applied for the json files in my asset catalog. Maybe an Xcode thing then.

@neonichu
Copy link
Member

Right, I believe that's the tools-version < 5.7 behavior. If this isn't the issue, please report back, this should be working in both SwiftPM CLI and Xcode at this point.

@doozMen
Copy link

doozMen commented Feb 24, 2023

Ok so I have tested it and it works with version 5.7! Thanks a lot for your detailed help @neonichu ! This will help me a lot thank you.

@doozMen
Copy link

doozMen commented Feb 24, 2023

@neonichu I did discover via #4306 that you need to use a prebuild comand and not a build command. I would like this tool not to run all the time. But I will continue this in the swift forum. https://forums.swift.org/t/can-the-pluginworkingdirectory-contain-an-asset-catalog/63284

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

No branches or pull requests

4 participants