Skip to content

Commit

Permalink
fix: fixes java version matching for gradle when only major version p…
Browse files Browse the repository at this point in the history
…rovided (#104) (#110)
  • Loading branch information
lost-name authored and sanathkr committed Apr 9, 2019
1 parent 57d1181 commit a58cfa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def validated_binary_path(self):
def _get_major_version(self, gradle_path):
vs = self._get_jvm_string(gradle_path)
if vs:
m = re.search(r'JVM:\s+(\d.*)', vs)
m = re.search(r'JVM:\s+([\d\.]+)', vs)
version = m.group(1).split('.')
# For Java 8 or earlier, version strings begin with 1.{Major Version}
if version[0] == '1':
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/workflows/java_gradle/test_gradle_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def setUp(self, MockOSUtils):
@parameterized.expand([
'1.7.0',
'1.8.9',
'11.0.0'
'11.0.0',
'12 (Fluff)',
'12'
])
def test_accepts_any_jvm_mv(self, version):
version_string = ('JVM: %s' % version).encode()
Expand Down

0 comments on commit a58cfa6

Please sign in to comment.