-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update package scripts to use node for cross-plattform. * Fix detox test / run-server using paths that don't work on windows. * Replace CRLFs in exec.js, fixes running the emulator on windows. * Should fix build.js on mac. * Remove some paranoia. * Make eslint pass on JS scripts. * Ignore exec hack in coverage to get CI passing. * Walk back detox test change so it works with detox-cli. * Don't try to start emulator if it's already running. * Remove unneeded comments, only refresh ADB devices if needed. * Update detox unit tests to pass on windows. Use path module in tests to normalize paths. Use process.platform to test with actual absolute paths on windows. * Add windows support to detox-cli. * Some basic documentation in roadmap. * docs: 'detox' -> 'Detox' * More docs fixes. * Oops, missed building Detox-ios-src.tbz * Lint complained about hashbangs in detox scripts.
- Loading branch information
1 parent
74736d6
commit cde5fd3
Showing
16 changed files
with
132 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env node | ||
const cp = require('child_process'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
const detoxPath = path.join(process.cwd(), 'node_modules/detox'); | ||
const detoxPackageJsonPath = path.join(detoxPath, 'package.json'); | ||
|
||
if (fs.existsSync(detoxPackageJsonPath)) { | ||
// { shell: true } option seems to break quoting on windows? Otherwise this would be much simpler. | ||
if (process.platform === 'win32') { | ||
const result = cp.spawnSync( | ||
'cmd', | ||
['/c', path.join(process.cwd(), 'node_modules/.bin/detox.cmd')].concat(process.argv.slice(2)), | ||
{ stdio: 'inherit' }); | ||
process.exit(result.status); | ||
} else { | ||
const result = cp.spawnSync( | ||
path.join(process.cwd(), 'node_modules/.bin/detox'), | ||
process.argv.slice(2), | ||
{ stdio: 'inherit' }); | ||
process.exit(result.status); | ||
} | ||
} else { | ||
console.log(detoxPackageJsonPath); | ||
console.log("detox is not installed in this directory"); | ||
process.exit(1); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
"test": ":" | ||
}, | ||
"bin": { | ||
"detox": "./cli.sh" | ||
"detox": "./cli.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const childProcess = require('child_process'); | ||
const fs = require('fs-extra'); | ||
|
||
// Just make the usage a little prettier | ||
function sh(cmdline, opts) { | ||
const args = cmdline.split(' '); | ||
const cmd = args.shift(); | ||
return childProcess.execFileSync(cmd, args, opts); | ||
} | ||
|
||
if (process.platform === 'darwin') { | ||
console.log("\nPackaging Detox iOS sources"); | ||
|
||
fs.removeSync('Detox-ios-src.tbz'); | ||
// Prepare Earl Grey without building | ||
sh("ios/EarlGrey/Scripts/setup-earlgrey.sh"); | ||
sh("find ./ios -name Build -type d -exec rm -rf {} ;"); | ||
|
||
sh("tar -cjf ../Detox-ios-src.tbz .", { cwd: "ios" }); | ||
} | ||
|
||
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); | ||
}); | ||
|
||
sh("./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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if (process.platform === "darwin") { | ||
require("child_process").execSync(`${__dirname}/build_framework.ios.sh`, { | ||
stdio: "inherit" | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters