rename

fun rename(pattern: String, replacement: String)

Renames any classes or resources that match the provided pattern.

The pattern will match class names resource paths, with optional wildcards:

  • * will match a single package component or path part.

  • ** will match against the remainder of any valid fully-qualified class name or resource path.

replacement is a class or resource path which can optionally reference the substrings matched by the wildcards. A numbered reference is available for every wildcard in the pattern, starting from left to right: @1, @2, etc. A special @0 reference contains the entire matched class name or resource path.