Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Change to decoupled binary config format #268

Closed
wants to merge 4 commits into from

Conversation

DanielMSchmidt
Copy link
Contributor

This allows us to have a less verbose config, tackling the first part of #175.
This will introduce a breaking change (appName field), we might want to add a warning first instead of an error.

@DanielMSchmidt DanielMSchmidt force-pushed the config/decouple-build-path-from-config branch from 49b7f3b to dec4d03 Compare September 8, 2017 15:23
@rotemmiz
Copy link
Member

rotemmiz commented Sep 8, 2017

This diff is huge, all the reformatting make it very hard to actually go over the code.
I don't mind the reformatting, but let's do it in a different PR (or at least different commit).

Couldn't conclude if there are any breaking changes, but if there are, let's introduce them all together and not bit by bit.

@DanielMSchmidt
Copy link
Contributor Author

DanielMSchmidt commented Sep 8, 2017 via email

@DanielMSchmidt DanielMSchmidt force-pushed the config/decouple-build-path-from-config branch 3 times, most recently from 799e00a to c0812ff Compare September 8, 2017 18:08
@DanielMSchmidt
Copy link
Contributor Author

I just added a second commit which infers the appName if it's not set. This leads to

  • a step into the direction of zero configuration
  • hopefully no breaking change (if these functions work fine)

I will think about another way to refer to these fallbacks as late as possible so that we don't break detox for anyone, haven't got a clear idea yet.

@DanielMSchmidt DanielMSchmidt force-pushed the config/decouple-build-path-from-config branch 4 times, most recently from bc9b285 to 799d7da Compare September 10, 2017 12:55
@DanielMSchmidt
Copy link
Contributor Author

@rotemmiz This is a more final version, it should not break the usage for anyone, still lets not merge it yet. Still thinking about a clean way to support the current version without relying on the automatic finding of the app name to work

This allows us to have a less verbose config,
tackling the first part of #175.

This will introduce a breaking change, we might want to add a warning
first instead of an error.
To reduce configuration for our users we can now find out how their app is named
This is useful because it helps us not to break anything for current users with hard coded binary fields
@DanielMSchmidt DanielMSchmidt force-pushed the config/decouple-build-path-from-config branch from 08ffb16 to 52eb2d5 Compare September 14, 2017 14:38
}

const binaryPaths = this.userConfig.binary || {};
const defaultBinaryPathOverwrite = binaryPaths[deviceDriver.getPlatform()];
Copy link
Member

Choose a reason for hiding this comment

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

Instead, why not use deviceDriver.getBinaryPath() ?


const androidFileContent = `
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myAndroidApp"
Copy link
Member

Choose a reason for hiding this comment

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

This is not necessarily the final package name of the app. The source of truth is in the app/build.gradle.

const deviceDriver = new deviceClass(this.client);
this.device = new Device(deviceConfig, sessionConfig, deviceDriver);
const binaryPath = await this._getBinaryPath(deviceConfig, deviceDriver);
Copy link
Member

Choose a reason for hiding this comment

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

BinaryPath should be contained inside deviceDriver IMO

await this.device.prepare(params);
global.device = this.device;
}

async _getAppName(deviceDriver) {
Copy link
Member

Choose a reason for hiding this comment

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

I have a feeling that trying to extract the appName from project files will get us in lots of trouble. There are endless possibilities for configuring projects (especially if there are multiple targets on iOS or multiple buildFlavors on Android, and build.gradle might be in custom directories (not necessarily in /app/

@LeoNatan LeoNatan deleted the config/decouple-build-path-from-config branch March 12, 2018 20:04
@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants