Preventing gradle-wrapper.properties from changing all the time

Raniz

We're using the Gradle Wrapper for all of our projects but one of our tools (IntelliJ IDEA) frequently re-runs the wrapper task which changes the first line - a comment about when the file was generated - every time it's run. This change has a tendency to be added to pull requests meaning that there's a high potential for unnecessary merge conflicts.

The proper solution would be to have all developers never check in the file unless it has actually changed in a meaningful way, but developers (me included) can be hasty and forgetful so the file shows up regularly in pull requests.

I've had a few ideas to solve this but can't really decide on any of them.

  1. Make Git ignore the first line of gradle-wrapper.properties like this, feels cumbersome and will have to be done by every developer since it's local.

  2. Add a tail to the gradle wrapper task that removes the first line of gradle-wrapper.properties, feels a bit hackish.

  3. Somehow make IDEA not re-run the wrapper task automatically every time we sync the project, no idea how to do this.

I'm leaning towards 2. right now but I'd like to hear if anyone else have any better ideas.

Raniz

It seems that selecting Use the default Gradle wrapper is the correct option to choose when importing a Gradle project and that Use customizable gradle wrapper (Gradle wrapper customization in script, works with Gradle 1.7 or later) is the option that causes IDEA to re-run the wrapper task all the time.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Gradle version and gradle-wrapper.properties

分類Dev

An issue with preventing users from changing specific document fields in Firestore

分類Dev

Gradleバージョンとgradle-wrapper.properties

分類Dev

Unity3D - Preventing 3D Character from Changing Direction Mid-air

分類Dev

Gradle-Wrapper.Propertiesが存在しません(Cordova)

分類Dev

gradle-wrapper.propertiesが常に変更されないようにする

分類Dev

Android gradle: All buildTypes are getting executed at the same time

分類Dev

Repository credentials work if they're hardcoded, but not if they're from gradle.properties

分類Dev

Preventing GTKMM from catching exceptions

分類Dev

Preventing default on a checkbox doesn't prevent ng-model changing

分類Dev

Cordovaビルドはgradle-wrapper.propertiesファイルのdistributionUrlを変更します

分類Dev

Cordovaビルドはgradle-wrapper.propertiesファイルのdistributionUrlを変更します

分類Dev

Cordovaビルドはgradle-wrapper.propertiesファイルのdistributionUrlを変更します

分類Dev

Intellij IDEAは、gradle-wrapper.propertiesファイルの「i」文字を「ı」のASCIIで上書きします

分類Dev

How to Return Enum objects with all properties from Enum values in Java

分類Dev

Resolving and preventing "The project is using an unsupported version of Gradle" when opening a project

分類Dev

How/when to generate Gradle wrapper files?

分類Dev

Changing date and time on calendar

分類Dev

Why is the time changing?

分類Dev

VueJS watching properties and changing data

分類Dev

Why is @media changing body properties?

分類Dev

Preventing main div from scrolling underneath Header

分類Dev

Frequent GC preventing sparks from running in parallel

分類Dev

Preventing RecyclerView from consuming touch events

分類Dev

Preventing thread from duplicate processing in java

分類Dev

Preventing IE / Edge from preloading video

分類Dev

Preventing users from altering default privileges on PostgreSQL

分類Dev

Preventing discord bot from crashing (mysql)

分類Dev

preventing certain docs from being indexed in clucene

Related 関連記事

  1. 1

    Gradle version and gradle-wrapper.properties

  2. 2

    An issue with preventing users from changing specific document fields in Firestore

  3. 3

    Gradleバージョンとgradle-wrapper.properties

  4. 4

    Unity3D - Preventing 3D Character from Changing Direction Mid-air

  5. 5

    Gradle-Wrapper.Propertiesが存在しません(Cordova)

  6. 6

    gradle-wrapper.propertiesが常に変更されないようにする

  7. 7

    Android gradle: All buildTypes are getting executed at the same time

  8. 8

    Repository credentials work if they're hardcoded, but not if they're from gradle.properties

  9. 9

    Preventing GTKMM from catching exceptions

  10. 10

    Preventing default on a checkbox doesn't prevent ng-model changing

  11. 11

    Cordovaビルドはgradle-wrapper.propertiesファイルのdistributionUrlを変更します

  12. 12

    Cordovaビルドはgradle-wrapper.propertiesファイルのdistributionUrlを変更します

  13. 13

    Cordovaビルドはgradle-wrapper.propertiesファイルのdistributionUrlを変更します

  14. 14

    Intellij IDEAは、gradle-wrapper.propertiesファイルの「i」文字を「ı」のASCIIで上書きします

  15. 15

    How to Return Enum objects with all properties from Enum values in Java

  16. 16

    Resolving and preventing "The project is using an unsupported version of Gradle" when opening a project

  17. 17

    How/when to generate Gradle wrapper files?

  18. 18

    Changing date and time on calendar

  19. 19

    Why is the time changing?

  20. 20

    VueJS watching properties and changing data

  21. 21

    Why is @media changing body properties?

  22. 22

    Preventing main div from scrolling underneath Header

  23. 23

    Frequent GC preventing sparks from running in parallel

  24. 24

    Preventing RecyclerView from consuming touch events

  25. 25

    Preventing thread from duplicate processing in java

  26. 26

    Preventing IE / Edge from preloading video

  27. 27

    Preventing users from altering default privileges on PostgreSQL

  28. 28

    Preventing discord bot from crashing (mysql)

  29. 29

    preventing certain docs from being indexed in clucene

ホットタグ

アーカイブ