简体   繁体   中英

Android Studio project's Git repository

In my project I have settings.gradle , gradle.properties and gradle-wrapper.properties files. Which of them should be checked in a Git repository?

All of those files should be commited as they all contain information critical to the build environment for the project.

The one exception would be if you needed to create a local.properties file to override or supplement those files on your computer specifically. The Configure your build section of Android Developer site has more information.

Additionally, when in doubt a good rule of thumb is to use a tool like gitignore.io to generate a Git gitignore file. It generally contains sane default rules on which files should be excluded from source control (and thus included).

Better to check all of them

settings.gradle --> This contains information which module should you include and the structure of project. Some plugin like gradle build scan also need to specify here.

gradle.properties --> Sometimes you want to specify JVM arg here, also some flag from android gradle plugin features, for example incremental build, kapt features, gradle flag feature (like configuration cache) etc.

gradle-wrapper.properties is defined gradle version used in your project. Some plugin may not compatible with other gradle version, so you should check it too in order to make sure everyone using the same version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM