Skip to content

Commit 37027f9

Browse files
authored
Merge pull request #83 from WebFuzzing/mvn_version_pull_request
Mvn version pull request
2 parents 186c2ac + 1cbd3b4 commit 37027f9

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

jdk_11_gradle/gradlew

100644100755
File mode changed.

jdk_17_gradle/gradlew

100644100755
File mode changed.

scripts/dist.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,18 @@ def checkMavenVersion():
2929
match = re.search(MAVEN_VERSION_REGEX, mvn_path)
3030
if match == None:
3131
print("\nCannot determine mvn version from its path location: " + mvn_path)
32-
# might happen depending on installation path... instead of crashing immediately,
33-
# we try to build, as it might be the correct version... if not, it will fail anyway
34-
# TODO ideally, should rather use "mvn -v" to determine the version number...
35-
# although it would be bit tricky to implement (so not super important)
36-
return True
37-
# exit(1)
32+
33+
# use mcn -v
34+
print("\nTrying mvn -v to retrieve the version")
35+
36+
version_res = run([mvn_path, "-v"], capture_output=True, text=True)
37+
result_out = version_res.stdout.strip()
38+
match = re.search(MAVEN_VERSION_REGEX, result_out)
39+
40+
if match == None:
41+
print("\nVersion could not be retrieved with mvn -v command as well")
42+
# might happen depending on installation path... instead of crashing immediately,
43+
return True
3844

3945
mvn_txt = match.group()
4046
mvn_version = mvn_txt.split(".")
@@ -238,6 +244,9 @@ def build_jdk_11_gradle():
238244
command = "gradlew"
239245

240246
if platform.system() == "Darwin":
247+
# make sure gradlew command is executable
248+
os.system("chmod +x " + os.getcwd() + "/" + folder + "/gradlew")
249+
241250
command = "./gradlew"
242251

243252
gradleres = run([command, "build", "-x", "test"], shell=SHELL, cwd=os.path.join(PROJ_LOCATION, folder),
@@ -263,6 +272,10 @@ def build_jdk_17_gradle():
263272
command = "gradlew"
264273

265274
if platform.system() == "Darwin":
275+
276+
# make sure gradlew command is executable
277+
os.system("chmod +x " + os.getcwd() + "/" + folder + "/gradlew")
278+
266279
command = "./gradlew"
267280

268281
gradleres = run([command, "build", "-x", "test"], shell=SHELL, cwd=os.path.join(PROJ_LOCATION, folder),

0 commit comments

Comments
 (0)