Each Wrapper is tied to a specific version of Gradle, so when you first run one of the commands above for a given Gradle version, it will download the corresponding Gradle distribution and use it to execute the build.
Not only does this mean that you don’t have to manually install Gradle yourself, but you are also sure to use the version of Gradle that the build is designed for. This makes your historical builds more reliable
Currently, there is no support for the wrapper, and the commit fails if gradle isn't installed on the path. Can this be added so that projects can continue to be self contained?
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to C:\Users\jirvine/.cache\pre-commit\patch1579904329.
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing build.gradle
Check JSON...........................................(no files to check)Skipped
Check Yaml...............................................................Passed
Check for added large files..............................................Passed
Terraform fmt........................................(no files to check)Skipped
gradle check.............................................................Failed
- hook id: gradle-check
- exit code: 1
Traceback (most recent call last):
File "c:\python37\Lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python37\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\jirvine\.cache\pre-commit\repoju3qot9q\py_env-python3.7\Scripts\gradle-check.exe\__main__.py", line 7, in <module>
File "c:\users\jirvine\.cache\pre-commit\repoju3qot9q\py_env-python3.7\lib\site-packages\pre_commit_hooks\gradle_check.py", line 24, in main
cmd_output(cmd, 'check')
File "c:\users\jirvine\.cache\pre-commit\repoju3qot9q\py_env-python3.7\lib\site-packages\pre_commit_hooks\util.py", line 29, in cmd_output
raise CalledProcessError(cmd, retcode, proc.returncode, stdout, stderr)
pre_commit_hooks.util.CalledProcessError: (('gradle', 'check'), 0, 1, '', b"'gradle' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n")
gradle spotless..........................................................Failed
- hook id: gradle-spotless
- exit code: 1
Traceback (most recent call last):
File "c:\python37\Lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python37\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\jirvine\.cache\pre-commit\repoju3qot9q\py_env-python3.7\Scripts\gradle-spotless.exe\__main__.py", line 7, in <module>
File "c:\users\jirvine\.cache\pre-commit\repoju3qot9q\py_env-python3.7\lib\site-packages\pre_commit_hooks\gradle_spotless.py", line 25, in main
cmd_output(cmd, 'spotlessJavaCheck', 'spotlessJavaApply')
File "c:\users\jirvine\.cache\pre-commit\repoju3qot9q\py_env-python3.7\lib\site-packages\pre_commit_hooks\util.py", line 29, in cmd_output
raise CalledProcessError(cmd, retcode, proc.returncode, stdout, stderr)
pre_commit_hooks.util.CalledProcessError: (('gradle', 'spotlessJavaCheck', 'spotlessJavaApply'), 0, 1, '', b"'gradle' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n")
[WARNING] Stashed changes conflicted with hook auto-fixes... Rolling back fixes...
[INFO] Restored changes from C:\Users\jirvine/.cache\pre-commit\patch1579904329.
A prominent feature of gradle is the wrapper:
Currently, there is no support for the wrapper, and the commit fails if gradle isn't installed on the path. Can this be added so that projects can continue to be self contained?
.pre-commit-config.yaml
git commit
output: