exclude

abstract fun exclude(vararg patterns: Regex)(source)

Excludes icons based on their file names matching the given patterns from the generation process.

Considering the following plugin configuration:

svgToCompose {
processor {
val outlined by creating {
val themePackage = "my.awesome.app.theme"
from(rootProject.layout.projectDirectory.dir("assets/icons"))
destinationPackage("$themePackage.icons.outlined")
optimize(false)
icons {
theme("$themePackage.MyAwesomeAppTheme")
exclude("""[^/]+_filled(_*)[^/]+""".toRegex())
}
}
}
}

In this example, any SVG or XML file inside the assets/icons folder containing _filled in its name will be excluded from the generation process. Files like ic_home_filled.svg would be excluded, while files like ic_home.svg or ic_search_outlined.svg would be included and considered as 'outlined' icons.

Parameters

patterns

Regex patterns used to match against SVG or XML file names to exclude them from the generation process.