Skip to content

Commit d6aadf6

Browse files
authored
Merge pull request #1 from openwebf/feat/flutter-3
2 parents d573d29 + 7418fe3 commit d6aadf6

File tree

517 files changed

+8412
-8741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

517 files changed

+8412
-8741
lines changed

.github/workflows/code_linter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
inplace: True
4747
- uses: EndBug/add-and-commit@v4
4848
with:
49-
author_name: openkraken-bot
50-
author_email: [email protected].com
49+
author_name: openwebf-bot
50+
author_email: openwebf@openwebf.com
5151
message: 'Committing clang-format changes'
5252
env:
5353
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/example_build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
env:
1111
nodeVersion: "16"
1212
cmakeVersion: "3.22.x"
13-
flutterVersion: "2.8.1"
13+
flutterVersion: "3.0.4"
1414

1515
jobs:
1616
build_android-app_in_macos:
@@ -35,7 +35,7 @@ jobs:
3535

3636
- name: android app build
3737
run: |
38-
cd kraken/
38+
cd webf/
3939
flutter pub get
4040
cd example/
4141
flutter build apk --release
@@ -60,7 +60,7 @@ jobs:
6060

6161
- name: ios app build
6262
run: |
63-
cd kraken/
63+
cd webf/
6464
flutter pub get
6565
cd example/
6666
flutter build ios --release --no-codesign
@@ -86,7 +86,7 @@ jobs:
8686

8787
- name: macos app build
8888
run: |
89-
cd kraken/
89+
cd webf/
9090
flutter pub get
9191
cd example/
9292
flutter build macos --release
@@ -115,7 +115,7 @@ jobs:
115115
- run: flutter doctor -v
116116
- name: linux app build
117117
run: |
118-
cd kraken/
118+
cd webf/
119119
flutter pub get
120120
cd example/
121121
flutter build linux --release

.github/workflows/integration_test_flutter.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on: [workflow_dispatch, pull_request]
55
env:
66
nodeVersion: "16"
77
cmakeVersion: "3.22.x"
8-
flutterVersion: "2.8.1"
8+
flutterVersion: "3.0.4"
99

1010
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1111
jobs:
1212
setup:
13-
runs-on: macos-latest
13+
runs-on: macos-12
1414
outputs:
1515
matrix: ${{ steps.matrix.outputs.value }}
1616
steps:
@@ -20,7 +20,7 @@ jobs:
2020
JSON=$(node -e "console.log(JSON.stringify(require('./integration_tests/spec_group.json').map(j=>j.name)))")
2121
echo "::set-output name=value::$(echo $JSON)"
2222
build_bridge:
23-
runs-on: macos-latest
23+
runs-on: macos-12
2424
steps:
2525
- uses: actions/checkout@v2
2626
- uses: actions/setup-node@v2
@@ -35,8 +35,34 @@ jobs:
3535
with:
3636
name: macos_bridge_binary
3737
path: bridge/build/macos/
38+
39+
bridge_unit_test:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v2
43+
- uses: actions/setup-node@v2
44+
with:
45+
node-version: ${{ env.nodeVersion }}
46+
- uses: jwlawson/[email protected]
47+
with:
48+
cmake-version: ${{ env.cmakeVersion }}
49+
- run: npm i
50+
- run: ENABLE_ASAN=true npm run build:bridge:linux
51+
- run: node scripts/run_bridge_unit_test.js
52+
53+
webf_unit_test:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v2
57+
- uses: subosito/flutter-action@v2
58+
with:
59+
flutter-version: ${{ env.flutterVersion }}
60+
- run: flutter config --enable-macos-desktop
61+
- run: flutter doctor -v
62+
- run: cd webf && flutter test
63+
3864
integration_test:
39-
runs-on: macos-latest
65+
runs-on: macos-12
4066
needs: [ setup, build_bridge ]
4167
strategy:
4268
fail-fast: false
@@ -69,7 +95,7 @@ jobs:
6995
if: steps.test.outcome != 'success'
7096
run: exit 1
7197
plugin_test:
72-
runs-on: macos-latest
98+
runs-on: macos-12
7399
needs: [ build_bridge ]
74100
steps:
75101
- uses: actions/checkout@v2

