Status Update
Comments
as...@google.com <as...@google.com>
ap...@google.com <ap...@google.com> #2
You can provide your own regex to By.text()
.
For example, By.text(Pattern.compile("All albums.*", Pattern.DOTALL))
should be equivalent to a multi-line startsWith.
am...@gmail.com <am...@gmail.com> #3
I'm probably dumb but why would it be the default and wanted behavior if not documented properly?
Every known startWith / contains function in Java/Kotlin are multiline, the javadoc says: A UI element will be considered a match if its text value starts with the substring parameter
Many people will fall into this non standard default behavior and loose tons of time trying to figure out why.
If you still consider this default is the correct one, then please document it.
as...@google.com <as...@google.com> #4
as...@google.com <as...@google.com> #5
Will be fixed in version 2.3.0-alpha02.
To clarify
However, looking at this again, it was inconsistent between UiSelector and BySelector, and users are unlikely to be relying on single line matching.
Description
Jetpack Compose compiler version: 1.5.4 Android Studio Build: #AI-223.8836.35.2231.11090377, built on November 13, 2023 Kotlin version: 1.9.20
The change introduced by commit
22421ef1f3aab2bb317e164845bf1630606a099c
usescurrentFile.fileEntry.name
field to generate keys to be passed tostartReplaceableGroup
call. I discovered that this field contains the absolute file path, not just the part relative to the project root.In practice that results in binary different artifacts being produced for binary equivalent sources stored under different paths. E.g. builds under
/tmp/ci-build-42/
will always produce binary equal artifacts for a given source code revision, but these artifacts will be different from the ones produced from the same revision under/tmp/ci-build-43/
.Steps to Reproduce or Code Sample to Reproduce:
./gradlew clean build --no-daemon
, store./app/build/intermediates/compile_app_classes_jar/release/classes.jar
ReproducerComposableKt.class
will be the only file different between the resulting jars. By applyingjavap -c
and comparing the output for these classes, you'll see the only difference there is a value for a constant used instartReplaceableGroup
call.For your convenience I also provide projects for compiler versions 1.5.4 and 1.5.3 I used to verify my findings (see
reproducer.tgz
). Also, thefileName
value I extracted with a debugger from 1.5.4 project looks like this: