1414[ ![ CLI release] [ badge:cli-release ]] [ url:gh-releases ]
1515[ ![ Homebrew] [ badge:homebrew ]] [ url:homebrew ]
1616
17+ <!-- [![Gradle Plugin Portal][badge:gradle-plugin]][url:gradle-plugin] -->
18+
1719[ ![ Telegram] [ badge:telegram-invite ]] [ url:telegram-invite ]
1820[ ![ Slack] [ badge:slack-invite ]] [ url:slack-invite ]
1921![ Test coverage] [ badge:coverage ]
6365 - [ ` svgxml2imagevector ` command] ( #svgxml2imagevector-command )
6466 - [ ` changelog ` command] ( #changelog-command )
6567 - [ Build] ( #build-cli )
68+ - 🐘 [ Gradle plugin] ( #gradle-plugin )
69+ - [ Common scenarios] ( #common-scenarios )
70+ - [ Plugin configuration] ( #plugin-configuration )
6671- [ Other] ( #other )
6772 - [ Export formats] ( #export-formats )
6873 - [ Comparison with other solutions] ( #comparison-with-other-solutions )
@@ -86,12 +91,12 @@ needs.
8691
8792### Available tools:
8893
89- - [ IntelliJ IDEA / Android Studio plugin] ( #idea-plugin )
90- - [ CLI tool] ( #cli-tool )
91- - Gradle plugin (🚧 waiting to publish 🚧)
94+ - 🔌 [ IntelliJ IDEA / Android Studio plugin] ( #idea-plugin )
95+ - 🖥️ [ CLI tool] ( #cli-tool )
96+ - 🐘 [ Gradle plugin] ( #gradle-plugin ) (🚧 waiting to publish 🚧)
9297- Web app (🚧 under development 🚧)
9398
94- ## IDEA Plugin
99+ ## 🔌 IDEA Plugin
95100
96101### Plugin features
97102
@@ -236,7 +241,7 @@ folder
236241
237242or run plugin in IDE using: ` ./gradlew runIde `
238243
239- ## CLI tool
244+ ## 🖥 CLI tool
240245
241246CLI tools can be easily integrated into scripts and automated workflows, allowing you to convert icons from specific
242247source with predefined settings.
@@ -297,7 +302,7 @@ A part of the CLI tool that allows you to create an icon pack with nested packs.
297302
298303Usage:
299304
300- ``` bash
305+ ``` text
301306./valkyrie iconpack [<options>]
302307```
303308
@@ -315,7 +320,7 @@ A part of the CLI tool that allows you to convert SVG/XML files to ImageVector.
315320
316321Usage:
317322
318- ``` bash
323+ ``` text
319324./valkyrie svgxml2imagevector [<options>]
320325```
321326
@@ -352,6 +357,100 @@ Output example:
352357Run ` ./gradlew buildCLI ` to build minified version of CLI tool. Artifact will be available in
353358` tools/cli/build/distributions/valkyrie-cli-*.**.*-SNAPSHOT.zip ` .
354359
360+ ## 🐘Gradle plugin
361+
362+ The Gradle plugin automates the conversion of SVG/XML files to Compose ImageVector format during the build process. It's
363+ ideal for projects that need to version control icon sources and generate type-safe Kotlin code automatically.
364+
365+ ### Common scenarios
366+
367+ - ** Team collaboration** : Keep SVG/XML sources in version control and let the build system generate Kotlin code for
368+ everyone
369+ - ** CI/CD pipelines** : Ensure icons are always generated consistently across different environments
370+ - ** Design system integration** : Automatically sync icon updates from design tools without manual conversion
371+ - ** Large icon libraries** : Efficiently manage hundreds or thousands of icons with minimal manual intervention
372+
373+ ### Plugin configuration
374+
375+ #### 1. Apply the plugin
376+
377+ <!-- [![Gradle Plugin Portal][badge:gradle-plugin]][url:gradle-plugin] -->
378+
379+ Define in your libs.versions.toml:
380+
381+ ``` toml
382+ [plugins ]
383+ valkyrie = " io.github.composegears.valkyrie:latest-version"
384+ ```
385+
386+ Add the plugin to your ` build.gradle.kts ` :
387+
388+ ``` kotlin
389+ plugins {
390+ alias(libs.plugins.valkyrie)
391+ }
392+ ```
393+
394+ #### 2. Configure the plugin
395+
396+ ``` kotlin
397+ valkyrie {
398+ // Required: Package name for generated code
399+ // Defaults to Android 'namespace' if Android Gradle Plugin is applied
400+ packageName = " com.example.app.icons"
401+
402+ // Optional: Icon pack configuration
403+ iconPackName = " AppIcons" // Creates an icon pack object (unset by default)
404+ nestedPackName = " Filled" // For nested packs like AppIcons.Filled (unset by default)
405+
406+ // Optional: Resource directory name containing icon files (default: "valkyrieResources")
407+ // Icons will be discovered in src/{sourceSet}/{resourceDirectoryName}/
408+ // Example: src/commonMain/valkyrieResources/, src/androidMain/valkyrieResources/
409+ resourceDirectoryName = " valkyrieResources"
410+
411+ // Optional: Output format for generated ImageVectors (default: BackingProperty)
412+ outputFormat = OutputFormat .BackingProperty // or OutputFormat.LazyProperty
413+
414+ // Optional: Code generation settings
415+ useComposeColors = true // Use androidx.compose.ui.graphics.Color (default: true)
416+ generatePreview = false // Generate @Preview composable functions (default: false)
417+ previewAnnotationType = PreviewAnnotationType .AndroidX // AndroidX or Jetbrains (default: AndroidX)
418+ useFlatPackage = false // Generate flat package structure without subfolders (default: false)
419+ useExplicitMode = false // Add explicit visibility modifiers (default: false)
420+ addTrailingComma = false // Add trailing commas in generated code (default: false)
421+ indentSize = 4 // Number of spaces for indentation (default: 4)
422+
423+ // Optional: Custom output directory (default: build/generated/sources/valkyrie)
424+ outputDirectory = layout.buildDirectory.dir(" generated/valkyrie" )
425+
426+ // Optional: Generate during IDE sync for better developer experience (default: false)
427+ generateAtSync = false
428+ }
429+ ```
430+
431+ #### 3. Organize your icons
432+
433+ Place your icon files in the resources directory:
434+
435+ ``` text
436+ src/
437+ └── commonMain/
438+ └── valkyrieResources/
439+ ├── add.svg
440+ ├── delete.svg
441+ └── ic_home.xml
442+ ```
443+
444+ The plugin automatically discovers icons from ` src/{sourceSet}/valkyrieResources/ ` in all source sets.
445+
446+ #### 4. Run generation
447+
448+ Run the Gradle task to generate ImageVector sources:
449+
450+ ``` bash
451+ ./gradlew generateValkyrieImageVector
452+ ```
453+
355454## Other
356455
357456### Export formats
@@ -618,21 +717,21 @@ CLI options `--iconpack-name` and `--nested-packs` removed in favour of `--iconp
618717
619718Single pack
620719
621- ```
720+ ``` text
622721❌ ./valkyrie --iconpack-name=ValkyrieIcons
623722```
624723
625- ```
724+ ``` text
626725✅ ./valkyrie --iconpack=ValkyrieIcons
627726```
628727
629728Nested packs
630729
631- ```
730+ ``` text
632731❌ ./valkyrie --iconpack-name=ValkyrieIcons --nested-packs=Colored,Filled
633732```
634733
635- ```
734+ ``` text
636735✅ ./valkyrie --iconpack=ValkyrieIcons.Colored,ValkyrieIcons.Filled
637736```
638737
@@ -652,7 +751,7 @@ Thank you for your contributions and support! ❤️
652751
653752## License
654753
655- ```
754+ ``` text
656755Developed by ComposeGears 2024
657756
658757Licensed under the Apache License, Version 2.0 (the "License");
@@ -676,6 +775,8 @@ limitations under the License.
676775
677776[ badge:homebrew ] : https://img.shields.io/badge/homebrew-tap-orange?style=for-the-badge&labelColor=black&color=white&logo=homebrew
678777
778+ <!-- [badge:gradle-plugin]: https://img.shields.io/gradle-plugin-portal/v/io.github.composegears.valkyrie?style=for-the-badge&labelColor=black&color=white&label=Gradle%20Plugin -->
779+
679780[ badge:marketplace-downloads ] : https://img.shields.io/jetbrains/plugin/d/24786.svg?style=for-the-badge&labelColor=black&color=white
680781
681782[ badge:marketplace-rating ] : https://img.shields.io/jetbrains/plugin/r/rating/24786?style=for-the-badge&labelColor=black&color=white
@@ -694,6 +795,8 @@ limitations under the License.
694795
695796[ url:homebrew ] : https://github.com/ComposeGears/homebrew-repo
696797
798+ <!-- [url:gradle-plugin]: https://plugins.gradle.org/plugin/io.github.composegears.valkyrie -->
799+
697800[ url:telegram-invite ] : https://t.me/composegears
698801
699802[ url:slack-invite ] : https://join.slack.com/t/composegears/shared_invite/zt-2noleve52-D~zrFPmC1cdhThsuQUW61A
0 commit comments