diff --git a/build.gradle b/build.gradle index 6e5465623..3c17d6f20 100644 --- a/build.gradle +++ b/build.gradle @@ -209,19 +209,22 @@ rootProject.ext { task runPresubmits(type: Exec) { - // Find a python version greater than 3.7.3 (this is somewhat arbitrary, we - // know we'd like at least 3.6, but 3.7.3 is the latest that ships with - // Debian so it seems like that should be available anywhere). - def MIN_PY_VER = 0x3070300 - if (pyver('python') >= MIN_PY_VER) { - executable 'python' - } else if (pyver('/usr/bin/python3') >= MIN_PY_VER) { - executable '/usr/bin/python3' - } else { - throw new GradleException("No usable Python version found (build " + - "requires at least python 3.7.3)"); - } args('config/presubmits.py') + + doFirst { + // Find a python version greater than 3.7.3 (this is somewhat arbitrary, we + // know we'd like at least 3.6, but 3.7.3 is the latest that ships with + // Debian so it seems like that should be available anywhere). + def MIN_PY_VER = 0x3070300 + if (pyver('python') >= MIN_PY_VER) { + executable 'python' + } else if (pyver('/usr/bin/python3') >= MIN_PY_VER) { + executable '/usr/bin/python3' + } else { + throw new GradleException("No usable Python version found (build " + + "requires at least python 3.7.3)"); + } + } } def javadocSource = []