mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 03:57:51 +02:00
Defer python discovery until presubmit task (#1352)
* Customize LGTM build command Our presubmit requires a version of python that is more recent than what lgtm.com's build environments have installed. Instead of trying to upgrade them or downgrade our python version, just do the steps of the build that LGTM needs (i.e. just build the main classes and test classes).
This commit is contained in:
parent
fff63e3b2a
commit
c8e51b0e53
1 changed files with 15 additions and 12 deletions
27
build.gradle
27
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 = []
|
||||
|
|
Loading…
Add table
Reference in a new issue