fix build for ark engine

Signed-off-by: sunfei <sunfei.sun@huawei.com>
Change-Id: I29b58a0a40d2a9909677fa887e7b81bb7ee31ff7
This commit is contained in:
sunfei 2021-09-30 17:18:27 +08:00
parent d97f587f46
commit 51a343f24b
11 changed files with 45 additions and 10 deletions

View File

@ -42,7 +42,8 @@ ace_flutter_engine_root = "$ace_root/build/third_party/flutter"
flutter_root = "//third_party/flutter"
v8_root = "//third_party/v8"
ark_tools_root = "//prebuilts/ace-toolkit/ace-loader/panda"
node_js_path = "//prebuilts/ace-toolkit/nodejs/node-v12.18.4-linux-x64/bin/"
node_js_path =
"//prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin/"
# Config toolchain
windows_buildtool = "//build/toolchain/mingw:mingw_x86_64"

View File

@ -26,12 +26,16 @@ group("ace_packages") {
# Engine and debugger
deps += [
"$ace_root/build:libace_engine_ark",
"$ace_root/build:libace_engine_qjs",
"$ace_root/build:libace_engine_qjs_debug",
]
# Declarative engine
deps += [ "$ace_root/build:libace_engine_declarative" ]
deps += [
"$ace_root/build:libace_engine_declarative",
"$ace_root/build:libace_engine_declarative_ark",
]
# Pa engine
deps += [ "$ace_root/build:libace_engine_pa_qjs" ]

View File

@ -48,6 +48,10 @@ if (disable_gpu) {
defines += [ "GPU_DISABLED" ]
}
if (form_components_support) {
defines += [ "FORM_SUPPORTED" ]
}
cflags_cc = [
"-Wno-thread-safety-attributes",
"-Wno-thread-safety-analysis",

View File

@ -46,9 +46,19 @@ namespace OHOS::Ace::Platform {
namespace {
constexpr char QUICK_JS_ENGINE_SHARED_LIB[] = "libace_engine_qjs.z.so";
constexpr char ARK_ENGINE_SHARED_LIB[] = "libace_engine_ark.z.so";
constexpr char DECLARATIVE_JS_ENGINE_SHARED_LIB[] = "libace_engine_declarative.z.so";
constexpr char DECLARATIVE_ARK_ENGINE_SHARED_LIB[] = "libace_engine_declarative_ark.z.so";
const char* GetEngineSharedLibrary(bool isArkApp)
{
if (isArkApp) {
return ARK_ENGINE_SHARED_LIB;
} else {
return QUICK_JS_ENGINE_SHARED_LIB;
}
}
const char* GetDeclarativeSharedLibrary(bool isArkApp)
{
if (isArkApp) {
@ -106,7 +116,7 @@ void AceContainer::InitializeFrontend()
if (type_ == FrontendType::JS) {
frontend_ = Frontend::Create();
auto jsFrontend = AceType::DynamicCast<JsFrontend>(frontend_);
auto& loader = Framework::JsEngineLoader::Get(QUICK_JS_ENGINE_SHARED_LIB);
auto& loader = Framework::JsEngineLoader::Get(GetEngineSharedLibrary(isArkApp_));
auto jsEngine = loader.CreateJsEngine(instanceId_);
jsEngine->AddExtraNativeObject("ability", aceAbility_);
jsFrontend->SetJsEngine(jsEngine);

View File

@ -107,4 +107,14 @@ void AccessibilityNodeManager::SetCardViewParams(const std::string& key, bool fo
void AccessibilityNodeManager::SetCardViewPosition(int id, float offsetX, float offsetY) {}
std::unique_ptr<JsonValue> AccessibilityNodeManager::DumpComposedElementsToJson() const
{
return nullptr;
}
std::unique_ptr<JsonValue> AccessibilityNodeManager::DumpComposedElementToJson(NodeId nodeId)
{
return nullptr;
}
} // namespace OHOS::Ace::Framework

View File

@ -102,9 +102,10 @@ template("declarative_js_engine_ark") {
configs = [
"$ace_root:ace_config",
"$ark_runtime_path/libpandabase:arkbase_public_config",
"//ark/js_runtime:ark_jsruntime_public_config",
]
public_configs = [ "//ark/js_runtime:ark_jsruntime_public_config" ]
sources = [
"ark/ark_js_runtime.cpp",
"ark/ark_js_value.cpp",

View File

@ -142,7 +142,7 @@ void JsiClass<C>::Bind(BindingTarget t, FunctionCallback ctor)
auto runtime = std::static_pointer_cast<ArkJSRuntime>(JsiDeclarativeEngineInstance::GetJsRuntime());
auto vm = runtime->GetEcmaVm();
classFunction_ = panda::Global<panda::FunctionRef>(
vm, panda::FunctionRef::NewClassFunction(vm, ConstructorInterceptor, nullptr));
vm, panda::FunctionRef::NewClassFunction(vm, ConstructorInterceptor, nullptr, nullptr));
classFunction_->SetName(vm, StringRef::NewFromUtf8(vm, className_.c_str()));
auto prototype = Local<ObjectRef>(classFunction_->GetFunctionPrototype(vm));
for (const auto& [name, val] : staticFunctions_) {
@ -164,7 +164,7 @@ void JsiClass<C>::Bind(
auto runtime = std::static_pointer_cast<ArkJSRuntime>(JsiDeclarativeEngineInstance::GetJsRuntime());
auto vm = runtime->GetEcmaVm();
classFunction_ = panda::Global<panda::FunctionRef>(
vm, panda::FunctionRef::NewClassFunction(vm, JSConstructorInterceptor, nullptr));
vm, panda::FunctionRef::NewClassFunction(vm, JSConstructorInterceptor, nullptr, nullptr));
classFunction_->SetName(vm, StringRef::NewFromUtf8(vm, className_.c_str()));
auto prototype = panda::Local<panda::ObjectRef>(classFunction_->GetFunctionPrototype(vm));
for (const auto& [name, val] : staticFunctions_) {
@ -186,7 +186,7 @@ void JsiClass<C>::Bind(BindingTarget t, JSDestructorCallback<C> dtor, JSGCMarkCa
auto runtime = std::static_pointer_cast<ArkJSRuntime>(JsiDeclarativeEngineInstance::GetJsRuntime());
auto vm = runtime->GetEcmaVm();
classFunction_ = panda::Global<panda::FunctionRef>(
vm, panda::FunctionRef::NewClassFunction(vm, InternalConstructor<Args...>, nullptr));
vm, panda::FunctionRef::NewClassFunction(vm, InternalConstructor<Args...>, nullptr, nullptr));
classFunction_->SetName(vm, StringRef::NewFromUtf8(vm, className_.c_str()));
auto prototype = panda::Local<panda::ObjectRef>(classFunction_->GetFunctionPrototype(vm));
for (const auto& [name, val] : staticFunctions_) {

View File

@ -537,7 +537,7 @@ static const std::unordered_map<std::string, std::function<void(BindingTarget)>>
{ "TextArea", JSTextArea::JSBind },
#if !defined(WINDOWS_PLATFORM) and !defined(MAC_PLATFORM)
{ "QRCode", JSQRCode::JSBind },
#ifndef WEARABLE_PRODUCT
#ifdef FORM_SUPPORTED
{ "FormComponent", JSForm::JSBind },
#endif
#endif

View File

@ -517,7 +517,7 @@ void JsRegisterViews(BindingTarget globalObj)
JSTextArea::JSBind(globalObj);
JSTextInput::JSBind(globalObj);
JSMarquee::JSBind(globalObj);
#if !defined(WEARABLE_PRODUCT) && !defined(OHOS_STANDARD_SYSTEM)
#if defined(FORM_SUPPORTED)
JSForm::JSBind(globalObj);
#endif
JSRect::JSBind(globalObj);

View File

@ -594,7 +594,7 @@ static const std::unordered_map<std::string, std::function<void(BindingTarget)>>
{"Option", JSOption::JSBind},
#if !defined(WINDOWS_PLATFORM) and !defined(MAC_PLATFORM)
{"QRCode", JSQRCode::JSBind},
#ifndef WEARABLE_PRODUCT
#ifdef FORM_SUPPORTED
{"FormComponent", JSForm::JSBind},
#endif
#endif

View File

@ -311,6 +311,11 @@ template("ace_core_source_set") {
sources += [ "common/form_manager.cpp" ]
}
if (defined(config.form_components_support) &&
config.form_components_support) {
deps += [ "$ace_root/frameworks/core/components/form:ace_core_components_form_$platform" ]
}
if (!is_wearable_product) {
deps += [
"$ace_root/frameworks/core/components/camera:ace_core_components_camera_$platform",