清除所有第三方库

This commit is contained in:
JackLee 2026-02-22 19:00:19 +08:00
parent 00318a3bae
commit 25794b178b
65 changed files with 16 additions and 49 deletions

View File

@ -17,7 +17,7 @@
"arkOptions": { "arkOptions": {
"runtimeOnly" : { "runtimeOnly" : {
"packages": [ "packages": [
"libocctrender.so" "libnativeocct.so"
] ]
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -6,13 +6,13 @@
"lockfileVersion": 3, "lockfileVersion": 3,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": { "specifiers": {
"libocctrender.so@src/main/cpp/types/libocctrender": "libocctrender.so@src/main/cpp/types/libocctrender" "libnativeocct.so@src/main/cpp/types/libnativeocct": "libnativeocct.so@src/main/cpp/types/libnativeocct"
}, },
"packages": { "packages": {
"libocctrender.so@src/main/cpp/types/libocctrender": { "libnativeocct.so@src/main/cpp/types/libnativeocct": {
"name": "libocctrender.so", "name": "libnativeocct.so",
"version": "1.0.0", "version": "1.0.0",
"resolved": "src/main/cpp/types/libocctrender", "resolved": "src/main/cpp/types/libnativeocct",
"registryType": "local" "registryType": "local"
} }
} }

View File

@ -6,6 +6,6 @@
"author": "", "author": "",
"license": "", "license": "",
"dependencies": { "dependencies": {
"libocctrender.so": "file:./src/main/cpp/types/libocctrender" "libnativeocct.so": "file:./src/main/cpp/types/libnativeocct"
} }
} }

View File

@ -13,8 +13,8 @@ include_directories(${NATIVERENDER_ROOT_PATH}
set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "$ORIGIN") set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) set(CMAKE_INSTALL_RPATH "\${ORIGIN}")
# OCCT # OCCT
set(OCCT_VERSION "7.9") set(OCCT_VERSION "7.9")
@ -68,7 +68,7 @@ foreach(LIB_NAME ${THIRD_PARTY_LIBS})
endforeach() endforeach()
# #
add_library(occtrender SHARED add_library(nativeocct SHARED
napi_init.cpp napi_init.cpp
# Header # Header
EGLCore/EGLCore.h EGLCore/EGLCore.h
@ -87,12 +87,8 @@ find_library(hilog-lib hilog_ndk.z)
find_library(libace-lib ace_ndk.z) find_library(libace-lib ace_ndk.z)
find_library(libuv-lib uv) find_library(libuv-lib uv)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# #
target_link_libraries(occtrender PUBLIC target_link_libraries(nativeocct PUBLIC
# EGL Hilog # EGL Hilog
${EGL-lib} ${EGL-lib}
${GLES-lib} ${GLES-lib}

View File

@ -1,5 +1,5 @@
{ {
"name": "libocctrender.so", "name": "libnativeocct.so",
"types": "./Index.d.ts", "types": "./Index.d.ts",
"version": "1.0.0", "version": "1.0.0",
"description": "Please describe the basic information." "description": "Please describe the basic information."

View File

@ -65,11 +65,11 @@ export struct ModelView {
}) })
Button('测试库加载').onClick(async()=>{ Button('测试库加载').onClick(async()=>{
try { try {
let OCCTRender = await import("libocctrender.so") const nativeocct = await import("libnativeocct.so")
console.info(`[NDK] 模块类型: ${typeof OCCTRender}`); console.info(`[NDK] 模块类型: ${typeof nativeocct}`);
console.info(`[NDK] 模块值: ${JSON.stringify(OCCTRender)}`); console.info(`[NDK] 模块值: ${JSON.stringify(nativeocct)}`);
console.info(`[NDK] 所有属性: ${Object.keys(OCCTRender).join(', ')}`); console.info(`[NDK] 所有属性: ${Object.keys(nativeocct).join(', ')}`);
if (!OCCTRender) throw new Error("模块为 undefined"); if (!nativeocct) throw new Error("模块为 undefined");
} catch (e) { } catch (e) {
console.error(`[NDK] 加载失败: ${e.message}`, e); console.error(`[NDK] 加载失败: ${e.message}`, e);
// 此处会触发你看到的错误 // 此处会触发你看到的错误
@ -81,35 +81,6 @@ export struct ModelView {
type: 'surface', type: 'surface',
controller: this.displayController controller: this.displayController
}) })
// .onLoad(() => {
// // 获取 native window必须在 onLoad 后才能获取)
// this.nativeWindow = this.displayController.getXComponentSurfaceId();
// if (this.nativeWindow === undefined || this.nativeWindow === '') {
// hilog.error(0x0000, 'ModelView', 'Failed to get native window');
// return;
// }
// // 获取 XComponent 尺寸
// let width = 0;
// let height = 0;
// try {
// OCCTRender.initRenderer(this.displayContrId, this.nativeWindow, { width: 800, height: 600 });
// console.info('Init Render Good');
// }catch(e){
// console.info('Init Render Faile');
// }
// })
// .onDestroy(() => {
// // 销毁时清理资源
// OCCTRender.destroyRenderer(this.displayContrId);
// })
// .onTouch((event) => {
// // 简单鼠标/触摸拖拽旋转
// if (event.type === TouchType.Move) {
// const dx = event.tiltX;
// const dy = event.tiltY;
// //occt.onMouseEvent(this.xcomponentId, dx, dy);
// }
// })
.width('100%') .width('100%')
.height('100%') .height('100%')
.backgroundColor('#333333'); .backgroundColor('#333333');