Skip to content

Commit

Permalink
test(example): use cross-platform path style, add android run script (r…
Browse files Browse the repository at this point in the history
…eact-native-netinfo#522)

* test(example): use cross-platform path style

without this the example won't run non-windows platforms

* build(android): add run script to run android example for testing
  • Loading branch information
mikehardy authored Nov 17, 2021
1 parent dc05514 commit 3dc7dae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"license": "MIT",
"scripts": {
"start": "react-native start",
"start:android": "cd example && yarn react-native run-android",
"start:ios": "cd example && yarn react-native run-ios --project-path `pwd`/ios",
"start:macos": "node node_modules/react-native-macos/local-cli/cli.js start --use-react-native-macos",
"start:web": "webpack-dev-server --config example/webpack.config.js",
Expand Down
6 changes: 4 additions & 2 deletions react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* and conversely metro.config.macos.js has to blacklist 'node_modules/react-native'.
*/
'use strict';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');

const macSwitch = '--use-react-native-macos';
const windowsSwitch = '--use-react-native-windows';
Expand All @@ -27,10 +29,10 @@ let config = {
sourceDir: 'example/android',
},
windows:{
sourceDir: 'example\\windows',
sourceDir: path.join('example', 'windows'),
solutionFile: 'NetInfoExample.sln',
project: {
projectFile: 'NetInfoExample\\NetInfoExample.vcxproj',
projectFile: path.join('NetInfoExample', 'NetInfoExample.vcxproj'),
},
},
},
Expand Down

0 comments on commit 3dc7dae

Please sign in to comment.