Skip to content

Commit 3817350

Browse files
committed
Use project gradlew to build examples
1 parent 3b9b600 commit 3817350

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

scripts/test-examples.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,19 @@ def infer_build_file(project_dir):
106106
return build_file
107107

108108

109+
def infer_gradlew(project_dir):
110+
project_gradlew = os.path.join(project_dir, "gradlew")
111+
if os.path.isfile(project_gradlew):
112+
os.chmod(project_gradlew, 0o755)
113+
Out.info(f"Using project's own gradlew: {project_gradlew}")
114+
return project_gradlew
115+
Out.info(f"Project gradlew not found, falling back to framework gradlew: {gradlew}")
116+
return gradlew
117+
118+
109119
def run_example_build(project_dir):
110-
command = [gradlew, "-p", project_dir, "clean", "check"]
120+
project_gradlew = infer_gradlew(project_dir)
121+
command = [project_gradlew, "-p", project_dir, "clean", "check"]
111122
str_cmd = " ".join(command)
112123
try:
113124
Out.info(f"Running {str_cmd}")

0 commit comments

Comments
 (0)