-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
feat: add building espresso server command via appium command #858
feat: add building espresso server command via appium command #858
Conversation
…a/appium-espresso-driver into kazucocoa/espresso-server-build
scripts/build-espresso.js
Outdated
await builder.build(); | ||
|
||
const dstPath = path.resolve(ESPRESSO_SERVER_ROOT, 'app', 'build', 'outputs', 'apk', 'androidTest', 'debug'); | ||
console.log(`The built server apk, app-debug-androidTest.apk, is in ${dstPath}`); // eslint-disable-line no-console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather just show the full path together with the file name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered the way as well, but I expected the primary usage was to open the path with Finder (on macOS for example) to refer to the apk instead of opening the apk itself.
Some terminal tools can open the path directly. e.g. cmd + click the link. When they open the path, if the path is .apk
, the system will open an application instead of the Finder. Some tools require selecting the entire path and copy&paste it. This does not have much differences in the full path vs the file's directory.
Thus, at this time, showing the directory helps the expected use case with some tools, but other tools do not have differences to reach the .apk. So I did the current method.
I like the current way for this use case I expected, but I can put the full path instead.
scripts/build-espresso.js
Outdated
} | ||
|
||
const dstPath = path.resolve(ESPRESSO_SERVER_ROOT, 'app', 'build', 'outputs', 'apk', 'androidTest', 'debug'); | ||
LOG.info(`The built server apk, app-debug-androidTest.apk, is in ${dstPath}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the dstPath values should already contain app-debug-androidTest.apk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've changed. Still I like to open the directory to open the link via cmd+click in a terminal, but no strong opinion for this.
scripts/build-espresso.js
Outdated
|
||
if (process.env.ESPRESSO_BUILD_CONFIG) { | ||
if (!(await fs.exists(process.env.ESPRESSO_BUILD_CONFIG))) { | ||
throw Error(`'${process.env.ESPRESSO_BUILD_CONFIG}' did not exist. Please set the path as an absolute path.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new Error
, same below
scripts/build-espresso.js
Outdated
opts.buildConfiguration = JSON.parse(buildConfigurationStr); | ||
LOG.info(`The espresso build config is ${JSON.stringify(opts.buildConfiguration)}`); | ||
} catch (e) { | ||
throw Error(`Failed to parse the ${process.env.ESPRESSO_BUILD_CONFIG}. Please make sure that the JSON is valid format. Error: ${e}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these lines are too long. Please split them. Same below
scripts/build-espresso.js
Outdated
|
||
const dstPath = path.resolve(ESPRESSO_SERVER_ROOT, 'app', 'build', 'outputs', 'apk', 'androidTest', 'debug', 'app-debug-androidTest.apk'); | ||
if (await fs.exists(dstPath)) { | ||
LOG.info(`The built server apk is ${dstPath}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather say: Full path to the server APK: ...
scripts/build-espresso.js
Outdated
if (await fs.exists(dstPath)) { | ||
LOG.info(`The built server apk is ${dstPath}`); | ||
} else { | ||
LOG.info(`The built server androidTest.apk might be in ${ESPRESSO_SERVER_BUILD}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full path to the server build folder: ...
README.md
Outdated
@@ -42,7 +42,12 @@ On top of standard Appium requirements Espresso driver also expects the followin | |||
|
|||
## Scripts | |||
|
|||
- `appium driver run print-espresso-path` prints the path to the Appium Espresso server root. You can modify the gradle file directly if [Espresso Build Config](#espresso-build-config) was not sufficient. | |||
- `appium driver run espresso print-espresso-path` prints the path to the Appium Espresso server root. You can modify the gradle file directly if [Espresso Build Config](#espresso-build-config) was not sufficient. | |||
- `appium driver run espresso build-espresso` builds the espresso server since driver version 2.18.0. It helps building the espresso server outside Appium process. Available environment variables are below: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outside of the Appium process
## [2.18.0](v2.17.0...v2.18.0) (2023-03-22) ### Features * add building espresso server command via appium command ([#858](#858)) ([cfaad9a](cfaad9a))
This is still wip. I'd like to extract the building espresso server via npm command over appium command, eventually.
https://github.com/appium/appium-espresso-driver#espresso-build-config
This does not change the gradle file itself, but it allows users to build the server with some parameters #851