Created
April 17, 2020 11:11
-
-
Save kalaiselvan369/3a942b6d390c727ab0353f8caa1f4ff6 to your computer and use it in GitHub Desktop.
Project build gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Top-level build file where you can add configuration options common to all sub-projects/modules. | |
| buildscript { | |
| repositories { | |
| google() | |
| jcenter() | |
| } | |
| dependencies { | |
| classpath "com.android.tools.build:gradle:$androidGradlePluginVersion" | |
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" | |
| classpath "com.diffplug.spotless:spotless-plugin-gradle:3.28.1" | |
| } | |
| } | |
| allprojects { | |
| repositories { | |
| google() | |
| jcenter() | |
| } | |
| } | |
| ext { | |
| // query git for the commit count to automate versioning. | |
| gitCommitCount = 100 + | |
| Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim()) | |
| } | |
| // adding pre-commit to .git/hooks directory before app starts building | |
| task installGitHook(type: Copy) { | |
| from new File(rootProject.rootDir, 'pre-commit') | |
| into { new File(rootProject.rootDir, '.git/hooks') } | |
| fileMode 0777 | |
| } | |
| tasks.getByPath('app:preBuild').dependsOn installGitHook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment