appium-espresso-driver 10.2.1 → 10.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/build/lib/commands/orientation.d.ts +33 -0
  3. package/build/lib/commands/orientation.d.ts.map +1 -0
  4. package/build/lib/commands/orientation.js +34 -0
  5. package/build/lib/commands/orientation.js.map +1 -0
  6. package/build/lib/commands/server/builder.d.ts +9 -0
  7. package/build/lib/commands/server/builder.d.ts.map +1 -1
  8. package/build/lib/commands/server/builder.js +23 -0
  9. package/build/lib/commands/server/builder.js.map +1 -1
  10. package/build/lib/commands/server/hints.d.ts +28 -0
  11. package/build/lib/commands/server/hints.d.ts.map +1 -0
  12. package/build/lib/commands/server/hints.js +54 -0
  13. package/build/lib/commands/server/hints.js.map +1 -0
  14. package/build/lib/commands/server/runner.d.ts +7 -0
  15. package/build/lib/commands/server/runner.d.ts.map +1 -1
  16. package/build/lib/commands/server/runner.js +43 -4
  17. package/build/lib/commands/server/runner.js.map +1 -1
  18. package/build/lib/driver.d.ts.map +1 -1
  19. package/build/lib/driver.js +13 -0
  20. package/build/lib/driver.js.map +1 -1
  21. package/build/lib/execute-method-map.d.ts +4 -0
  22. package/build/lib/execute-method-map.d.ts.map +1 -1
  23. package/espresso-server/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk +0 -0
  24. package/espresso-server/app/build.gradle.kts +91 -1
  25. package/espresso-server/app/src/androidTestShaded/AndroidManifest.xml +16 -0
  26. package/espresso-server/buildSrc/.gradle/9.7.1/executionHistory/executionHistory.bin +0 -0
  27. package/espresso-server/buildSrc/.gradle/9.7.1/executionHistory/executionHistory.lock +0 -0
  28. package/espresso-server/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  29. package/espresso-server/buildSrc/.gradle/buildOutputCleanup/cache.properties +1 -1
  30. package/espresso-server/buildSrc/build/classes/kotlin/main/META-INF/buildSrc.kotlin_module +0 -0
  31. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/AnnotationSkipper$visitField$1$1.class +0 -0
  32. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/AnnotationSkipper$visitMethod$1$1.class +0 -0
  33. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/AnnotationSkipper.class +0 -0
  34. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/MemberRef.class +0 -0
  35. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/PrefixRemapper.class +0 -0
  36. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocateClassesTask$run$$inlined$groupingBy$1.class +0 -0
  37. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocateClassesTask$run$$inlined$sortedByDescending$1.class +0 -0
  38. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocateClassesTask$run$9$1.class +0 -0
  39. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocateClassesTask$run$remapper$1.class +0 -0
  40. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocateClassesTask.class +0 -0
  41. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocationKt$memberReferences$1$visitMethod$1.class +0 -0
  42. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocationKt$memberReferences$1.class +0 -0
  43. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocationKt$referencedClasses$collector$1.class +0 -0
  44. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocationKt$shareNonPublicDependents$Declared.class +0 -0
  45. package/espresso-server/buildSrc/build/classes/kotlin/main/io/appium/espressoserver/gradle/RelocationKt.class +0 -0
  46. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  47. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  48. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  49. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  50. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  51. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  52. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  53. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  54. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  55. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  56. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  57. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  58. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  59. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  60. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  61. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  62. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  63. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  64. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  65. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  66. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  67. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  68. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  69. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  70. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  71. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  72. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  73. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  74. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  75. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  76. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  77. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  78. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
  79. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
  80. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
  81. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  82. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
  83. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  84. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  85. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  86. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  87. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  88. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  89. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  90. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  91. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  92. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  93. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  94. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  95. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  96. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  97. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  98. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  99. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  100. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  101. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  102. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  103. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  104. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  105. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  106. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  107. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  108. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  109. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
  110. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  111. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  112. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  113. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  114. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  115. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  116. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  117. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  118. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  119. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  120. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  121. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  122. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  123. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  124. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  125. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  126. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  127. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  128. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/last-build.bin +0 -0
  129. package/espresso-server/buildSrc/build/kotlin/compileKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  130. package/espresso-server/buildSrc/build/libs/buildSrc.jar +0 -0
  131. package/espresso-server/buildSrc/build.gradle.kts +6 -0
  132. package/espresso-server/buildSrc/src/main/kotlin/io/appium/espressoserver/gradle/RelocateClassesTask.kt +141 -0
  133. package/espresso-server/buildSrc/src/main/kotlin/io/appium/espressoserver/gradle/Relocation.kt +342 -0
  134. package/espresso-server/buildSrc/src/test/kotlin/io/appium/espressoserver/gradle/RelocationTest.kt +186 -0
  135. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/handlers/ListIdlingResources.kt +2 -1
  136. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/helpers/ShadingHelpers.kt +45 -0
  137. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/helpers/Version.kt +1 -1
  138. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/http/response/AppiumResponse.kt +3 -2
  139. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/model/HamcrestMatcher.kt +8 -5
  140. package/espresso-server/library/src/test/java/io/appium/espressoserver/test/helpers/ShadingHelpersTest.kt +37 -0
  141. package/lib/commands/orientation.ts +49 -0
  142. package/lib/commands/server/builder.ts +29 -0
  143. package/lib/commands/server/hints.ts +69 -0
  144. package/lib/commands/server/runner.ts +53 -5
  145. package/lib/driver.ts +14 -0
  146. package/node_modules/appium-adb/CHANGELOG.md +7 -0
  147. package/node_modules/appium-adb/package.json +3 -3
  148. package/node_modules/appium-android-driver/CHANGELOG.md +74 -0
  149. package/node_modules/appium-android-driver/build/lib/commands/bidi/helpers.d.ts +10 -0
  150. package/node_modules/appium-android-driver/build/lib/commands/bidi/helpers.d.ts.map +1 -0
  151. package/node_modules/appium-android-driver/build/lib/commands/bidi/helpers.js +15 -0
  152. package/node_modules/appium-android-driver/build/lib/commands/bidi/helpers.js.map +1 -0
  153. package/node_modules/appium-android-driver/build/lib/commands/bidi/logcat-level.d.ts +9 -0
  154. package/node_modules/appium-android-driver/build/lib/commands/bidi/logcat-level.d.ts.map +1 -0
  155. package/node_modules/appium-android-driver/build/lib/commands/bidi/logcat-level.js +37 -0
  156. package/node_modules/appium-android-driver/build/lib/commands/bidi/logcat-level.js.map +1 -0
  157. package/node_modules/appium-android-driver/build/lib/commands/device/common.d.ts.map +1 -1
  158. package/node_modules/appium-android-driver/build/lib/commands/device/common.js +2 -0
  159. package/node_modules/appium-android-driver/build/lib/commands/device/common.js.map +1 -1
  160. package/node_modules/appium-android-driver/build/lib/commands/find.js +2 -2
  161. package/node_modules/appium-android-driver/build/lib/commands/find.js.map +1 -1
  162. package/node_modules/appium-android-driver/build/lib/commands/log.d.ts +4 -0
  163. package/node_modules/appium-android-driver/build/lib/commands/log.d.ts.map +1 -1
  164. package/node_modules/appium-android-driver/build/lib/commands/log.js +7 -1
  165. package/node_modules/appium-android-driver/build/lib/commands/log.js.map +1 -1
  166. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.d.ts +3 -0
  167. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.d.ts.map +1 -1
  168. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.js +4 -0
  169. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.js.map +1 -1
  170. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.d.ts +10 -4
  171. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.d.ts.map +1 -1
  172. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.js +38 -20
  173. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.js.map +1 -1
  174. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.d.ts +34 -2
  175. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.d.ts.map +1 -1
  176. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.js +89 -43
  177. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.js.map +1 -1
  178. package/node_modules/appium-android-driver/build/lib/driver.d.ts +5 -0
  179. package/node_modules/appium-android-driver/build/lib/driver.d.ts.map +1 -1
  180. package/node_modules/appium-android-driver/build/lib/driver.js +1 -0
  181. package/node_modules/appium-android-driver/build/lib/driver.js.map +1 -1
  182. package/node_modules/appium-android-driver/build/lib/execute-method-map.d.ts +4 -0
  183. package/node_modules/appium-android-driver/build/lib/execute-method-map.d.ts.map +1 -1
  184. package/node_modules/appium-android-driver/build/lib/execute-method-map.js +5 -0
  185. package/node_modules/appium-android-driver/build/lib/execute-method-map.js.map +1 -1
  186. package/node_modules/appium-android-driver/lib/commands/bidi/helpers.ts +16 -0
  187. package/node_modules/appium-android-driver/lib/commands/bidi/logcat-level.ts +40 -0
  188. package/node_modules/appium-android-driver/lib/commands/device/common.ts +2 -0
  189. package/node_modules/appium-android-driver/lib/commands/find.ts +2 -2
  190. package/node_modules/appium-android-driver/lib/commands/log.ts +9 -1
  191. package/node_modules/appium-android-driver/lib/commands/media-stream/constants.ts +4 -0
  192. package/node_modules/appium-android-driver/lib/commands/media-stream/exports.ts +46 -21
  193. package/node_modules/appium-android-driver/lib/commands/media-stream/stream.ts +90 -43
  194. package/node_modules/appium-android-driver/lib/driver.ts +1 -0
  195. package/node_modules/appium-android-driver/lib/execute-method-map.ts +6 -0
  196. package/node_modules/appium-android-driver/package.json +6 -6
  197. package/node_modules/appium-chromedriver/CHANGELOG.md +7 -0
  198. package/node_modules/appium-chromedriver/config/mapping.json +1 -0
  199. package/node_modules/appium-chromedriver/package.json +2 -2
  200. package/node_modules/asyncbox/README.md +7 -3
  201. package/node_modules/asyncbox/build/lib/shared/errors.d.ts +18 -2
  202. package/node_modules/asyncbox/build/lib/shared/errors.d.ts.map +1 -1
  203. package/node_modules/asyncbox/build/lib/shared/errors.js +24 -8
  204. package/node_modules/asyncbox/build/lib/shared/errors.js.map +1 -1
  205. package/node_modules/asyncbox/lib/shared/errors.ts +34 -8
  206. package/node_modules/asyncbox/package.json +1 -1
  207. package/node_modules/bare-buffer/CMakeLists.txt +3 -3
  208. package/node_modules/bare-buffer/package.json +1 -1
  209. package/node_modules/bare-buffer/prebuilds/android-arm/bare-buffer.bare +0 -0
  210. package/node_modules/bare-buffer/prebuilds/android-arm64/bare-buffer.bare +0 -0
  211. package/node_modules/bare-buffer/prebuilds/android-ia32/bare-buffer.bare +0 -0
  212. package/node_modules/bare-buffer/prebuilds/android-x64/bare-buffer.bare +0 -0
  213. package/node_modules/bare-buffer/prebuilds/darwin-arm64/bare-buffer.bare +0 -0
  214. package/node_modules/bare-buffer/prebuilds/darwin-x64/bare-buffer.bare +0 -0
  215. package/node_modules/bare-buffer/prebuilds/ios-arm64/bare-buffer.bare +0 -0
  216. package/node_modules/bare-buffer/prebuilds/ios-arm64-simulator/bare-buffer.bare +0 -0
  217. package/node_modules/bare-buffer/prebuilds/ios-x64-simulator/bare-buffer.bare +0 -0
  218. package/node_modules/bare-buffer/prebuilds/linux-arm64/bare-buffer.bare +0 -0
  219. package/node_modules/bare-buffer/prebuilds/linux-x64/bare-buffer.bare +0 -0
  220. package/node_modules/bare-buffer/prebuilds/win32-arm64/bare-buffer.bare +0 -0
  221. package/node_modules/bare-buffer/prebuilds/win32-x64/bare-buffer.bare +0 -0
  222. package/node_modules/bare-fs/package.json +2 -2
  223. package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
  224. package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
  225. package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
  226. package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
  227. package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
  228. package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
  229. package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
  230. package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
  231. package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
  232. package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
  233. package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
  234. package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
  235. package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
  236. package/node_modules/bare-url/CMakeLists.txt +5 -5
  237. package/node_modules/bare-url/package.json +1 -1
  238. package/node_modules/bare-url/prebuilds/android-arm/bare-url.bare +0 -0
  239. package/node_modules/bare-url/prebuilds/android-arm64/bare-url.bare +0 -0
  240. package/node_modules/bare-url/prebuilds/android-ia32/bare-url.bare +0 -0
  241. package/node_modules/bare-url/prebuilds/android-x64/bare-url.bare +0 -0
  242. package/node_modules/bare-url/prebuilds/darwin-arm64/bare-url.bare +0 -0
  243. package/node_modules/bare-url/prebuilds/darwin-x64/bare-url.bare +0 -0
  244. package/node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare +0 -0
  245. package/node_modules/bare-url/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
  246. package/node_modules/bare-url/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
  247. package/node_modules/bare-url/prebuilds/linux-arm64/bare-url.bare +0 -0
  248. package/node_modules/bare-url/prebuilds/linux-x64/bare-url.bare +0 -0
  249. package/node_modules/bare-url/prebuilds/win32-arm64/bare-url.bare +0 -0
  250. package/node_modules/bare-url/prebuilds/win32-x64/bare-url.bare +0 -0
  251. package/node_modules/ini/package.json +5 -5
  252. package/node_modules/io.appium.settings/CHANGELOG.md +21 -0
  253. package/node_modules/io.appium.settings/apks/settings_apk-debug.apk +0 -0
  254. package/node_modules/io.appium.settings/package.json +3 -3
  255. package/node_modules/plist/dist/parse-binary.d.ts.map +1 -1
  256. package/node_modules/plist/dist/parse-binary.js +37 -9
  257. package/node_modules/plist/dist/parse-binary.js.map +1 -1
  258. package/node_modules/plist/package.json +1 -1
  259. package/package.json +5 -5
  260. package/scripts/check-shaded-packages.mjs +106 -0
  261. package/scripts/lib/dependency-versions/apk-meta-inf.mjs +0 -13
  262. package/scripts/lib/dependency-versions/comparison.mjs +17 -47
  263. package/scripts/lib/dependency-versions/gradle-scan.mjs +77 -87
  264. package/scripts/lib/dependency-versions/index.mjs +1 -1
  265. package/scripts/lib/dependency-versions/report.mjs +4 -4
  266. package/scripts/lib/dependency-versions/tracked-modules.mjs +2 -42
  267. package/scripts/lib/dependency-versions/types.mjs +2 -1
  268. package/scripts/lib/dependency-versions/version-utils.mjs +124 -2
  269. package/scripts/lib/diagnose/app-input.mjs +4 -1
  270. package/scripts/lib/diagnose/checks/compile-sdk.mjs +6 -2
  271. package/scripts/lib/diagnose/checks/dependency.mjs +1 -1
  272. package/scripts/lib/diagnose/checks/index.mjs +0 -3
  273. package/scripts/lib/diagnose/checks/obfuscation.mjs +1 -1
  274. package/scripts/lib/diagnose/diagnosis.mjs +2 -7
  275. package/scripts/lib/diagnose/report.mjs +2 -2
  276. package/scripts/lib/diagnose/checks/androidx.mjs +0 -40
  277. package/scripts/lib/diagnose/checks/lifecycle-extensions.mjs +0 -23
  278. package/scripts/lib/diagnose/checks/startup-provider.mjs +0 -41
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Fails if the Espresso server test APK defines classes outside of the packages that are allowed to
4
+ * keep their names (see `RelocateClassesTask` usage in espresso-server/app/build.gradle.kts).
5
+ */
6
+ import path from 'node:path';
7
+
8
+ import {logger} from 'appium/support.js';
9
+ import {Command} from 'commander';
10
+ import {exec} from 'teen_process';
11
+
12
+ const LOG = logger.getLogger('CheckShadedPackages');
13
+
14
+ const ALWAYS_ALLOWED = [
15
+ 'io.appium',
16
+ 'androidx.test.runner',
17
+ 'androidx.test.core.app',
18
+ 'androidx.test.espresso.idling',
19
+ // D8 desugaring stubs and the platform
20
+ 'android',
21
+ 'dalvik',
22
+ 'j$',
23
+ 'com.android.tools.r8',
24
+ ];
25
+ // Exactly these packages, without subpackages: D8 synthetic classes live in the first two,
26
+ // `IdlingResource` (implemented by the AUT) in the last one
27
+ const EXACT_PACKAGES = ['androidx', 'com', 'androidx.test.espresso'];
28
+ // Shared with the AUT together with their reference closure
29
+ const COMPOSE_ALLOWED = ['androidx', 'kotlin', 'kotlinx', '_COROUTINE', 'org.jetbrains', 'org.intellij'];
30
+
31
+ /**
32
+ * @returns {string}
33
+ */
34
+ function getApkAnalyzerPath() {
35
+ const sdkRoot = process.env.ANDROID_HOME || process.env.ANDROID_SDK_ROOT;
36
+ return process.env.APKANALYZER || path.join(sdkRoot ?? '', 'cmdline-tools', 'latest', 'bin', 'apkanalyzer');
37
+ }
38
+
39
+ /**
40
+ * @param {string} apk
41
+ * @returns {Promise<Map<string, number>>} Package name to the number of classes in it and its subpackages
42
+ */
43
+ async function listDefinedPackages(apk) {
44
+ const {stdout} = await exec(getApkAnalyzerPath(), ['dex', 'packages', '--defined-only', apk], {
45
+ maxStdoutBufferSize: 1 << 28,
46
+ });
47
+ return new Map(
48
+ stdout
49
+ .split('\n')
50
+ .map((line) => line.split('\t'))
51
+ .filter(([kind, , , name]) => kind?.startsWith('P') && name && name !== '<TOTAL>')
52
+ .map(([, count, , name]) => [name, Number(count)]),
53
+ );
54
+ }
55
+
56
+ /**
57
+ * @param {Map<string, number>} packages
58
+ * @param {readonly string[]} allowed
59
+ * @returns {{name: string, own: number}[]} Packages with classes defined right in them that are not allowed
60
+ */
61
+ function findViolations(packages, allowed) {
62
+ /** @param {string} pkg */
63
+ const isAllowed = (pkg) => EXACT_PACKAGES.includes(pkg) || allowed.some((a) => pkg === a || pkg.startsWith(`${a}.`));
64
+ // The listing is a tree where every package carries the counts of its subpackages too
65
+ return [...packages]
66
+ .map(([name, count]) => {
67
+ const children = [...packages].filter(
68
+ ([n]) => n.startsWith(`${name}.`) && !n.slice(name.length + 1).includes('.'),
69
+ );
70
+ return {name, own: count - children.reduce((sum, [, c]) => sum + c, 0)};
71
+ })
72
+ .filter(({name, own}) => own > 0 && !isAllowed(name));
73
+ }
74
+
75
+ /**
76
+ * @param {string} apk
77
+ * @param {{compose?: boolean}} options
78
+ * @returns {Promise<void>}
79
+ */
80
+ async function checkShadedPackages(apk, options) {
81
+ const allowed = [...ALWAYS_ALLOWED, ...(options.compose ? COMPOSE_ALLOWED : [])];
82
+ const violations = findViolations(await listDefinedPackages(apk), allowed);
83
+ if (violations.length > 0) {
84
+ LOG.error(
85
+ `The APK defines classes outside of the allowed packages (${allowed.join(', ')}):\n` +
86
+ violations.map(({name, own}) => ` ${name} (${own})`).join('\n'),
87
+ );
88
+ process.exitCode = 1;
89
+ return;
90
+ }
91
+ LOG.info('OK: all the packages defined by the APK are allowed');
92
+ }
93
+
94
+ async function main() {
95
+ const program = new Command();
96
+ program
97
+ .name('check-shaded-packages')
98
+ .description('Check that the Espresso server APK defines only the packages that are allowed to keep their names')
99
+ .argument('<apk>', 'Path to the Espresso server test APK')
100
+ .option('--compose', 'The APK is built with Compose support, so Compose and its dependencies are shared')
101
+ .action(checkShadedPackages);
102
+
103
+ await program.parseAsync(process.argv);
104
+ }
105
+
106
+ await main();
@@ -8,19 +8,6 @@ import {normalizeVersion} from './version-utils.mjs';
8
8
  const META_INF_VERSION_MODULE_RULES = [
9
9
  {moduleId: 'compose', matches: (base) => base.startsWith('androidx.compose.')},
10
10
  {moduleId: 'kotlin', matches: (base) => base.startsWith('org.jetbrains.kotlin_')},
11
- {moduleId: 'espresso', matches: (base) => base.startsWith('androidx.test.espresso')},
12
- {
13
- moduleId: 'annotation',
14
- matches: (base) => base.startsWith('androidx.annotation_annotation') && !base.includes('experimental'),
15
- },
16
- {moduleId: 'uiautomator', matches: (base) => base.startsWith('androidx.test.uiautomator')},
17
- {
18
- moduleId: 'androidxTest',
19
- matches: (base) =>
20
- base.startsWith('androidx.test.') &&
21
- !base.startsWith('androidx.test.espresso') &&
22
- !base.startsWith('androidx.test.uiautomator'),
23
- },
24
11
  ];
