Valkyrie - SVG/XML to ImageVector 0.10.0 brings co...
# feed
y
Valkyrie - SVG/XML to ImageVector 0.10.0 brings conversion improvements: โ€ข paste icon from clipboard โ€ข allow to rename icon and preview ImageVector result More updates: https://github.com/ComposeGears/Valkyrie/releases/tag/0.10.0
๐Ÿ™Œ๐Ÿพ 1
๐Ÿ™Œ 8
e
Is it available as a command line app? ๐Ÿ‘€ Also is this based on the same SVG conversion code from AndroidX or its custom?
y
@efemoney CLI will be a part of next release. Conversion is custom to make ImageVector clean and pretty print with skipping default params
K 1
๐Ÿ’ฏ 1
e
Great! Asking bc the androidx one does an intermediate svg -> vd xml -> iv, started on one to do it directly, glad I do not have to finish it ๐Ÿ˜…
s
Valkyrie is a great time saver with the integration into IDEA. Used it a lot already. Thanks for making it! ๐Ÿ™‚
โค๏ธ 1
y
Thanks for your appreciation)
e
I see 0.11 is getting close to release with the CLI. Just want to add that if its not a lot of hassle, please publish the cli module to some maven repo, so we can get & run it from a Gradle / Maven build. If its not possible its totally fine ๐Ÿ™‚, itโ€™ll just be slightly less convenient ie we will need custom build logic to download the zip from gh releases Thanks for the work on this!
โค๏ธ 1
y
Hello, sure Also will be available on brew Thanks for suggestion ๐Ÿ™‚
๐Ÿ’ฏ 1
thank you color 1
@efemoney could you please share some usage example?
e
One usage will be to replace svg2compose gradle plugin, ie
Copy code
dependencies {
  implementation("valkyrie:cli:X.X.X")
}

// In code
Valkyrie.run(
  inputDir = File("/my/svgs/etc"),
  ... other valkyrie options available on the command line
)
OR if published dependency jar is not possible, normal cli jar/zip will still work ๐Ÿ‘๐Ÿพ
Copy code
// download valkyrie-cli and unzip

./valkyrie --input-dir="/my/svgs/etc" ...other valkyrie options
If packaged jar then it should have the same entry point as on the CLI, supporting the same options
y
Well, the first code snipped mostly related to library behavior. CLI is a binary that can be executed in terminal. I will add a small .sh script into Readme to download the latest cli from releases. Also, the next step will be a gradle plugin ๐ŸŒš
๐Ÿ‘๐Ÿพ 1
e
Sweeeet, thanks!
Great! Asking bc the androidx one does an intermediate svg -> vd xml -> iv
Just cloned the project (amazing) and found out it also uses androidx under the hood so
SVG -> VectorDrawable -> IR -> ImageVector
just correcting my statement as earlier I thought you did the parsing manually from svg. Also, sharing my use case: Since there isnt a Gradle Plugin or JVM lib yet & I need access to IR (so I can do some transformations eg add
autoMirror
to specifc icons), I am cloning & publishing to local folder in my project. I am planning to run
SvgXmlParser.toIrImageVector(...)
, do some custom logic on the IR, then eventually convert that to image vector that I will write out. Looking good so far ๐Ÿ’š
๐ŸŒš 1
@Yahor let me know where I can share some feedback here (want to discuss first before creating issues)
y
@efemoney Soon we will have kmp parser in Valkyrie https://github.com/LennartEgb/vec2compose/issues/110