Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass gradle parameter on IntelliJ sync

EDIT:

Turns out it was not a bug but misconfiguration on my part.

Original question

Due to this bug in IntelilJ I have to add

configurations {
    all {
        exclude(group = "ch.qos.logback", module = "logback-classic")
    }
}

during IntelliJ gradle sync and then not forget to remove it.

Is there a way to pass a param to gradle on IntelliJ sync? I'd be able to have something like this:

if (project.hasProperty("intellijHack"))
    configurations {
        all {
            exclude(group = "ch.qos.logback", module = "logback-classic")
        }
    }
like image 832
Czar Avatar asked Oct 17 '22 03:10

Czar


1 Answers

Passing command line options to IDE gradle importer process directly in IDE is not yet supported (only possible to a Gradle task Run Configuration with the 'Script parameters' field). Please vote and follow this request.

It should work with the gradle.properties file, though this property will also be honored by Gradle, launched from the command line.

like image 187
Andrey Avatar answered Oct 21 '22 08:10

Andrey