Prevention of change gradle -wrapper.properties

We use Gradle Wrapper for all of our projects, but one of our tools (IntelliJ IDEA) often re-runs which changes the first line - a comment about when the file was generated - every time it starts. This change tends to add queries to the query, which means high potential for unnecessary merge conflicts.

The correct solution would be to ensure that all developers never check the file unless it actually changed in a meaningful way, but developers (including me) can be hasty and forgetful, so the file is regularly displayed in stretch requests.

I had several ideas to solve this problem, but I can not solve any of them.

  • Make Git ignore the first line of gradle -wrapper.properties, for example, which seems cumbersome and must be run by each developer since it is local.

  • Add a tail to the gradle shell task, which removes the first line of gradle -wrapper.properties, with a little hack.

  • Somehow they force IDEA not to start the shell task automatically every time the project is synchronized, I don’t know how to do it.

I am leaning towards 2. right now, but I would like to hear if anyone has any other ideas.

+6
source share
1 answer

It seems that choosing Use a standard Gradle shell is the right option to select when importing a Gradle project and that uses a custom Gradle shell (Gradle shell customization in a script), works with Gradle 1.7 or later) - this is an option that forces IDEA to re-run the shell task all the time.

+7
source

All Articles