-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Running on windows support #628
Changes from 9 commits
989e45e
b950f2a
5982396
4430484
9093c2d
a6169b2
a50ebe7
3288a98
2aace19
b0374e8
d809041
80d20cb
3ff87ab
0b6912c
8e4a325
9e9fa8a
dcc7bc5
86e7f7f
7f03f0b
610c947
140ad0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env node | ||
|
||
// Javascript for windows support. | ||
|
||
if (process.argv[2] === "android" || process.argv[3] === "android") { | ||
console.log("\nBuilding Detox aars"); | ||
const aars = [ | ||
"detox-minReactNative44-debug.aar", | ||
"detox-minReactNative46-debug.aar", | ||
"detox-minReactNative44-release.aar", | ||
"detox-minReactNative46-release.aar" | ||
]; | ||
aars.forEach(aar => { | ||
fs.removeSync(aar); | ||
}); | ||
|
||
childProcess.execFileSync( | ||
"android/gradlew", | ||
["assembleDebug", "assembleRelease"], | ||
{ | ||
cwd: "android", | ||
stdio: "inherit", | ||
shell: true | ||
} | ||
); | ||
|
||
aars.forEach(aar => { | ||
fs.copySync(`android/detox/build/outputs/aar/${aar}`, aar); | ||
}); | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env node | ||
|
||
// Javascript for windows support. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More clearly |
||
if (process.platform === "darwin") { | ||
require("child_process").execSync(`${__dirname}/build_framework.ios.sh`, { | ||
stdio: "inherit" | ||
}); | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,10 +52,17 @@ class EmulatorDriver extends AndroidDriver { | |
} | ||
|
||
await this._fixEmulatorConfigIniSkinName(name); | ||
await this.emulator.boot(name); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was the issue here ? boot should return a valid device, either it's shutdown or already booted. If it doesn't we may have issue with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I now see the comments here. Not sure how to proceed here. This fix is in bad taste IMO. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could experiment a bit, I suspect redirecting to different files should fix it, but this was a less user visible change (eg. .gitignore) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, gave it a try and it still hangs on startup with no output to the log file even if it's a new file each time. |
||
|
||
const adbDevices = await this.adb.devices(); | ||
const filteredDevices = _.filter(adbDevices, {type: 'emulator', name: name}); | ||
let adbDevices = await this.adb.devices(); | ||
let filteredDevices = _.filter(adbDevices, {type: 'emulator', name: name}); | ||
|
||
// If it's not already running, start it now. | ||
if (!filteredDevices.length) { | ||
await this.emulator.boot(name); | ||
} | ||
|
||
adbDevices = await this.adb.devices(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this being run twice ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, should be inside the |
||
filteredDevices = _.filter(adbDevices, {type: 'emulator', name: name}); | ||
|
||
let adbName; | ||
switch (filteredDevices.length) { | ||
|
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.
npm and yarn install detox-server at different locations.
it might be either it
node_modules
or innode_modules/detox/node_modules
I am not familiar with
require.resolve('detox-server/package.json');
trick. Will it cover both cases ?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.
Yep, it's the standard hack to find the location of an NPM package the same way node does, since every NPM package has a
package.json
. Remember:require / require.resolve('foo/bar')
looks upfoo
in node_modules, then addsbar
to that path.../bar
it would use themain
field, which is likely to be in a nested subdirpackage.json
always exists.