appium-espresso-driver 7.1.2 → 7.2.1

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [7.2.1](https://github.com/appium/appium-espresso-driver/compare/v7.2.0...v7.2.1) (2026-04-17)
2
+
3
+ ### Miscellaneous Chores
4
+
5
+ * **deps-dev:** bump typescript from 5.9.3 to 6.0.3 ([#1150](https://github.com/appium/appium-espresso-driver/issues/1150)) ([3ca21c5](https://github.com/appium/appium-espresso-driver/commit/3ca21c5471830b7c7e8bb0d6cb7c9b00ca4f468a))
6
+
7
+ ## [7.2.0](https://github.com/appium/appium-espresso-driver/compare/v7.1.2...v7.2.0) (2026-04-08)
8
+
9
+ ### Features
10
+
11
+ * Migrate scripts to mjs/ESM format ([#1149](https://github.com/appium/appium-espresso-driver/issues/1149)) ([cffd424](https://github.com/appium/appium-espresso-driver/commit/cffd424917938f83beaea2752ccd9fd73ab67d3f))
12
+
1
13
  ## [7.1.2](https://github.com/appium/appium-espresso-driver/compare/v7.1.1...v7.1.2) (2026-04-08)
2
14
 
3
15
  ### Miscellaneous Chores
@@ -2,6 +2,6 @@ package io.appium.espressoserver.lib.helpers
2
2
 
3
3
  // This value is updated automatically by the NPM versioning script
4
4
  // It should be in sync with the NPM module version from package.json
5
- private const val VERSION = "7.1.2"
5
+ private const val VERSION = "7.2.1"
6
6
 
7
7
  fun getEspressoServerVersion() = VERSION
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "appium-espresso-driver",
3
- "version": "7.1.2",
3
+ "version": "7.2.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "appium-espresso-driver",
9
- "version": "7.1.2",
9
+ "version": "7.2.1",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "appium-adb": "^14.0.0",
@@ -14,6 +14,7 @@
14
14
  "asyncbox": "^6.1.0",
15
15
  "axios": "^1.12.2",
16
16
  "bluebird": "^3.5.0",
17
+ "commander": "^14.0.1",
17
18
  "io.appium.settings": "^7.0.1",
18
19
  "lodash": "^4.17.11",
19
20
  "portscanner": "^2.2.0",
@@ -45,7 +46,7 @@
45
46
  "semver": "^7.3.7",
46
47
  "sinon": "^21.0.0",
47
48
  "ts-node": "^10.9.1",
48
- "typescript": "^5.4.2",
49
+ "typescript": "^6.0.3",
49
50
  "webdriverio": "^9.26.0",
50
51
  "xpath": "^0.x"
51
52
  },
@@ -58,29 +59,29 @@
58
59
  }
59
60
  },
60
61
  "node_modules/@appium/base-driver": {
61
- "version": "10.2.2",
62
- "resolved": "https://registry.npmjs.org/@appium/base-driver/-/base-driver-10.2.2.tgz",
63
- "integrity": "sha512-C9Z4bZY0yv8RfFnRYdPExf9PkDjen7jzZe1EpFGXN3LF7U3rVMfnCWG1OwRFF3aU6jhUt144XbMpISeunOFFFA==",
62
+ "version": "10.3.0",
63
+ "resolved": "https://registry.npmjs.org/@appium/base-driver/-/base-driver-10.3.0.tgz",
64
+ "integrity": "sha512-9r+1f9EtcJt9NXIlyHdFMoD7DsAZPzpRq4Kj1hGZf7+26q1SFEyyMAuWxvlWGY7EoyPtPRyMUkM4dHiSK3Q9+w==",
64
65
  "license": "Apache-2.0",
65
66
  "dependencies": {
66
- "@appium/support": "^7.0.6",
67
- "@appium/types": "^1.2.1",
67
+ "@appium/support": "7.1.0",
68
+ "@appium/types": "1.3.0",
68
69
  "@colors/colors": "1.6.0",
69
70
  "async-lock": "1.4.1",
70
71
  "asyncbox": "6.1.0",
71
- "axios": "1.13.6",
72
+ "axios": "1.15.0",
72
73
  "bluebird": "3.7.2",
73
74
  "body-parser": "2.2.2",
74
75
  "express": "5.2.1",
75
76
  "fastest-levenshtein": "1.0.16",
76
77
  "http-status-codes": "2.3.0",
77
- "lodash": "4.17.23",
78
- "lru-cache": "11.2.6",
78
+ "lodash": "4.18.1",
79
+ "lru-cache": "11.3.3",
79
80
  "method-override": "3.0.0",
80
81
  "morgan": "1.10.1",
81
- "path-to-regexp": "8.3.0",
82
+ "path-to-regexp": "8.4.2",
82
83
  "serve-favicon": "2.5.1",
83
- "type-fest": "5.4.4"
84
+ "type-fest": "5.5.0"
84
85
  },
85
86
  "engines": {
86
87
  "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
@@ -90,38 +91,15 @@
90
91
  "spdy": "4.0.2"
91
92
  }
92
93
  },
93
- "node_modules/@appium/base-driver/node_modules/axios": {
94
- "version": "1.13.6",
95
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz",
96
- "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==",
97
- "license": "MIT",
98
- "dependencies": {
99
- "follow-redirects": "^1.15.11",
100
- "form-data": "^4.0.5",
101
- "proxy-from-env": "^1.1.0"
102
- }
103
- },
104
- "node_modules/@appium/base-driver/node_modules/lodash": {
105
- "version": "4.17.23",
106
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
107
- "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
108
- "license": "MIT"
109
- },
110
- "node_modules/@appium/base-driver/node_modules/proxy-from-env": {
111
- "version": "1.1.0",
112
- "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
113
- "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
114
- "license": "MIT"
115
- },
116
94
  "node_modules/@appium/logger": {
117
- "version": "2.0.5",
118
- "resolved": "https://registry.npmjs.org/@appium/logger/-/logger-2.0.5.tgz",
119
- "integrity": "sha512-AR0bMGsYXGURKwRk8cYR3MmKWOf5cq7tMgT29Kloeb3DyaeIr05bRO02Z9/GBz2wb2zNpnlAHs7mMMUTmm1SmQ==",
95
+ "version": "2.0.6",
96
+ "resolved": "https://registry.npmjs.org/@appium/logger/-/logger-2.0.6.tgz",
97
+ "integrity": "sha512-9e8n9CtINBwi1ASEU5OyswmR2F7OnbrGfmf9yTy9i+rx4GR9RJlEp0/arsxvuyWCep67tOmM4FiRyXxxHjOK5Q==",
120
98
  "license": "ISC",
121
99
  "dependencies": {
122
100
  "console-control-strings": "1.1.0",
123
- "lodash": "4.17.23",
124
- "lru-cache": "11.2.6",
101
+ "lodash": "4.18.1",
102
+ "lru-cache": "11.3.3",
125
103
  "set-blocking": "2.0.0"
126
104
  },
127
105
  "engines": {
@@ -129,12 +107,6 @@
129
107
  "npm": ">=10"
130
108
  }
131
109
  },
132
- "node_modules/@appium/logger/node_modules/lodash": {
133
- "version": "4.17.23",
134
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
135
- "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
136
- "license": "MIT"
137
- },
138
110
  "node_modules/@appium/schema": {
139
111
  "version": "1.1.0",
140
112
  "resolved": "https://registry.npmjs.org/@appium/schema/-/schema-1.1.0.tgz",
@@ -149,18 +121,18 @@
149
121
  }
150
122
  },
151
123
  "node_modules/@appium/support": {
152
- "version": "7.0.6",
153
- "resolved": "https://registry.npmjs.org/@appium/support/-/support-7.0.6.tgz",
154
- "integrity": "sha512-Pt3T/c43eG8fhsMVmPcG4t/KB70E/MdseLT6A8m1HufqePry/6N0fu1vjxWsVpcbdnUzyfn4Iyjsj6LmZnK8YQ==",
124
+ "version": "7.1.0",
125
+ "resolved": "https://registry.npmjs.org/@appium/support/-/support-7.1.0.tgz",
126
+ "integrity": "sha512-kY4Qv4TzLCYmZnN2eNptEa8RiRzpbimIQ6tKuDaqLC2Y3q5Al4NumL/xRQAvfXJq/hNezq2Jh8NwciEW8zX/0g==",
155
127
  "license": "Apache-2.0",
156
128
  "dependencies": {
157
- "@appium/logger": "^2.0.5",
158
- "@appium/tsconfig": "^1.1.2",
159
- "@appium/types": "^1.2.1",
129
+ "@appium/logger": "2.0.6",
130
+ "@appium/tsconfig": "1.1.2",
131
+ "@appium/types": "1.3.0",
160
132
  "@colors/colors": "1.6.0",
161
133
  "archiver": "7.0.1",
162
134
  "asyncbox": "6.1.0",
163
- "axios": "1.13.6",
135
+ "axios": "1.15.0",
164
136
  "base64-stream": "1.0.0",
165
137
  "bluebird": "3.7.2",
166
138
  "bplist-creator": "0.1.1",
@@ -171,7 +143,7 @@
171
143
  "jsftp": "2.1.3",
172
144
  "klaw": "4.1.0",
173
145
  "lockfile": "1.0.4",
174
- "lodash": "4.17.23",
146
+ "lodash": "4.18.1",
175
147
  "log-symbols": "7.0.1",
176
148
  "ncp": "2.0.0",
177
149
  "package-directory": "8.2.0",
@@ -179,15 +151,15 @@
179
151
  "pluralize": "8.0.0",
180
152
  "read-pkg": "10.1.0",
181
153
  "resolve-from": "5.0.0",
182
- "sanitize-filename": "1.6.3",
154
+ "sanitize-filename": "1.6.4",
183
155
  "semver": "7.7.4",
184
156
  "shell-quote": "1.8.3",
185
157
  "supports-color": "10.2.2",
186
- "teen_process": "4.0.10",
187
- "type-fest": "5.4.4",
158
+ "teen_process": "4.1.0",
159
+ "type-fest": "5.5.0",
188
160
  "uuid": "13.0.0",
189
161
  "which": "6.0.1",
190
- "yauzl": "3.2.0"
162
+ "yauzl": "3.3.0"
191
163
  },
192
164
  "engines": {
193
165
  "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
@@ -197,33 +169,10 @@
197
169
  "sharp": "0.34.5"
198
170
  }
199
171
  },
200
- "node_modules/@appium/support/node_modules/axios": {
201
- "version": "1.13.6",
202
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz",
203
- "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==",
204
- "license": "MIT",
205
- "dependencies": {
206
- "follow-redirects": "^1.15.11",
207
- "form-data": "^4.0.5",
208
- "proxy-from-env": "^1.1.0"
209
- }
210
- },
211
- "node_modules/@appium/support/node_modules/lodash": {
212
- "version": "4.17.23",
213
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
214
- "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
215
- "license": "MIT"
216
- },
217
- "node_modules/@appium/support/node_modules/proxy-from-env": {
218
- "version": "1.1.0",
219
- "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
220
- "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
221
- "license": "MIT"
222
- },
223
172
  "node_modules/@appium/support/node_modules/teen_process": {
224
- "version": "4.0.10",
225
- "resolved": "https://registry.npmjs.org/teen_process/-/teen_process-4.0.10.tgz",
226
- "integrity": "sha512-xEQ0UCeUoprhDDADFKaxv9nzE+PlDTw/mgG0aX7ccxg+EGx8bCEiX25qQ0JPSjSS66sQyXEPFQR3nV5ZxiOcmw==",
173
+ "version": "4.1.0",
174
+ "resolved": "https://registry.npmjs.org/teen_process/-/teen_process-4.1.0.tgz",
175
+ "integrity": "sha512-AN8y3MYPExB3r2mkkX9r0wEF4xPfhKOj6YvcfeIqQai+GVhTIhjjdkPvwI5CFT4z8UQ5aZWldzbJ+jNejYAdGw==",
227
176
  "license": "Apache-2.0",
228
177
  "dependencies": {
229
178
  "lodash": "^4.17.21",
@@ -248,15 +197,15 @@
248
197
  }
249
198
  },
250
199
  "node_modules/@appium/types": {
251
- "version": "1.2.1",
252
- "resolved": "https://registry.npmjs.org/@appium/types/-/types-1.2.1.tgz",
253
- "integrity": "sha512-2aX3oXsYddrNPWpimpqpMM/Bdf7iEhvlWjIQGh0xBqx7EbtSlWAT8NMB59h0mnKbotVrOC+av8a78AqHjOPJHg==",
200
+ "version": "1.3.0",
201
+ "resolved": "https://registry.npmjs.org/@appium/types/-/types-1.3.0.tgz",
202
+ "integrity": "sha512-Gv4ev/5K5N7TvAHqem2DmB50zipC951QlmCDpuxDNHQl2dtCr20vJgnN8if7upqLcBX/6yNp3udR+f1n99zgcQ==",
254
203
  "license": "Apache-2.0",
255
204
  "dependencies": {
256
- "@appium/logger": "^2.0.5",
257
- "@appium/schema": "^1.1.0",
258
- "@appium/tsconfig": "^1.1.2",
259
- "type-fest": "5.4.4"
205
+ "@appium/logger": "2.0.6",
206
+ "@appium/schema": "1.1.0",
207
+ "@appium/tsconfig": "1.1.2",
208
+ "type-fest": "5.5.0"
260
209
  },
261
210
  "engines": {
262
211
  "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
@@ -296,9 +245,9 @@
296
245
  }
297
246
  },
298
247
  "node_modules/@emnapi/runtime": {
299
- "version": "1.9.2",
300
- "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz",
301
- "integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==",
248
+ "version": "1.10.0",
249
+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz",
250
+ "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==",
302
251
  "extraneous": true,
303
252
  "license": "MIT",
304
253
  "dependencies": {
@@ -533,9 +482,9 @@
533
482
  }
534
483
  },
535
484
  "node_modules/appium-adb": {
536
- "version": "14.3.1",
537
- "resolved": "https://registry.npmjs.org/appium-adb/-/appium-adb-14.3.1.tgz",
538
- "integrity": "sha512-Pv9Ti0jji0Q0QewBJfjPiECV5IO6ex5qK6YugZknxxjJ5QadLDjt/FW6z4/THGAQJdbYriwqrxTqLxB6+DwqBA==",
485
+ "version": "14.3.2",
486
+ "resolved": "https://registry.npmjs.org/appium-adb/-/appium-adb-14.3.2.tgz",
487
+ "integrity": "sha512-V3YLPzHHG8vjw8oQ7d7sR6OvbadLIYwv5WYji3/YBrAe0NTRzhzj07e/m3XML+ipDOweZhKBebAclavdgkJWWg==",
539
488
  "license": "Apache-2.0",
540
489
  "dependencies": {
541
490
  "@appium/support": "^7.0.0-rc.1",
@@ -554,15 +503,15 @@
554
503
  }
555
504
  },
556
505
  "node_modules/appium-android-driver": {
557
- "version": "13.1.0",
558
- "resolved": "https://registry.npmjs.org/appium-android-driver/-/appium-android-driver-13.1.0.tgz",
559
- "integrity": "sha512-ZnRXwbdt1k2nX0zO9OZ+A7WdHJobpQAnR458b7uchJ2S3rsqlqKJDeQtUuXawVuFENCnk4Y89koaQAHIghogBw==",
506
+ "version": "13.1.2",
507
+ "resolved": "https://registry.npmjs.org/appium-android-driver/-/appium-android-driver-13.1.2.tgz",
508
+ "integrity": "sha512-ZzzJvGjxhGSNEwgK3DS8zs5yXAQ9u7n+vRV25dYN2Dt1ORrvsbEBnKhv9+5a/FeV9ivKg47J6r2kDV8DcDL8LQ==",
560
509
  "license": "Apache-2.0",
561
510
  "dependencies": {
562
511
  "@appium/support": "^7.0.0-rc.1",
563
512
  "@colors/colors": "^1.6.0",
564
513
  "appium-adb": "^14.3.0",
565
- "appium-chromedriver": "^8.0.18",
514
+ "appium-chromedriver": "^8.2.25",
566
515
  "asyncbox": "^6.1.0",
567
516
  "axios": "^1.x",
568
517
  "bluebird": "^3.4.7",
@@ -585,9 +534,9 @@
585
534
  }
586
535
  },
587
536
  "node_modules/appium-chromedriver": {
588
- "version": "8.2.24",
589
- "resolved": "https://registry.npmjs.org/appium-chromedriver/-/appium-chromedriver-8.2.24.tgz",
590
- "integrity": "sha512-F7On2aGnzaBCo9AyyxmMDC6KPoNDA93EfGfkuru3rcrQA5UrRXvD3nidNsspbwF+7oQrTDm03EgUx1zkdVhbFw==",
537
+ "version": "8.2.27",
538
+ "resolved": "https://registry.npmjs.org/appium-chromedriver/-/appium-chromedriver-8.2.27.tgz",
539
+ "integrity": "sha512-7E3akwZ8rxc8LJCouoAAnUHiuKATm8gwO7qNq4OY0FL85jAltdXfY6z1jBT2NO7UrIacSeUpMMMzo8mypWrr+g==",
591
540
  "license": "Apache-2.0",
592
541
  "dependencies": {
593
542
  "@appium/base-driver": "^10.0.0-rc.2",
@@ -645,9 +594,9 @@
645
594
  }
646
595
  },
647
596
  "node_modules/archiver-utils/node_modules/brace-expansion": {
648
- "version": "2.0.3",
649
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
650
- "integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
597
+ "version": "2.1.0",
598
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz",
599
+ "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==",
651
600
  "license": "MIT",
652
601
  "dependencies": {
653
602
  "balanced-match": "^1.0.0"
@@ -750,9 +699,9 @@
750
699
  "license": "MIT"
751
700
  },
752
701
  "node_modules/axios": {
753
- "version": "1.14.0",
754
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.14.0.tgz",
755
- "integrity": "sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ==",
702
+ "version": "1.15.0",
703
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz",
704
+ "integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==",
756
705
  "license": "MIT",
757
706
  "dependencies": {
758
707
  "follow-redirects": "^1.15.11",
@@ -795,9 +744,9 @@
795
744
  }
796
745
  },
797
746
  "node_modules/bare-fs": {
798
- "version": "4.6.0",
799
- "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.6.0.tgz",
800
- "integrity": "sha512-2YkS7NuiJceSEbyEOdSNLE9tsGd+f4+f7C+Nik/MCk27SYdwIMPT/yRKvg++FZhQXgk0KWJKJyXX9RhVV0RGqA==",
747
+ "version": "4.7.1",
748
+ "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.7.1.tgz",
749
+ "integrity": "sha512-WDRsyVN52eAx/lBamKD6uyw8H4228h/x0sGGGegOamM2cd7Pag88GfMQalobXI+HaEUxpCkbKQUDOQqt9wawRw==",
801
750
  "license": "Apache-2.0",
802
751
  "dependencies": {
803
752
  "bare-events": "^2.5.4",
@@ -837,9 +786,9 @@
837
786
  }
838
787
  },
839
788
  "node_modules/bare-stream": {
840
- "version": "2.12.0",
841
- "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.12.0.tgz",
842
- "integrity": "sha512-w28i8lkBgREV3rPXGbgK+BO66q+ZpKqRWrZLiCdmmUlLPrQ45CzkvRhN+7lnv00Gpi2zy5naRxnUFAxCECDm9g==",
789
+ "version": "2.13.0",
790
+ "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.13.0.tgz",
791
+ "integrity": "sha512-3zAJRZMDFGjdn+RVnNpF9kuELw+0Fl3lpndM4NcEOhb9zwtSo/deETfuIwMSE5BXanA0FrN1qVjffGwAg2Y7EA==",
843
792
  "license": "Apache-2.0",
844
793
  "dependencies": {
845
794
  "streamx": "^2.25.0",
@@ -1132,6 +1081,15 @@
1132
1081
  "node": ">= 0.8"
1133
1082
  }
1134
1083
  },
1084
+ "node_modules/commander": {
1085
+ "version": "14.0.3",
1086
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
1087
+ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
1088
+ "license": "MIT",
1089
+ "engines": {
1090
+ "node": ">=20"
1091
+ }
1092
+ },
1135
1093
  "node_modules/compare-versions": {
1136
1094
  "version": "6.1.1",
1137
1095
  "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz",
@@ -1319,9 +1277,9 @@
1319
1277
  "optional": true
1320
1278
  },
1321
1279
  "node_modules/diff": {
1322
- "version": "8.0.3",
1323
- "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.3.tgz",
1324
- "integrity": "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==",
1280
+ "version": "8.0.4",
1281
+ "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.4.tgz",
1282
+ "integrity": "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==",
1325
1283
  "extraneous": true,
1326
1284
  "license": "BSD-3-Clause",
1327
1285
  "engines": {
@@ -1564,9 +1522,9 @@
1564
1522
  }
1565
1523
  },
1566
1524
  "node_modules/follow-redirects": {
1567
- "version": "1.15.11",
1568
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
1569
- "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
1525
+ "version": "1.16.0",
1526
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
1527
+ "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
1570
1528
  "funding": [
1571
1529
  {
1572
1530
  "type": "individual",
@@ -2298,9 +2256,9 @@
2298
2256
  }
2299
2257
  },
2300
2258
  "node_modules/lru-cache": {
2301
- "version": "11.2.6",
2302
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.6.tgz",
2303
- "integrity": "sha512-ESL2CrkS/2wTPfuend7Zhkzo2u0daGJ/A2VucJOgQ/C48S/zB8MMeMHSGKYpXhIjbPxfuezITkaBH1wqv00DDQ==",
2259
+ "version": "11.3.3",
2260
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.3.3.tgz",
2261
+ "integrity": "sha512-JvNw9Y81y33E+BEYPr0U7omo+U9AySnsMsEiXgwT6yqd31VQWTLNQqmT4ou5eqPFUrTfIDFta2wKhB1hyohtAQ==",
2304
2262
  "license": "BlueOak-1.0.0",
2305
2263
  "engines": {
2306
2264
  "node": "20 || >=22"
@@ -2710,9 +2668,9 @@
2710
2668
  }
2711
2669
  },
2712
2670
  "node_modules/path-to-regexp": {
2713
- "version": "8.3.0",
2714
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
2715
- "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",
2671
+ "version": "8.4.2",
2672
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
2673
+ "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
2716
2674
  "license": "MIT",
2717
2675
  "funding": {
2718
2676
  "type": "opencollective",
@@ -2824,9 +2782,9 @@
2824
2782
  }
2825
2783
  },
2826
2784
  "node_modules/qs": {
2827
- "version": "6.15.0",
2828
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz",
2829
- "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==",
2785
+ "version": "6.15.1",
2786
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.1.tgz",
2787
+ "integrity": "sha512-6YHEFRL9mfgcAvql/XhwTvf5jKcOiiupt2FiJxHkiX1z4j7WL8J/jRHYLluORvc1XxB5rV20KoeK00gVJamspg==",
2830
2788
  "license": "BSD-3-Clause",
2831
2789
  "dependencies": {
2832
2790
  "side-channel": "^1.1.0"
@@ -2931,9 +2889,9 @@
2931
2889
  }
2932
2890
  },
2933
2891
  "node_modules/readdir-glob/node_modules/brace-expansion": {
2934
- "version": "2.0.3",
2935
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
2936
- "integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
2892
+ "version": "2.1.0",
2893
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz",
2894
+ "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==",
2937
2895
  "license": "MIT",
2938
2896
  "dependencies": {
2939
2897
  "balanced-match": "^1.0.0"
@@ -2989,9 +2947,9 @@
2989
2947
  "license": "MIT"
2990
2948
  },
2991
2949
  "node_modules/sanitize-filename": {
2992
- "version": "1.6.3",
2993
- "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz",
2994
- "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==",
2950
+ "version": "1.6.4",
2951
+ "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.4.tgz",
2952
+ "integrity": "sha512-9ZyI08PsvdQl2r/bBIGubpVdR3RR9sY6RDiWFPreA21C/EFlQhmgo20UZlNjZMMZNubusLhAQozkA0Od5J21Eg==",
2995
2953
  "license": "WTFPL OR ISC",
2996
2954
  "dependencies": {
2997
2955
  "truncate-utf8-bytes": "^1.0.0"
@@ -3216,13 +3174,13 @@
3216
3174
  }
3217
3175
  },
3218
3176
  "node_modules/side-channel-list": {
3219
- "version": "1.0.0",
3220
- "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
3221
- "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
3177
+ "version": "1.0.1",
3178
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
3179
+ "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
3222
3180
  "license": "MIT",
3223
3181
  "dependencies": {
3224
3182
  "es-errors": "^1.3.0",
3225
- "object-inspect": "^1.13.3"
3183
+ "object-inspect": "^1.13.4"
3226
3184
  },
3227
3185
  "engines": {
3228
3186
  "node": ">= 0.4"
@@ -3530,9 +3488,9 @@
3530
3488
  }
3531
3489
  },
3532
3490
  "node_modules/teen_process": {
3533
- "version": "4.1.0",
3534
- "resolved": "https://registry.npmjs.org/teen_process/-/teen_process-4.1.0.tgz",
3535
- "integrity": "sha512-AN8y3MYPExB3r2mkkX9r0wEF4xPfhKOj6YvcfeIqQai+GVhTIhjjdkPvwI5CFT4z8UQ5aZWldzbJ+jNejYAdGw==",
3491
+ "version": "4.1.1",
3492
+ "resolved": "https://registry.npmjs.org/teen_process/-/teen_process-4.1.1.tgz",
3493
+ "integrity": "sha512-E9gaYuVaWrvbxzZDgZ/MjWkPKqiKETBWSRy06qz1GOyKU22mI76JrxzaGbeddcHcmW8ZFXPowPv1ad3a7S+Xvg==",
3536
3494
  "license": "Apache-2.0",
3537
3495
  "dependencies": {
3538
3496
  "lodash": "^4.17.21",
@@ -3593,9 +3551,9 @@
3593
3551
  "license": "0BSD"
3594
3552
  },
3595
3553
  "node_modules/type-fest": {
3596
- "version": "5.4.4",
3597
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.4.4.tgz",
3598
- "integrity": "sha512-JnTrzGu+zPV3aXIUhnyWJj4z/wigMsdYajGLIYakqyOW1nPllzXEJee0QQbHj+CTIQtXGlAjuK0UY+2xTyjVAw==",
3554
+ "version": "5.5.0",
3555
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.5.0.tgz",
3556
+ "integrity": "sha512-PlBfpQwiUvGViBNX84Yxwjsdhd1TUlXr6zjX7eoirtCPIr08NAmxwa+fcYBTeRQxHo9YC9wwF3m9i700sHma8g==",
3599
3557
  "license": "(MIT OR CC0-1.0)",
3600
3558
  "dependencies": {
3601
3559
  "tagged-tag": "^1.0.0"
@@ -3817,9 +3775,9 @@
3817
3775
  "license": "ISC"
3818
3776
  },
3819
3777
  "node_modules/ws": {
3820
- "version": "8.19.0",
3821
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz",
3822
- "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==",
3778
+ "version": "8.20.0",
3779
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
3780
+ "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",
3823
3781
  "license": "MIT",
3824
3782
  "engines": {
3825
3783
  "node": ">=10.0.0"
@@ -3935,9 +3893,9 @@
3935
3893
  }
3936
3894
  },
3937
3895
  "node_modules/yauzl": {
3938
- "version": "3.2.0",
3939
- "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-3.2.0.tgz",
3940
- "integrity": "sha512-Ow9nuGZE+qp1u4JIPvg+uCiUr7xGQWdff7JQSk5VGYTAZMDe2q8lxJ10ygv10qmSj031Ty/6FNJpLO4o1Sgc+w==",
3896
+ "version": "3.3.0",
3897
+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-3.3.0.tgz",
3898
+ "integrity": "sha512-PtGEvEP30p7sbIBJKUBjUnqgTVOyMURc4dLo9iNyAJnNIEz9pm88cCXF21w94Kg3k6RXkeZh5DHOGS0qEONvNQ==",
3941
3899
  "license": "MIT",
3942
3900
  "dependencies": {
3943
3901
  "buffer-crc32": "~0.2.3",
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "automated testing",
8
8
  "android"
9
9
  ],
10
- "version": "7.1.2",
10
+ "version": "7.2.1",
11
11
  "author": "Appium Contributors",
12
12
  "license": "Apache-2.0",
13
13
  "repository": {
@@ -34,8 +34,8 @@
34
34
  ],
35
35
  "mainClass": "EspressoDriver",
36
36
  "scripts": {
37
- "print-espresso-path": "./scripts/print-espresso-path.js",
38
- "build-espresso": "./scripts/build-espresso.js"
37
+ "print-espresso-path": "./scripts/print-espresso-path.mjs",
38
+ "build-espresso": "./scripts/build-espresso.mjs"
39
39
  },
40
40
  "doctor": {
41
41
  "checks": [
@@ -78,6 +78,7 @@
78
78
  "asyncbox": "^6.1.0",
79
79
  "axios": "^1.12.2",
80
80
  "bluebird": "^3.5.0",
81
+ "commander": "^14.0.1",
81
82
  "io.appium.settings": "^7.0.1",
82
83
  "lodash": "^4.17.11",
83
84
  "portscanner": "^2.2.0",
@@ -100,7 +101,7 @@
100
101
  "format": "prettier -w ./lib ./test",
101
102
  "format:check": "prettier --check ./lib ./test",
102
103
  "prepare": "npm run rebuild",
103
- "sync-version": "node ./scripts/sync-version.js --package-version=${npm_package_version}",
104
+ "sync-version": "node ./scripts/sync-version.mjs --package-version=${npm_package_version}",
104
105
  "test": "npm run test:node",
105
106
  "test:node": "mocha --exit --timeout 1m \"./test/unit/**/*-specs.ts\"",
106
107
  "test:server": "cd espresso-server && ./gradlew test --stacktrace || cd ..",
@@ -135,7 +136,7 @@
135
136
  "sinon": "^21.0.0",
136
137
  "semver": "^7.3.7",
137
138
  "ts-node": "^10.9.1",
138
- "typescript": "^5.4.2",
139
+ "typescript": "^6.0.3",
139
140
  "webdriverio": "^9.26.0",
140
141
  "xpath": "^0.x"
141
142
  }
@@ -0,0 +1,109 @@
1
+ import _ from 'lodash';
2
+ import path from 'node:path';
3
+ import {fileURLToPath} from 'node:url';
4
+ import {Command} from 'commander';
5
+ import {logger, fs} from 'appium/support.js';
6
+ import {ServerBuilder} from '../build/lib/server-builder.js';
7
+
8
+ const LOG = logger.getLogger('EspressoBuild');
9
+
10
+ const ROOT_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
11
+ const ESPRESSO_SERVER_ROOT = path.join(ROOT_DIR, 'espresso-server');
12
+ const ESPRESSO_SERVER_BUILD = path.join(ESPRESSO_SERVER_ROOT, 'app', 'build');
13
+
14
+ /**
15
+ * @param {BuildOptions} options
16
+ */
17
+ async function buildEspressoServer(options) {
18
+ LOG.info(`Building espresso server in '${ESPRESSO_SERVER_BUILD}'`);
19
+
20
+ const opts = {
21
+ serverPath: ESPRESSO_SERVER_ROOT,
22
+ showGradleLog: options.showGradleLog,
23
+ };
24
+
25
+ if (options.testAppPackage) {
26
+ opts.testAppPackage = options.testAppPackage;
27
+ }
28
+
29
+ if (options.buildConfig) {
30
+ if (!(await fs.exists(options.buildConfig))) {
31
+ throw new Error(
32
+ `Cannot find build config at '${options.buildConfig}'. Please provide a valid absolute path to it.`
33
+ );
34
+ }
35
+ try {
36
+ const buildConfigurationStr = await fs.readFile(options.buildConfig, 'utf8');
37
+ opts.buildConfiguration = JSON.parse(buildConfigurationStr);
38
+ LOG.info(`The espresso build config is ${JSON.stringify(opts.buildConfiguration)}`);
39
+ } catch (e) {
40
+ throw new Error(
41
+ `Failed to parse the build config at '${options.buildConfig}'. ` +
42
+ `Please make sure it is a valid JSON file.`, {cause: e}
43
+ );
44
+ }
45
+ }
46
+
47
+ const builder = new ServerBuilder(LOG, opts);
48
+ try {
49
+ await builder.build();
50
+ } catch (e) {
51
+ let errorMessage = `Failed to build the espresso server`;
52
+ if (!isGradleLogEnabled(options)) {
53
+ errorMessage += `. Set SHOW_GRADLE_LOG environment variable to true to check the gradle log.`;
54
+ }
55
+ throw new Error(errorMessage, {cause: e});
56
+ }
57
+
58
+ const dstPath = path.resolve(
59
+ ESPRESSO_SERVER_BUILD,
60
+ 'outputs',
61
+ 'apk',
62
+ 'androidTest',
63
+ 'debug',
64
+ 'app-debug-androidTest.apk',
65
+ );
66
+ if (await fs.exists(dstPath)) {
67
+ LOG.info(`Full path to the server APK: ${dstPath}`);
68
+ } else {
69
+ LOG.info(`Full path to the server build folder: ${ESPRESSO_SERVER_BUILD}`);
70
+ }
71
+ }
72
+
73
+ /**
74
+ * @param {BuildOptions} options
75
+ * @returns {boolean}
76
+ */
77
+ function isGradleLogEnabled(options) {
78
+ return Boolean(options.showGradleLog ||
79
+ !_.isEmpty(process.env.SHOW_GRADLE_LOG) && ['1', 'true'].includes(_.toLower(process.env.SHOW_GRADLE_LOG))
80
+ );
81
+ }
82
+
83
+ async function main() {
84
+ const program = new Command();
85
+ program
86
+ .name('appium driver run espresso build-espresso')
87
+ .description('Build the Espresso server APK')
88
+ .option('--show-gradle-log', 'Show Gradle logs during build')
89
+ .option('--test-app-package <package>', 'App package to target for test server build')
90
+ .option('--build-config <path>', 'Absolute path to a JSON build configuration file')
91
+ .action(async (options) => {
92
+ await buildEspressoServer({
93
+ showGradleLog: isGradleLogEnabled(options),
94
+ testAppPackage: options.testAppPackage ?? process.env.TEST_APP_PACKAGE,
95
+ buildConfig: options.buildConfig ?? process.env.ESPRESSO_BUILD_CONFIG,
96
+ });
97
+ });
98
+
99
+ await program.parseAsync(process.argv);
100
+ }
101
+
102
+ await main();
103
+
104
+ /**
105
+ * @typedef {Object} BuildOptions
106
+ * @property {boolean | undefined} showGradleLog
107
+ * @property {string | undefined} testAppPackage
108
+ * @property {string | undefined} buildConfig
109
+ */
@@ -0,0 +1,25 @@
1
+ import path from 'node:path';
2
+ import {fileURLToPath} from 'node:url';
3
+ import {Command} from 'commander';
4
+
5
+ /**
6
+ * @returns {void}
7
+ */
8
+ function printEspressoServerPath() {
9
+ const dstPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'espresso-server');
10
+ console.log(dstPath); // eslint-disable-line no-console
11
+ }
12
+
13
+ async function main() {
14
+ const program = new Command();
15
+ program
16
+ .name('appium driver run espresso print-espresso-path')
17
+ .description('Print the Espresso server path')
18
+ .action(() => {
19
+ printEspressoServerPath();
20
+ });
21
+
22
+ await program.parseAsync(process.argv);
23
+ }
24
+
25
+ await main();
@@ -0,0 +1,65 @@
1
+ import path from 'node:path';
2
+ import {fileURLToPath} from 'node:url';
3
+ import {Command} from 'commander';
4
+ import {logger, fs} from 'appium/support.js';
5
+ import semver from 'semver';
6
+
7
+ const LOG = logger.getLogger('VersionSync');
8
+
9
+ const ROOT_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
10
+ const ESPRESSO_SERVER_ROOT = path.join(ROOT_DIR, 'espresso-server');
11
+ const VERSION_FILE = path.join(
12
+ ESPRESSO_SERVER_ROOT,
13
+ 'library',
14
+ 'src',
15
+ 'main',
16
+ 'java',
17
+ 'io',
18
+ 'appium',
19
+ 'espressoserver',
20
+ 'lib',
21
+ 'helpers',
22
+ 'Version.kt'
23
+ );
24
+ const VERSION_PATTERN = /VERSION\s*=\s*"([0-9.]+)"/;
25
+
26
+ /**
27
+ * @param {string} packageVersion
28
+ * @returns {Promise<void>}
29
+ */
30
+ async function syncModuleVersion(packageVersion) {
31
+ const origContent = await fs.readFile(VERSION_FILE, 'utf8');
32
+ const espressoVersionMatch = VERSION_PATTERN.exec(origContent);
33
+ if (!espressoVersionMatch) {
34
+ throw new Error(`Could not parse Espresso module version from '${VERSION_FILE}'`);
35
+ }
36
+ const updatedContent = origContent.replace(espressoVersionMatch[1], packageVersion);
37
+ await fs.writeFile(VERSION_FILE, updatedContent, 'utf8');
38
+ LOG.info(`Synchronized module version '${packageVersion}' to '${VERSION_FILE}'`);
39
+ }
40
+
41
+ async function main() {
42
+ const program = new Command();
43
+ program
44
+ .name('node ./scripts/sync-version.mjs')
45
+ .description('Sync package version into Espresso server module source')
46
+ .requiredOption(
47
+ '--package-version <version>',
48
+ 'Package version to synchronize',
49
+ (value) => {
50
+ if (!semver.valid(value)) {
51
+ throw new Error(
52
+ `Invalid version specified '${value}'. The value must be a valid semver string like '1.2.3'`
53
+ );
54
+ }
55
+ return value;
56
+ }
57
+ )
58
+ .action(async (options) => {
59
+ await syncModuleVersion(options.packageVersion);
60
+ });
61
+
62
+ await program.parseAsync(process.argv);
63
+ }
64
+
65
+ await main();
@@ -1,56 +0,0 @@
1
- const _ = require('lodash');
2
- const path = require('node:path');
3
- const { logger, fs } = require('appium/support');
4
- const { ServerBuilder } = require('../build/lib/server-builder.js');
5
-
6
- const LOG = new logger.getLogger('EspressoBuild');
7
-
8
- const ROOT_DIR = path.resolve(__dirname, '..');
9
- const ESPRESSO_SERVER_ROOT = path.join(ROOT_DIR, 'espresso-server');
10
-
11
- const ESPRESSO_SERVER_BUILD = path.join(ESPRESSO_SERVER_ROOT, 'app', 'build');
12
-
13
- async function buildEspressoServer () {
14
-
15
- LOG.info(`Deleting the build directory ${ESPRESSO_SERVER_BUILD}`);
16
-
17
- const opts = {
18
- serverPath: ESPRESSO_SERVER_ROOT,
19
- showGradleLog: !_.isEmpty(process.env.SHOW_GRADLE_LOG) && ['1', 'true'].includes(_.toLower(process.env.SHOW_GRADLE_LOG))
20
- };
21
-
22
- if (process.env.TEST_APP_PACKAGE) {
23
- opts.testAppPackage = process.env.TEST_APP_PACKAGE;
24
- }
25
-
26
- if (process.env.ESPRESSO_BUILD_CONFIG) {
27
- if (!(await fs.exists(process.env.ESPRESSO_BUILD_CONFIG))) {
28
- throw new Error(`'${process.env.ESPRESSO_BUILD_CONFIG}' did not exist. Please set the path as an absolute path.`);
29
- }
30
- try {
31
- const buildConfigurationStr = await fs.readFile(process.env.ESPRESSO_BUILD_CONFIG, 'utf8');
32
- opts.buildConfiguration = JSON.parse(buildConfigurationStr);
33
- LOG.info(`The espresso build config is ${JSON.stringify(opts.buildConfiguration)}`);
34
- } catch (e) {
35
- throw new Error(`Failed to parse the ${process.env.ESPRESSO_BUILD_CONFIG}. ` +
36
- `Please make sure that the JSON is valid format. Error: ${e}`);
37
- }
38
- }
39
-
40
- const builder = new ServerBuilder(LOG, opts);
41
- try {
42
- await builder.build();
43
- } catch (e) {
44
- throw new Error(`Failed to build the espresso server. ` +
45
- `SHOW_GRADLE_LOG=true environment variable helps to check the gradle log. Error: ${e}`);
46
- }
47
-
48
- const dstPath = path.resolve(ESPRESSO_SERVER_ROOT, 'app', 'build', 'outputs', 'apk', 'androidTest', 'debug', 'app-debug-androidTest.apk');
49
- if (await fs.exists(dstPath)) {
50
- LOG.info(`Full path to the server APK: ${dstPath}`);
51
- } else {
52
- LOG.info(`Full path to the server build folder: ${ESPRESSO_SERVER_BUILD}`);
53
- }
54
- }
55
-
56
- (async () => await buildEspressoServer())();
@@ -1,8 +0,0 @@
1
- const path = require('node:path');
2
-
3
- function printEspressoServerPath () {
4
- const dstPath = path.resolve(__dirname, '..', 'espresso-server');
5
- console.log(dstPath); // eslint-disable-line no-console
6
- }
7
-
8
- printEspressoServerPath();
@@ -1,47 +0,0 @@
1
- const path = require('node:path');
2
- const { logger, fs } = require('appium/support');
3
- const semver = require('semver');
4
-
5
- const LOG = logger.getLogger('VersionSync');
6
-
7
- const ROOT_DIR = path.resolve(__dirname, '..');
8
- const ESPRESSO_SERVER_ROOT = path.join(ROOT_DIR, 'espresso-server');
9
- const VERSION_FILE = path.join(
10
- ESPRESSO_SERVER_ROOT, 'library', 'src', 'main', 'java',
11
- 'io', 'appium', 'espressoserver',
12
- 'lib', 'helpers', 'Version.kt'
13
- );
14
- const VERSION_PATTERN = /VERSION\s*=\s*"([0-9.]+)"/;
15
-
16
- function parseArgValue (argName) {
17
- const argNamePattern = new RegExp(`^--${argName}\\b`);
18
- for (let i = 1; i < process.argv.length; ++i) {
19
- const arg = process.argv[i];
20
- if (argNamePattern.test(arg)) {
21
- return arg.includes('=') ? arg.split('=')[1] : process.argv[i + 1];
22
- }
23
- }
24
- return null;
25
- }
26
-
27
- async function syncModuleVersion () {
28
- const origContent = await fs.readFile(VERSION_FILE, 'utf8');
29
- const espressoVersionMatch = VERSION_PATTERN.exec(origContent);
30
- if (!espressoVersionMatch) {
31
- throw new Error(`Could not parse Espresso module version from '${VERSION_FILE}'`);
32
- }
33
- const packageVersion = parseArgValue('package-version');
34
- if (!packageVersion) {
35
- throw new Error('No package version argument (use `--package-version=xxx`)');
36
- }
37
- if (!semver.valid(packageVersion)) {
38
- throw new Error(
39
- `Invalid version specified '${packageVersion}'. Version should be in the form '1.2.3'`
40
- );
41
- }
42
- const updatedContent = origContent.replace(espressoVersionMatch[1], packageVersion);
43
- await fs.writeFile(VERSION_FILE, updatedContent, 'utf8');
44
- LOG.info(`Synchronized module version '${packageVersion}' to '${VERSION_FILE}'`);
45
- }
46
-
47
- (async () => await syncModuleVersion())();