Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce compatibility with JDK 8 when compiling on later JDKs #1909

Merged
merged 9 commits into from
Aug 23, 2024

Conversation

bartekpacia
Copy link
Contributor

@bartekpacia bartekpacia commented Aug 12, 2024

follow-up of #1880

aimed at #1801

With these changes I aim to:

  • make it possible to build Maestro on all Java 11 and higher. Compilation is faster with each release, and has other advantages
  • keep minimum Java required to run Maestro at 8. Note: for building, JDK11 will be the new minimum.

Notes:

@bartekpacia
Copy link
Contributor Author

bartekpacia commented Aug 12, 2024

Weird failures when building maestro-client

Weird failures
2024-08-12T20:13:27.6508520Z > Task :maestro-client:compileKotlin FAILED
2024-08-12T20:13:27.6513656Z e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
2024-08-12T20:13:27.6517074Z     class maestro_android.MaestroAndroid, unresolved supertypes: Object
2024-08-12T20:13:27.6518587Z     class maestro_android.MaestroDriverGrpc, unresolved supertypes: Object
2024-08-12T20:13:27.6520254Z Adding -Xextended-compiler-checks argument might provide additional information.
2024-08-12T20:13:27.6521244Z 
2024-08-12T20:13:27.6523523Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/AddMediaRequestKt.kt:54:15 Type mismatch: inferred type is java.lang.String! but kotlin.String was expected
2024-08-12T20:13:27.6528069Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/AddMediaRequestKt.kt:54:24 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6533041Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/AddMediaRequestKt.kt:57:18 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6537694Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/AddMediaRequestKt.kt:57:31 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6541978Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/AddMediaRequestKt.kt:71:15 Type mismatch: inferred type is java.lang.String! but kotlin.String was expected
2024-08-12T20:13:27.6546595Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/AddMediaRequestKt.kt:71:24 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6551326Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/AddMediaRequestKt.kt:74:18 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6556737Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/AddMediaRequestKt.kt:74:30 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6561140Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:30:15 Type mismatch: inferred type is java.lang.String! but kotlin.String was expected
2024-08-12T20:13:27.6565909Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:30:24 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6571028Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:33:18 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6575694Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:33:25 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6580194Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:47:15 Type mismatch: inferred type is java.lang.String! but kotlin.String was expected
2024-08-12T20:13:27.6585025Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:47:24 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6589699Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:50:18 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6594030Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:50:27 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6599833Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:64:15 Type mismatch: inferred type is java.lang.String! but kotlin.String was expected
2024-08-12T20:13:27.6604945Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:64:24 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6610085Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:67:18 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6615029Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ArgumentValueKt.kt:67:26 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6619735Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/CheckWindowUpdatingRequestKt.kt:30:15 Type mismatch: inferred type is java.lang.String! but kotlin.String was expected
2024-08-12T20:13:27.6624901Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/CheckWindowUpdatingRequestKt.kt:30:24 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6630395Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/CheckWindowUpdatingRequestKt.kt:33:18 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6635636Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/CheckWindowUpdatingRequestKt.kt:33:27 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6640515Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/InputTextRequestKt.kt:30:15 Type mismatch: inferred type is java.lang.String! but kotlin.String was expected
2024-08-12T20:13:27.6645220Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/InputTextRequestKt.kt:30:24 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6650300Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/InputTextRequestKt.kt:33:18 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6655348Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/InputTextRequestKt.kt:33:26 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6660129Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/LaunchAppRequestKt.kt:30:15 Type mismatch: inferred type is java.lang.String! but kotlin.String was expected
2024-08-12T20:13:27.6664946Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/LaunchAppRequestKt.kt:30:24 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6670122Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/LaunchAppRequestKt.kt:33:18 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6674925Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/LaunchAppRequestKt.kt:33:33 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6789677Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/LaunchAppRequestKt.kt:54:9 Type mismatch: inferred type is java.util.List! but kotlin.collections.List<TypeVariable(E)> was expected
2024-08-12T20:13:27.6794961Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/LaunchAppRequestKt.kt:54:18 Cannot access class 'java.util.List'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6800425Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/LaunchAppRequestKt.kt:82:16 Cannot access class 'java.lang.Iterable'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6805855Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/LaunchAppRequestKt.kt:82:32 Type mismatch: inferred type is kotlin.collections.Iterable<MaestroAndroid.ArgumentValue> but java.lang.Iterable! was expected
2024-08-12T20:13:27.6811057Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ViewHierarchyResponseKt.kt:30:15 Type mismatch: inferred type is java.lang.String! but kotlin.String was expected
2024-08-12T20:13:27.6815856Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ViewHierarchyResponseKt.kt:30:24 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6821322Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ViewHierarchyResponseKt.kt:33:18 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6826226Z e: file:///home/runner/work/maestro/maestro/maestro-client/build/generated/source/proto/main/kotlin/maestro_android/ViewHierarchyResponseKt.kt:33:31 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6831210Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:11:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6835490Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:11:29 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6840009Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:12:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6844235Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:12:31 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6867771Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:13:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6871663Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:13:30 Type mismatch: inferred type is kotlin.String! but java.lang.String! was expected
2024-08-12T20:13:27.6875761Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:16:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6880484Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:16:29 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6884859Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:17:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6889319Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:17:31 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6894271Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:18:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6898749Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:18:30 Type mismatch: inferred type is kotlin.String! but java.lang.String! was expected
2024-08-12T20:13:27.6902939Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:21:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6907167Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:21:29 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6911592Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:22:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6915875Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:22:31 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6919202Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:23:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6923901Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:23:30 Type mismatch: inferred type is kotlin.String! but java.lang.String! was expected
2024-08-12T20:13:27.6928145Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:26:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6932451Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:26:29 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6936652Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:27:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6941057Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:27:31 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6945281Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:28:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6949479Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:28:30 Type mismatch: inferred type is kotlin.String! but java.lang.String! was expected
2024-08-12T20:13:27.6953688Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:31:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6958273Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:31:29 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6962438Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:32:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6966795Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:32:31 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6971122Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:33:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6975495Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:33:30 Type mismatch: inferred type is kotlin.String! but java.lang.String! was expected
2024-08-12T20:13:27.6979727Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:36:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6984621Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:36:29 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6989018Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:37:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.6993791Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:37:31 Type mismatch: inferred type is kotlin.String but java.lang.String! was expected
2024-08-12T20:13:27.6998404Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:38:22 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.7002944Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/android/AndroidLaunchArguments.kt:38:30 Type mismatch: inferred type is kotlin.String! but java.lang.String! was expected
2024-08-12T20:13:27.7007066Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/drivers/AndroidDriver.kt:297:29 Cannot access class 'java.lang.String'. Check your module classpath for missing or conflicting dependencies
2024-08-12T20:13:27.7009490Z e: file:///home/runner/work/maestro/maestro/maestro-client/src/main/java/maestro/drivers/AndroidDriver.kt:297:39 Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
2024-08-12T20:13:27.7011289Z public inline fun String.byteInputStream(charset: Charset = ...): ByteArrayInputStream defined in kotlin.io
2024-08-12T20:13:27.8507575Z 
2024-08-12T20:13:27.8508602Z FAILURE: Build failed with an exception.
2024-08-12T20:13:27.8509312Z 
2024-08-12T20:13:27.8509927Z * What went wrong:
2024-08-12T20:13:27.8511175Z Execution failed for task ':maestro-client:compileKotlin'.
2024-08-12T20:13:27.8513237Z > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
2024-08-12T20:13:27.8515072Z    > Compilation error. See log for more details
2024-08-12T20:13:27.8515673Z 
2024-08-12T20:13:27.8516062Z * Try:
2024-08-12T20:13:27.8520819Z > Run with --stacktrace option to get the stack trace.
2024-08-12T20:13:27.8522031Z > Run with --info or --debug option to get more log output.
2024-08-12T20:13:27.8523228Z > Run with --scan to get full insights.
2024-08-12T20:13:27.8523777Z 
2024-08-12T20:13:27.8524165Z * Get more help at https://help.gradle.org
2024-08-12T20:13:27.8524836Z 
2024-08-12T20:13:27.8525122Z BUILD FAILED in 2m 40s

