Created
January 23, 2019 01:44
-
-
Save rflpazini/a55aaeb18b63e9270fb0cbf536dce9ff to your computer and use it in GitHub Desktop.
Build gradle for apply git hooks with google java style guide formatter
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
plugins { | |
id 'com.github.sherter.google-java-format' version '0.8' | |
} | |
googleJavaFormat { | |
options style: 'GOOGLE' | |
} | |
task installGitHooks(type: Copy) { | |
into (rootProject.rootDir) | |
into (new File('.git/hooks')) { | |
from(rootProject.rootDir, 'scripts/') | |
include('pre-commit.sh') | |
rename { String fileName -> | |
fileName.replace("pre-commit.sh", "pre-commit") | |
} | |
fileMode 0777 | |
} | |
into (new File('.git/hooks')) { | |
from(rootProject.rootDir, 'scripts/') | |
include('post-commit.sh') | |
rename { String fileName -> | |
fileName.replace("post-commit.sh", "post-commit") | |
} | |
fileMode 0777 | |
} | |
} | |
build.dependsOn installGitHooks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment