R.swift icon indicating copy to clipboard operation
R.swift copied to clipboard

Resources from package as input for generators

Open VrabelJannn opened this issue 1 year ago • 1 comments

we are using terminal command base R.Swift solution like this in our build phase:

swift run -c release rswift generate --accessLevel public --generators image,string,color,font,file "$SRCROOT/someOutputPath/R.generated.swift"

Is it possible to make R.Swift work with resources inside packages as input for the generating process? Let's say we have a package named UIToolkit in the project where we have assets that we want to use as input for the generated file.

For example, the hierarchy would look like this:

image

We are able to set the output path to this package, but we haven't found a way to specify that the assets in UIToolkit should be added to the generated output. Any ideas?

thnx a lot for any suggestions, help

VrabelJannn avatar Jul 14 '23 14:07 VrabelJannn

You can call the rswift executable with either an Xcode project file, or a list of files:

rswift generate R.generated.swift --input-type xcodeproj --xcodeproj MyApp.xcodeproj
rswift generate R.generated.swift --input-type input-files --input-files Assets.xcassets Localised.strings

tomlokhorst avatar Sep 10 '23 20:09 tomlokhorst