未验证 提交 2d76b575 编写于 作者: O openharmony_ci 提交者: Gitee

!764 自动生成mock在gn中隔离,仅编译预览器引擎时编译

Merge pull request !764 from fupengfei/master
......@@ -35,6 +35,10 @@ action("gen_snapshot") {
js_framework = "//third_party/jsframework/runtime"
js_framework_mock_generate = "//third_party/jsframework/mock-generate"
is_mac = "false"
is_preview_engine = "false"
if (use_mingw_win || use_mac || use_linux) {
is_preview_engine = "true"
}
use_mac = host_os == "mac"
if (is_standard_system || is_cross_platform_build) {
......@@ -85,6 +89,7 @@ action("gen_snapshot") {
rebase_path(buildfile_native_min, root_build_dir),
rebase_path(css_what, root_build_dir),
rebase_path(js_framework_mock_generate, root_build_dir),
is_preview_engine,
]
inputs = [
......
......@@ -21,10 +21,14 @@ prebuilts_path=${12}
# copy runtime to target out, and runtime/css-what is solt link, copy it always follow symbolic links in SOURCE
if [ "${11}" == 'true' ];then
cp -R -L $3 $9
cp -R ${15} $9
if [ "${16}" == 'true' ];then
cp -R ${15} $9
fi
else
cp -r -L $3 $9
cp -r ${15} $9
if [ "${16}" == 'true' ];then
cp -r ${15} $9
fi
fi
# $2 => node $4 => node_modules
......@@ -57,14 +61,18 @@ if [ -d "$prebuilts_path" ]; then
cp -r $2 $9
cd $9
if [ "${11}" == 'true' ];then
./node-v12.18.4-darwin-x64/bin/node ./mock-generate/build.js
if [ "${16}" == 'true' ];then
./node-v12.18.4-darwin-x64/bin/node ./mock-generate/build.js
fi
./node-v12.18.4-darwin-x64/bin/node build_jsmock_system_plugin.js || exit 1 &
./node-v12.18.4-darwin-x64/bin/node build_strip_native_min.js || exit 1 &
# run unit test
./node-v12.18.4-darwin-x64/bin/node node_modules/.bin/mocha -r ts-node/register test/lib.ts test/ut/**/*.ts test/ut/*.ts || exit 1 &
wait
else
./node-v12.18.4-linux-x64/bin/node ./mock-generate/build.js
if [ "${16}" == 'true' ];then
./node-v12.18.4-linux-x64/bin/node ./mock-generate/build.js
fi
./node-v12.18.4-linux-x64/bin/node build_jsmock_system_plugin.js || exit 1 &
./node-v12.18.4-linux-x64/bin/node build_strip_native_min.js || exit 1 &
# run unit test
......@@ -92,4 +100,6 @@ rm -rf ./test
rm -rf ./.eslintrc
rm -rf ./.babelrc
rm -rf ./package.json
rm -rf ./mock-generate
if [ "${16}" == 'true' ];then
rm -rf ./mock-generate
fi
......@@ -58,8 +58,8 @@ import { mockBatteryStatistics } from './ohos_batteryStatistics'
import { mockIntl } from './ohos_intl'
import { mockI18N } from './ohos_i18n'
import { mockRpc } from './ohos_rpc'
import { mockwebgl } from './webgl'
import { mockwebgl2 } from './webgl2'
import { mockWebgl } from './webgl/webgl'
import { mockWebgl2 } from './webgl/webgl2'
import { mockProcess } from './ohos_process'
import { mockUrl } from './ohos_url'
import { mockHiAppEvent } from './ohos_hiAppEvent'
......@@ -387,9 +387,9 @@ export function mockRequireNapiFun() {
case "rpc":
return mockRpc();
case "webgl":
return mockwebgl();
return mockWebgl();
case "webgl2":
return mockwebgl2();
return mockWebgl2();
case "process":
return mockProcess();
case "url":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册