Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDEA and how to disable gradle wrapper generation?

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

like image 360
Peter Avatar asked Jun 05 '19 14:06

Peter


People also ask

How disable Gradle build in IntelliJ?

Note that it requires you to have gradlew executable in the project directory (it's there by default when using Android Studio). After the installation you can find "Gradle Stop" button on Main Toolbar and inside Run Menu.

Do I need Gradle wrapper?

To build a Gradle-based project, we need to have Gradle installed in our machine. However, if our installed version doesn't match with the project's version, we'll probably face many incompatibility problems. Gradle Wrapper, also called Wrapper in short, solves this problem.


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.

like image 138
user12769258 Avatar answered Oct 31 '22 12:10

user12769258