.github/workflows/publish_to_dart_dev.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Kraken To pub.dev
1+
name: Publish WebF To pub.dev
22

33
on:
44
release:
@@ -66,7 +66,7 @@ jobs:
6666
name: ios_binary
6767
path: bridge/build/ios/
6868
build_android_binary:
69-
runs-on: ubuntu-latest
69+
runs-on: macos-latest
7070
steps:
7171
- uses: actions/checkout@v2
7272
- uses: actions/setup-node@v2
@@ -99,8 +99,6 @@ jobs:
9999
flutter-version: ${{ env.flutterVersion }}
100100
- name: NPM INSTALL
101101
run: npm install
102-
- name: Set up nightly version
103-
run: node scripts/set_up_nightly_release.js
104102
- uses: actions/download-artifact@v2
105103
with:
106104
name: linux_binary
@@ -118,13 +116,13 @@ jobs:
118116
name: android_binary
119117
path: bridge/build/android/
120118
- name: Prepare distribute binaries
121-
run: node scripts/pre_publish_kraken.js
119+
run: node scripts/pre_publish_webf.js
122120
- name: Publish
123121
uses: k-paxian/dart-package-publisher@master
124122
with:
125123
credentialJson: ${{ secrets.CREDENTIAL_JSON }}
126124
force: true
127125
flutter: true
128126
skipTests: true
129-
relativePath: ./kraken
127+
relativePath: ./webf
130128

.github/workflows/publish_to_dart_dev_nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Kraken To pub.dev Nightly
1+
name: Publish WebF To pub.dev Nightly
22

33
on:
44
schedule:

.github/workflows/sync_to_release.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

bridge/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ execute_process(
4949
)
5050
string(REGEX REPLACE "\n$" "" DART_SDK "${DART_SDK}")
5151

