Files
codeql/java/ql/integration-tests/java/partial-gradle-sample-without-gradle/test.py
Cornelius Riemenschneider 321820e758 Java: Rename integration test directories.
We are no longer bound to the platform-specific directories, so simplify the test organization.
If you don't want this change, just skip merging this PR. It's purely optional.

I kept the platform-specific directories around under `kotlin`,
but you could also easily merge all these together if you find them unhelpful.
I'll leave that change to you.
2024-08-30 10:28:25 +02:00

18 lines
542 B
Python

import tempfile
import runs_on
import pathlib
# The version of gradle used doesn't work on java 17
def test(codeql, use_java_11, java, environment):
gradle_override_dir = pathlib.Path(tempfile.mkdtemp())
if runs_on.windows:
(gradle_override_dir / "gradle.bat").write_text("@echo off\nexit /b 2\n")
else:
gradlepath = gradle_override_dir / "gradle"
gradlepath.write_text("#!/bin/bash\nexit 1\n")
gradlepath.chmod(0o0755)
environment.add_path(gradle_override_dir)
codeql.database.create()