25
12
 
26
13
  /**
@@ -31,33 +31,25 @@ export function compareModuleVersions(serverVersion, appVersion) {
31
31
  /**
32
32
  * @param {Record<string, string>} serverVersions
33
33
  * @param {Record<string, string[]>} appVersions
34
- * @param {{proguardLikely?: boolean, minifyEnabled?: boolean | null, detectionSource?: 'apk' | 'project'}} context
34
+ * @param {{proguardLikely?: boolean, minifyEnabled?: boolean | null, detectionSource?: 'apk' | 'project', composeDetected?: boolean}} context
35
35
  * @returns {import('./types.mjs').ComparisonReport}
36
36
  */
37
37
  export function buildComparisonReport(serverVersions, appVersions, context = {}) {
38
38
  const proguardLikely = Boolean(context.proguardLikely);
39
39
  const minifyEnabled = context.minifyEnabled ?? null;
40
40
  const detectionSource = context.detectionSource ?? 'project';
41
+ const composeDetected = Boolean(context.composeDetected);
41
42
  /** @type {import('./types.mjs').ModuleComparison[]} */
42
43
  const modules = [];
43
44
 
44
45
  for (const mod of TRACKED_MODULES) {
46
+ if (mod.onlyWithCompose && !composeDetected) {
47
+ continue;
48
+ }
45
49
  const serverVersion = serverVersions[mod.id];
46
50
  const appCandidates = appVersions[mod.id] ?? [];
47
51
  const appVersion = appCandidates[0] ?? null;
48
52
 
49
- if (mod.testOnly) {
50
- modules.push({
51
- ...mod,
52
- serverVersion: serverVersion ?? null,
53
- appVersions: appCandidates,
54
- appVersion,
55
- diff: appVersion ? 'present' : 'absent',
56
- recommendation: buildTestOnlyRecommendation(mod, appCandidates),
57
- });
58
- continue;
59
- }
60
-
61
53
  const diff = compareModuleVersions(serverVersion, appVersion);
62
54
  modules.push({
63
55
  ...mod,
@@ -68,6 +60,7 @@ export function buildComparisonReport(serverVersions, appVersions, context = {})
68
60
  recommendation: buildVersionRecommendation(mod, diff, appVersion, serverVersion, {
69
61
  proguardLikely,
70
62
  detectionSource,
63
+ composeDetected,
71
64
  }),
72
65
  });
73
66
  }
@@ -75,39 +68,12 @@ export function buildComparisonReport(serverVersions, appVersions, context = {})
75
68
  return {
76
69
  proguardLikely,
77
70
  minifyEnabled,
71
+ composeDetected,
78
72
  modules,
79
73
  summary: summarizeReport(modules, {proguardLikely, minifyEnabled}),
80
74
  };
81
75
  }
