Search code examples
javagradleintellij-idea

two different settings.gradle file intellij


I have one project, it has a settings.gradle file, I also have a second fred-settings.gradle file that is used in a certain specific builds using a gradle switch '-c'.

How do I tell intellij to only use the non default file : 'fred-settings.gradle'


Solution

  • Actually, you should most probably not use different settings files anyway. This is deprecated in Gradle, besides that the IDE just not (yet?) supports custom settings files.

    You could for example have the logic for both cases in the default settings.gradle(.kts) and then select via project property or any other way which logic-path to follow in the settings script.

    You could then change this condition, e.g. by setting the project property in gradle.properties in your <GRADLE_USER_HOME>, and start the import.