Update

It's KT-52815. Bumping Kotlin 1.8.0 -> 1.8.22 solves this.

@bartekpacia
Copy link
Contributor Author

Removing SensitivityWatchEventModifier.HIGH from FileWatcher.kt does not seem to introduce any noticeable delay to what we had before.

If we do discover some regression in the future though, we can try using kfswatch instead of depending on hidden JDK APIs.

@@ -113,7 +113,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
java-version: 11
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • make it possible to build Maestro on all Java 11 and higher. Compilation is faster with each release, and has other advantages
  • keep minimum Java required to run Maestro at 8. Note: for building, JDK11 will be the new minimum.

Following your comment, this test-e2e/test should work with java-version: 8 right? Otherwise, this means that maestro is unable to run at 8.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test-e2e/test should work with java-version: 8 right?

This is correct. (This is actually one of the things I wanted to accomplish with the test-e2e.yaml - to always verify we work on Java 8)

Now, this change (in test-cloud job) is actually a mistake, it should've been 8.

On Android (the test-local job) it's currently not 8, because none of the "setup Android & start emulator" GitHub Actions support installing an older SDK Command-Line Tools release (newer require either Java 11 or 17). I'm hoping this will change soon.

Copy link
Collaborator

@igorsmotto igorsmotto Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that means we can only test if maestro cloud works on java 8? Actually using maestro locally it's still TBD? Perhaps we could use devices from Maestro Cloud and connect them remotely using adb and therefore use the maestro cli?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually using maestro locally it's still TBD?

It already works as well, but the workaround I used is to compile on Java 8, and then run on Java 11 (because Android tools require at least Java 11). But now we will not be able to compile anymore on Java 8, so we have to find a way run on Java 8.

Perhaps we could use devices from Maestro Cloud and connect them remotely using adb and therefore use the maestro cli?

We could, but this sounds a bit complex (but I'd love to discuss more if you think it makes sense here). For now though I'd prefer to go with the simplest possible solution - find a way to use old Android Command-Line Tools+Java 8 and run emulator on GitHub Actions.

@bartekpacia
Copy link
Contributor Author

Constantly changing between JDK versions is really annoying. I gave this PR a good test (run maestro test samples/wikipedia-android-advanced/run-test.yml from maestro download-samples.

In addition to that, I'm pretty confident that -Xjdk-release is reliable and we can depend on it to guarantee compatibility with JDK 8.

Going forward with the merge.

@bartekpacia bartekpacia marked this pull request as ready for review August 23, 2024 16:59
@bartekpacia bartekpacia merged commit ce3b979 into main Aug 23, 2024
5 checks passed
@bartekpacia bartekpacia deleted the gradle/set_jdk_target branch August 23, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants