Search code examples
gradlegradle-kotlin-dsl

Change name of given package on build


I have a Java project compiled with gradle (Kotlin DSL build.gradle.kts)

I want to Change in all of my Class present on src this occurence "v1_16_R3" to "v1_11_R1"

Usualy a build my plugin with the normal version v1_16_R3. But i have create another build.gradle.kts for the 1.11 version, for not duplicate my repository.

Regards, Lucas.


Solution

  • Usually, a IDE will have some form of tool that automates this process.

    For example, if you are using JetBrains IDEA as your IDE, follow theses steps:

    1. Press Ctrl+Shift+H or select Edit | Find | Replace in Path from the main menu.
    2. In the Replace In Path dialog, specify the search and replace strings, search options, and the scope.
    3. Click Replace All to replace all matching occurrences or Replace to replace items one by one.