-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
80 additions
and
57 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 |
---|---|---|
@@ -1,78 +1,101 @@ | ||
# OpenWebf Contributing Guide | ||
|
||
0. Prerequisites | ||
* [Node.js](https://nodejs.org/) v12.0 or later | ||
* [Flutter](https://flutter.dev/docs/get-started/install) version in the `webf/pubspec.yaml` | ||
* [CMake](https://cmake.org/) v3.10.0 or later | ||
* [Xcode](https://developer.apple.com/xcode/) (10.12) or later (Running on macOS or iOS) | ||
* [Android NDK](https://developer.android.com/studio/projects/install-ndk) version `22.1.7171670` (Running on Android)] | ||
* [Visual Studio 2019 or above](https://visualstudio.microsoft.com/) (Running on Windows) | ||
## Prerequisites | ||
|
||
Get the code: | ||
``` | ||
git clone [email protected]:openwebf/webf.git | ||
git submodule update --init --recursive | ||
``` | ||
* [Node.js](https://nodejs.org/) v12.0 or later | ||
* [Flutter](https://flutter.dev/docs/get-started/install) version in the `webf/pubspec.yaml` | ||
* [CMake](https://cmake.org/) v3.10.0 or later | ||
* [Xcode](https://developer.apple.com/xcode/) (10.12) or later (Running on macOS or iOS) | ||
* [Android NDK](https://developer.android.com/studio/projects/install-ndk) version `22.1.7171670` (Running on Android)] | ||
* [Visual Studio 2019 or above](https://visualstudio.microsoft.com/) (Running on Windows) | ||
|
||
1. Install | ||
## Get the code: | ||
|
||
```shell | ||
$ npm install | ||
``` | ||
``` | ||
git clone [email protected]:openwebf/webf.git | ||
git submodule update --init --recursive | ||
``` | ||
|
||
2. Building bridge | ||
## Install | ||
|
||
Building bridge for all supported platform (macOS, linux, iOS, Android) | ||
|
||
> Debug is the default build type, if you want to have a release build, please add `:release` after your command. | ||
> | ||
> Exp: Execute `npm run build:bridge:macos:release` to build a release bridge for the macOS platform. | ||
```shell | ||
$ npm install | ||
``` | ||
|
||
```shell | ||
$ npm run build:bridge:all:release | ||
``` | ||
## Building bridge | ||
|
||
Building bridge for one platform | ||
|
||
|
||
**Windows** | ||
> Debug is the default build type, if you want to have a release build, please add `:release` after your command. | ||
> | ||
> Exp: Execute `npm run build:bridge:macos:release` to build a release bridge for the macOS platform. | ||
```shell | ||
$ npm run build:bridge:windows:release | ||
``` | ||
**Windows** | ||
|
||
**macOS** | ||
```shell | ||
$ npm run build:bridge:windows:release | ||
``` | ||
|
||
```shell | ||
$ npm run build:bridge:macos:release | ||
``` | ||
**macOS** | ||
|
||
**linux** | ||
```shell | ||
$ npm run build:bridge:macos:release | ||
``` | ||
|
||
```shell | ||
$ npm run build:bridge:linux:release | ||
``` | ||
**linux** | ||
|
||
**iOS** | ||
```shell | ||
$ npm run build:bridge:linux:release | ||
``` | ||
|
||
```shell | ||
$ npm run build:bridge:ios:release | ||
``` | ||
**iOS** | ||
|
||
**Android** | ||
```shell | ||
$ npm run build:bridge:ios:release | ||
``` | ||
|
||
```shell | ||
$ npm run build:bridge:android:release | ||
``` | ||
**Android** | ||
|
||
3. Start example | ||
```shell | ||
$ cd webf/example | ||
$ flutter run | ||
``` | ||
```shell | ||
$ npm run build:bridge:android:release | ||
``` | ||
|
||
4. Test (Unit Test and Integration Test) | ||
```shell | ||
$ npm test | ||
``` | ||
### Run Example | ||
|
||
```shell | ||
$ cd webf/example | ||
$ flutter run -d <platform> | ||
``` | ||
|
||
## Run integration Test | ||
|
||
```shell | ||
cd integration_tests | ||
npm run integration | ||
``` | ||
|
||
### Run specific group of test specs in integration test | ||
|
||
To run specify groups of test specs: | ||
|
||
```shell | ||
SPEC_SCOPE=DOM npm run integration // match pattern is located in `spec_group.json` | ||
``` | ||
|
||
### Run integration test without build test apps | ||
|
||
> Quicker start up if you changed the test specs only. | ||
```shell | ||
npm run integration -- --skip-build | ||
``` | ||
|
||
### Run one test spec only | ||
|
||
Change the `it` into `fit` to running this test spec only. | ||
|
||
```typescript | ||
fit('document.all', () => { | ||
expect(document.all).not.toBeUndefined(); | ||
expect(document.all.length).toBeGreaterThan(0); | ||
}); | ||
``` | ||
|