82
76
 
83
- /**
84
- * @param {string[]} appVersions
85
- * @returns {string}
86
- */
87
- function formatDetectedVersions(appVersions) {
88
- return appVersions.length ? appVersions.join(', ') : 'detected';
89
- }
90
-
91
- /**
92
- * @param {import('./types.mjs').TrackedModule} mod
93
- * @param {string[]} appVersions
94
- * @returns {import('./types.mjs').Recommendation}
95
- */
96
- function buildTestOnlyRecommendation(mod, appVersions) {
97
- if (appVersions.length) {
98
- const versions = formatDetectedVersions(appVersions);
99
- return {
100
- level: 'warning',
101
- message:
102
- `Detected ${mod.label} (${versions}) in the application under test. ` +
103
- 'The main app should not be built as an instrumented-test artifact and is not expected to ' +
104
- 'bundle Espresso, AndroidX Test, or UiAutomator dependencies; doing so ' +
105
- 'can cause classpath conflicts with the Espresso server.',
106
- };
107
- }
108
- return {level: 'ok', message: 'Not detected in the app; no action needed.'};
109
- }
110
-
111
77
  /**
112
78
  * @param {import('./types.mjs').TrackedModule} mod
113
79
  * @param {string} appVersion
@@ -125,7 +91,7 @@ function toolsVersionsOverride(mod, appVersion) {
125
91
  * @param {import('./types.mjs').VersionDiffKind} diff
126
92
  * @param {string | null} appVersion
127
93
  * @param {string | undefined} serverVersion
128
- * @param {{proguardLikely: boolean, detectionSource: 'apk' | 'project'}} ctx
94
+ * @param {{proguardLikely: boolean, detectionSource: 'apk' | 'project', composeDetected: boolean}} ctx
129
95
  * @returns {import('./types.mjs').Recommendation}
130
96
  */