52-
list(APPEND KRAKEN_PUBLIC_HEADERS
53-
${CMAKE_CURRENT_SOURCE_DIR}/include/kraken_bridge.h
52+
list(APPEND WEBF_PUBLIC_HEADERS
53+
${CMAKE_CURRENT_SOURCE_DIR}/include/webf_bridge.h
5454
)
5555

5656
set(QUICKJS_PUBLIC_HEADERS
@@ -81,9 +81,9 @@ if (DEFINED PLATFORM)
8181
endif()
8282

8383
list(APPEND BRIDGE_SOURCE
84-
kraken_bridge.cc
85-
${CMAKE_CURRENT_SOURCE_DIR}/include/kraken_bridge.h
86-
${CMAKE_CURRENT_SOURCE_DIR}/include/kraken_foundation.h
84+
webf_bridge.cc
85+
${CMAKE_CURRENT_SOURCE_DIR}/include/webf_bridge.h
86+
${CMAKE_CURRENT_SOURCE_DIR}/include/webf_foundation.h
8787
${CMAKE_CURRENT_SOURCE_DIR}/include/dart_methods.h
8888
foundation/logging.cc
8989
foundation/logging.h
@@ -152,7 +152,7 @@ list(APPEND BRIDGE_INCLUDE
152152
set(BINDING_DIR ${CMAKE_CURRENT_LIST_DIR}/bindings)
153153

154154
if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
155-
add_compile_options(-DKRAKEN_QUICK_JS_ENGINE=1)
155+
add_compile_options(-DWEBF_QUICK_JS_ENGINE=1)
156156

157157
execute_process(
158158
COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/third_party/quickjs/VERSION
@@ -296,7 +296,7 @@ if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
296296
endif ()
297297

298298
list(APPEND PUBLIC_HEADER
299-
include/kraken_bridge.h
299+
include/webf_bridge.h
300300
)
301301

302302
add_library(webf SHARED ${BRIDGE_SOURCE})
@@ -335,7 +335,7 @@ if ($ENV{WEBF_JS_ENGINE} MATCHES "quickjs")
335335
endif ()
336336
endif ()
337337

338-
### KrakenStatic
338+
### webfStatic
339339
target_include_directories(webf_static PRIVATE
340340
${BRIDGE_INCLUDE}
341341
${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ./include)
@@ -389,7 +389,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "iOS")
389389
MACOSX_FRAMEWORK_IDENTIFIER com.openwebf.webf-bridge
390390
MACOSX_FRAMEWORK_BUNDLE_VERSION 1.0
391391
MACOSX_FRAMEWORK_SHORT_VERSION_STRING 1.0
392-
PUBLIC_HEADER ${KRAKEN_PUBLIC_HEADERS}
392+
PUBLIC_HEADER ${WEBF_PUBLIC_HEADERS}
393393
)
394394

395395
# If quickjs is static, there will be no quickjs.framework any more.

bridge/bindings/qjs/bom/blob.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/*
2-
* Copyright (C) 2021-present The Kraken authors. All rights reserved.
2+
* Copyright (C) 2019-2022 The Kraken authors. All rights reserved.
3+
* Copyright (C) 2022-present The WebF authors. All rights reserved.
34
*/
45

56
#include "blob.h"
67
#include "dart_methods.h"
78

8-
namespace kraken::binding::qjs {
9+
namespace webf::binding::qjs {
910

1011
std::once_flag kBlobInitOnceFlag;
1112

@@ -277,4 +278,4 @@ int32_t BlobInstance::size() {
277278
uint8_t* BlobInstance::bytes() {
278279
return _data.data();
279280
}
280-
} // namespace kraken::binding::qjs
281+
} // namespace webf::binding::qjs

bridge/bindings/qjs/bom/blob.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/*
2-
* Copyright (C) 2021-present The Kraken authors. All rights reserved.
2+
* Copyright (C) 2019-2022 The Kraken authors. All rights reserved.
3+
* Copyright (C) 2022-present The WebF authors. All rights reserved.
34
*/
45

5-
#ifndef KRAKENBRIDGE_BLOB_H
6-
#define KRAKENBRIDGE_BLOB_H
6+
#ifndef BRIDGE_BLOB_H
7+
#define BRIDGE_BLOB_H
78

89
#include "bindings/qjs/host_class.h"
910

10-
namespace kraken::binding::qjs {
11+
namespace webf::binding::qjs {
1112

1213
class BlobBuilder;
1314
class BlobInstance;
@@ -73,6 +74,6 @@ class BlobBuilder {
7374
std::vector<uint8_t> _data;
7475
};
7576

76-
} // namespace kraken::binding::qjs
77+
} // namespace webf::binding::qjs
7778

78-
#endif // KRAKENBRIDGE_BLOB_H
79+
#endif // BRIDGE_BLOB_H

bridge/bindings/qjs/bom/console.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/*
2-
* Copyright (C) 2021-present The Kraken authors. All rights reserved.
2+
* Copyright (C) 2019-2022 The Kraken authors. All rights reserved.
3+
* Copyright (C) 2022-present The WebF authors. All rights reserved.
34
*/
45

56
#include "console.h"
67
#include "foundation/logging.h"
78

8-
namespace kraken::binding::qjs {
9+
namespace webf::binding::qjs {
910

1011
JSValue print(JSContext* ctx, JSValueConst this_val, int argc, JSValueConst* argv) {
1112
std::stringstream stream;
@@ -31,7 +32,7 @@ JSValue print(JSContext* ctx, JSValueConst this_val, int argc, JSValueConst* arg
3132
}
3233

3334
void bindConsole(ExecutionContext* context) {
34-
QJS_GLOBAL_BINDING_FUNCTION(context, print, "__kraken_print__", 2);
35+
QJS_GLOBAL_BINDING_FUNCTION(context, print, "__webf_print__", 2);
3536
}
3637

37-
} // namespace kraken::binding::qjs
38+
} // namespace webf::binding::qjs

0 commit comments

Comments
 (0)