gradle import failed when custom init.gradle file were used

after customing gradlew to use my own init.gradle and succesffuly run gradle tasks from command line (the purpose is to resue some gradle buildscript block), The importing to intellij failed badly.
After some research, I discovered that during the import, inetllij override my own init.gradle (through custome gradlew by adding "-I my_own_init.gradle" in the tail end) with following trace in the log file

INFO - .project.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: [--init-script, /private/var/folders/dw/t1yj061s3gq_jhrcnfj858mh0000gp/T/wrap1.gradle]

that made intellij not usable in the project.

Anything that I can do to solve this problem?
Thanks

3 comments
Comment actions Permalink

just checked the gradle doc:
https://docs.gradle.org/current/userguide/init_scripts.html

...If more than one init script is found they will all be executed, in the order specified above. Scripts in a given directory are executed in alphabetical order.

so the override might not the an issue, the issue is that why my custom gradlew not being used ?
Thanks

0
Comment actions Permalink

This is still an issue for me, its not picking up my init script in `project_folder/init.d/myinit.gradle`

0

Please sign in to leave a comment.