131
97
  function buildVersionRecommendation(mod, diff, appVersion, serverVersion, ctx) {
@@ -140,6 +106,14 @@ function buildVersionRecommendation(mod, diff, appVersion, serverVersion, ctx) {
140
106
  };
141
107
  }
142
108
  if (!appVersion) {
109
+ if (mod.id === 'compose' && ctx.detectionSource === 'project' && ctx.composeDetected) {
110
+ return {
111
+ level: 'info',
112
+ message:
113
+ 'The app uses Jetpack Compose, but its version could not be read from the Gradle files (e.g. it comes from a BOM). ' +
114
+ `Set toolsVersions.${mod.toolsVersionKey} in espressoBuildConfig to the version the app resolves to if it differs from the server's.`,
115
+ };
116
+ }
143
117
  if (mod.id === 'compose' && ctx.detectionSource === 'project') {
144
118
  return {
145
119
  level: 'suggestion',
@@ -194,15 +168,11 @@ function buildVersionRecommendation(mod, diff, appVersion, serverVersion, ctx) {
194
168
  * @param {{proguardLikely: boolean, minifyEnabled: boolean | null}} ctx
195
169
  */
196
170
  function summarizeReport(modules, ctx) {
197
- const testPresence = modules.filter((m) => m.testOnly && m.recommendation.level === 'warning');
198
- const warnings = modules.filter((m) => !m.testOnly && m.recommendation.level === 'warning');
171
+ const warnings = modules.filter((m) => m.recommendation.level === 'warning');
199
172
  const suggestions = modules.filter((m) => m.recommendation.level === 'suggestion');
200
173
  if (ctx.proguardLikely) {
201
174
  return 'APK appears minified/obfuscated; dependency versions from the APK may be incomplete. Espresso server defaults are listed below.';
202
175
  }
203
- if (testPresence.length) {
204
- return `${testPresence.length} test/instrumentation librar${testPresence.length === 1 ? 'y' : 'ies'} detected in the application under test — review warnings below.`;
205
- }
206
176
  if (warnings.length) {
207
177
  return `${warnings.length} module(s) have a large version mismatch — review warnings below.`;
208
178
  }
@@ -6,46 +6,12 @@ import {findFiles} from '../find-files.mjs';
6
6
  import {TRACKED_MODULES, createEmptyVersionSets} from './tracked-modules.mjs';
7
7
  import {
8
8
  normalizeVersion,
9
+ parseCatalogAccessors,
9
10
  parseVersionsToml,
10
11
  versionFromPatternMatch,
11
12
  versionSetsToSortedRecords,
12
13
  } from './version-utils.mjs';
13
14
 
14
- /** @type {RegExp} Gradle configs that do not affect the main/release app artifact. */
15
- const NON_MAIN_DEP_CONFIG_LINE = /^\s*(?:androidTest|test)(?:Implementation|Api|CompileOnly|RuntimeOnly|WearApp)\b/;
16
-
17
- /**
18
- * Keeps dependency declarations that can affect the main app artifact (implementation, api, …).
19
- * Strips androidTest* and test* configuration blocks/lines.
20
- * @param {string} text
21
- * @returns {string}
22
- */
23
- export function extractMainAppDependencyScopes(text) {
24
- const lines = text.split('\n');
25
- /** @type {string[]} */
26
- const kept = [];
27
- let skipDepth = 0;
28
-
29
- for (const line of lines) {
30
- if (skipDepth > 0) {
31
- skipDepth += parenDelta(line);
32
- if (skipDepth <= 0) {
33
- skipDepth = 0;
34
- }
35
- continue;
36
- }
37
- if (NON_MAIN_DEP_CONFIG_LINE.test(line)) {
38
- const delta = parenDelta(line);
39
- if (delta > 0) {
40
- skipDepth = delta;
41
- }
42
- continue;
43
- }
44
- kept.push(line);
45
- }
46
- return kept.join('\n');
47
- }
48
-
49
15
  /**
50
16
  * @param {string} root
51
17
  * @param {number} [maxDepth]
@@ -59,6 +25,53 @@ export async function findGradleFiles(root, maxDepth = 6) {
59
25
  });
60
26
  }
61
27
 
28
+ /**
29
+ * Drops block, `//` and full-line `#` (TOML, properties) comments.
30
+ * @param {string} text
31
+ * @returns {string}
32
+ */
33
+ export function stripComments(text) {
34
+ return text
35
+ .replace(/\/\*[\s\S]*?\*\//g, '')
36
+ .replace(/(^|[^:])\/\/.*$/gm, '$1')
37
+ .replace(/^\s*#.*$/gm, '');
38
+ }
39
+
40
+ /**
41
+ * Whether Gradle files (build scripts, version catalogs) show that the app uses Jetpack Compose,
42
+ * whatever the way it is declared: the Compose compiler plugin, `buildFeatures`, a BOM or a catalog reference.
43
+ * @param {string} text
44
+ * @returns {boolean}
45
+ */
46
+ export function usesCompose(text) {
47
+ // `apply false` only declares the plugin for subprojects (usually in the root script)
48
+ const code = stripComments(text).replace(/^.*\bapply\s+false\b.*$/gm, '');
49
+ return /\bcompose\s*=\s*true\b|kotlin\.plugin\.compose|androidx[.-]compose|\blibs\.[\w.]*compose|compose-?bom/i.test(
50
+ code,
51
+ );
52
+ }
53
+
54
+ /**
55
+ * @param {string} text
56
+ * @param {string} accessor
57
+ * @returns {boolean}
58
+ */
59
+ function isReferenced(text, accessor) {
60
+ // the exact accessor, optionally followed by a provider method (`libs.ui` is not `libs.ui.core`)
61
+ const methods = 'get|getOrNull|getOrElse|asProvider|orNull|map|flatMap|zip|isPresent';
62
+ return new RegExp(`(?<![\\w.])${accessor.replace(/\./g, '\\.')}(?!\\w)(?!\\.(?!(?:${methods})\\b)\\w)`).test(text);
63
+ }
64
+
65
+ /**
66
+ * The directory of the Gradle build a version catalog belongs to.
67
+ * @param {string} catalogPath
68
+ * @returns {string}
69
+ */
70
+ function catalogBuildRoot(catalogPath) {
71
+ const dir = path.dirname(catalogPath);
72
+ return path.basename(dir) === 'gradle' ? path.dirname(dir) : dir;
73
+ }
74
+
62
75
  /**
63
76
  * @param {string} projectRoot
64
77
  * @returns {Promise<{versions: Record<string, string[]>, minifyEnabled: boolean | null, sources: string[]}>}
@@ -67,12 +80,18 @@ export async function collectAppVersionsFromProject(projectRoot) {
67
80
  const gradleFiles = await findGradleFiles(projectRoot);
68
81
  const found = createEmptyVersionSets();
69
82
  let minifyEnabled = null;
83
+ /** @type {{root: string, text: string}[]} */
84
+ const catalogs = [];
85
+ /** @type {{dir: string, text: string}[]} */
86
+ const scripts = [];
70
87
 
71
88
  for (const filePath of gradleFiles) {
72
89
  const text = await fs.readFile(filePath, 'utf8');
73
- const rel = path.relative(projectRoot, filePath);
74
- if (!rel.endsWith('libs.versions.toml')) {
75
- collectVersionsFromGradleText(text, TRACKED_MODULES, found);
90
+ if (filePath.endsWith('libs.versions.toml')) {
91
+ catalogs.push({root: catalogBuildRoot(filePath), text});
92
+ } else {
93
+ scripts.push({dir: path.dirname(filePath), text: stripComments(text)});
94
+ collectVersionsFromGradleText(stripComments(text), TRACKED_MODULES, found);
76
95
  }
77
96
  if (/\bisMinifyEnabled\s*=\s*true\b/.test(text) || /\bminifyEnabled\s+true\b/.test(text)) {
78
97
  minifyEnabled = true;
@@ -82,19 +101,25 @@ export async function collectAppVersionsFromProject(projectRoot) {
82
101
  minifyEnabled = false;
83
102
  }
84
103
  }
85
- if (rel.endsWith('libs.versions.toml')) {
86
- const tomlVersions = parseVersionsToml(text);
87
- for (const mod of TRACKED_MODULES) {
88
- if (mod.testOnly) {
89
- continue;
90
- }
91
- const v = tomlVersions[mod.catalogKey];
92
- if (v) {
93
- const normalized = normalizeVersion(v);
94
- if (normalized) {
95
- found[mod.id].add(normalized);
96
- }
97
- }
104
+ }
105
+
106
+ // A catalog version counts only if a script of the build owning the catalog consumes it
107
+ const roots = catalogs.map((c) => c.root);
108
+ const ownerOf = (/** @type {string} */ dir) =>
109
+ roots
110
+ .filter((root) => dir === root || dir.startsWith(root + path.sep))
111
+ .reduce((best, root) => (root.length > best.length ? root : best), '');
112
+ for (const {root, text: catalogText} of catalogs) {
113
+ const ownScripts = scripts
114
+ .filter((s) => ownerOf(s.dir) === root)
115
+ .map((s) => s.text)
116
+ .join('\n');
117
+ const catalogVersions = parseVersionsToml(catalogText);
118
+ const accessors = parseCatalogAccessors(catalogText);
119
+ for (const mod of TRACKED_MODULES) {
120
+ const normalized = normalizeVersion(catalogVersions[mod.catalogKey]);
121
+ if (normalized && (accessors[mod.catalogKey] ?? []).some((acc) => isReferenced(ownScripts, acc))) {
122
+ found[mod.id].add(normalized);
98
123
  }
99
124
  }
100
125
  }
@@ -106,37 +131,6 @@ export async function collectAppVersionsFromProject(projectRoot) {
106
131
  };
107
132
  }
108
133
 
109
- /**
110
- * Net change in parenthesis depth outside of string literals.
111
- * @param {string} line
112
- * @returns {number}
113
- */
114
- function parenDelta(line) {
115
- let depth = 0;
116
- let inString = false;
117
- let quote = '';
118
- for (let i = 0; i < line.length; i++) {
119
- const c = line[i];
120
- if (inString) {
121
- if (c === quote && line[i - 1] !== '\\') {
122
- inString = false;
123
- }
124
- continue;
125
- }
126
- if (c === '"' || c === "'") {
127
- inString = true;
128
- quote = c;
129
- continue;
130
- }
131
- if (c === '(') {
132
- depth++;
133
- } else if (c === ')') {
134
- depth--;
135
- }
136
- }
137
- return depth;
138
- }
139
-
140
134
  /**
141
135
  * @param {string} text
142
136
  * @param {import('./types.mjs').TrackedModule[]} modules
@@ -144,14 +138,10 @@ function parenDelta(line) {
144
138
  */
145
139
  function collectVersionsFromGradleText(text, modules, found) {
146
140
  for (const mod of modules) {
147
- const corpus = mod.testOnly ? extractMainAppDependencyScopes(text) : text;
148
- if (mod.testOnly && !corpus.trim()) {
149
- continue;
150
- }
151
141
  for (const pattern of mod.patterns) {
152
142
  pattern.lastIndex = 0;
153
143
  let match;
154
- while ((match = pattern.exec(corpus)) !== null) {
144
+ while ((match = pattern.exec(text)) !== null) {
155
145
  const version = versionFromPatternMatch(match);
156
146
  if (version) {
157
147
  found[mod.id].add(version);
@@ -7,7 +7,7 @@ export {
7
7
  versionFromPatternMatch,
8
8
  versionSetsToSortedRecords,
9
9
  } from './version-utils.mjs';
10
- export {collectAppVersionsFromProject, extractMainAppDependencyScopes, findGradleFiles} from './gradle-scan.mjs';
10
+ export {collectAppVersionsFromProject, findGradleFiles, usesCompose} from './gradle-scan.mjs';
11
11
  export {collectAppVersionsFromApk} from './apk-scan.mjs';
12
12
  export {mapMetaInfVersionBaseToModule, mergeMetaInfEmbeddedVersions} from './apk-meta-inf.mjs';
13
13
  export {mergeKotlinMetadataVersionsFromDex, parseKotlinMetadataVersionsFromDexdump} from './apk-kotlin-metadata.mjs';
@@ -34,8 +34,9 @@ export function formatReport(report, opts = {}) {
34
34
  }
35
35
  const lines = [];
36
36
  if (!opts.compact) {
37
- lines.push('Espresso dependency compatibility report');
38
- lines.push('======================================');
37
+ const title = 'Espresso server compatibility report';
38
+ lines.push(title);
39
+ lines.push('='.repeat(title.length));
39
40
  lines.push('');
40
41
  }
41
42
  lines.push(report.summary);
@@ -63,8 +64,7 @@ export function formatReport(report, opts = {}) {
63
64
  lines.push(`${mod.label} (${mod.id})`);
64
65
  lines.push(` Server: ${mod.serverVersion ?? 'n/a'}`);
65
66
  if (mod.appVersions.length) {
66
- const suffix = mod.testOnly ? '' : ` (using ${mod.appVersion} for comparison)`;
67
- lines.push(` App: ${mod.appVersions.join(', ')}${suffix}`);
67
+ lines.push(` App: ${mod.appVersions.join(', ')} (using ${mod.appVersion} for comparison)`);
68
68
  } else {
69
69
  lines.push(' App: not detected');
70
70
  }
@@ -11,53 +11,13 @@ export const TRACKED_MODULES = [
11
11
  /compose-ui-test[^:]*:([\d.]+)/gi,
12
12
  /compose\.ui:ui-test[^:]*:([\d.]+)/gi,
13
13
  /["']androidx\.compose\.ui:ui-test(?:-junit4)?["'][^:]*:([\d.]+)/gi,
14
- /composeBom\s*=\s*["']([^"']+)["']/gi,
15
- /compose-bom:([\d.]+)/gi,
16
- /androidx\.compose:compose-bom:([\d.]+)/gi,
17
14
  ],
18
15
  },
19
16
  {
20
- id: 'espresso',
21
- label: 'Espresso',
22
- testOnly: true,
23
- toolsVersionKey: 'espressoVersion',
24
- catalogKey: 'espresso',
25
- gradleProperty: 'appiumEspressoVersion',
26
- patterns: [
27
- /\bespresso\s*=\s*["']([^"']+)["']/gi,
28
- /androidx\.test\.espresso:espresso-[\w-]+:([\d.]+)/gi,
29
- /espresso-core:([\d.]+)/gi,
30
- ],
31
- },
32
- {
33
- id: 'annotation',
34
- label: 'AndroidX Annotation',
35
- toolsVersionKey: 'annotationVersion',
36
- catalogKey: 'annotation',
37
- gradleProperty: 'appiumAnnotationVersion',
38
- patterns: [/\bannotation\s*=\s*["']([^"']+)["']/gi, /androidx\.annotation:annotation:([\d.]+)/gi],
39
- },
40
- {
41
- id: 'androidxTest',
42
- label: 'AndroidX Test',
43
- testOnly: true,
44
- toolsVersionKey: null,
45
- catalogKey: 'androidxTest',
46
- gradleProperty: 'appiumAndroidxTestVersion',
47
- patterns: [/androidxTest\s*=\s*["']([^"']+)["']/gi, /androidx\.test:(?:core|runner|rules|ext):[\w-]*:([\d.]+)/gi],
48
- },
49
- {
50
- id: 'uiautomator',
51
- label: 'UiAutomator',
52
- testOnly: true,
53
- toolsVersionKey: null,
54
- catalogKey: 'uiautomator',
55
- gradleProperty: 'appiumUiAutomatorVersion',
56
- patterns: [/\buiautomator\s*=\s*["']([^"']+)["']/gi, /androidx\.test\.uiautomator:uiautomator:([\d.]+)/gi],
57
- },
58
- {
17
+ // Kotlin stays shared with the app together with Compose, so its version matters only for Compose apps
59
18
  id: 'kotlin',
60
19
  label: 'Kotlin',
20
+ onlyWithCompose: true,
61
21
  toolsVersionKey: 'kotlin',
62
22
  catalogKey: 'kotlin',
63
23
  gradleProperty: 'appiumKotlin',
@@ -15,7 +15,7 @@
15
15
  * @property {string | null} toolsVersionKey
16
16
  * @property {string} catalogKey
17
17
  * @property {string} gradleProperty
18
- * @property {boolean} [testOnly] When true, only warn if detected in the AUT (no version comparison).
18
+ * @property {boolean} [onlyWithCompose] When true, the module is compared only if the app uses Compose.
19
19
  * @property {RegExp[]} patterns
20
20
  */
21
21
 
@@ -33,6 +33,7 @@
33
33
  * @typedef {Object} ComparisonReport
34
34
  * @property {boolean} proguardLikely
35
35
  * @property {boolean | null} minifyEnabled
36
+ * @property {boolean} composeDetected
36
37
  * @property {ModuleComparison[]} modules
37
38
  * @property {string} summary
38
39
  */