IDEA and how to disable gradle wrapper generation?

Viewed 1587

I am new to IJ IDEA and Gradle KTS.

I created the kts by hand and imported it into IJ. IDEA has generated the gradle wrapper, but I do not want this. If I delete the gradle wrapper and associated directory, IDEA prompts me to 'import changes' from gradle, which then creates the gradle wrapper again...

My question is how to prevent this behavior? ie prevent gradle wrapper generation?

I found documentation for the Wrapper task, and the option to point to a local install using distributionUrl. But that doesnt seem to prevent the generation of the gradle wrapper, only bypass the download...

Also I can not find any options in IDEA to disable this behavior.

btw I do understand the benefits of the wrapper.

Thanks.

IntelliJ IDEA EAP 2019.2 macOS 10.12.4 gradle 5.2.1 kotlin DSL 1.1.3

1 Answers

Disabling access to the download directory seems to work:

mkdir -p ~/.gradle/wrapper/dists && chmod -rwx ~/.gradle/wrapper/dists

Note that this prevents the wrapper to work at all (which is exactly what I want) and causes error messages, but as far as I can see it does the job and the project simply has to be configured to use the system gradle distribution after import.

Related