Tuanjie copies TypeScript files under directory Assets\Plugins\OpenHarmony
(includes .ts
, .ets
) over to the tuanjieLib\src\main\ets
directory of DevEco Studio project, and also copies .har
plugins to the tuanjieLib/libs
directory. After that Tuanjie
will modify the fields within packages
and sources
(runtimeOnly
module) in tuanjieLib/build-profile.json5
file.
"buildOption": {
"arkOptions": {
"runtimeOnly": {
"packages": [ "myhar" ] // 配置本模块变量动态import其他模块名,要求与dependencies中配置的名字一致。
"sources": [ "./src/main/ets/myClass.ets" ] // 配置本模块变量动态import自己的文件路径,路径相对于当前build-profile.json5文件。
}
}
}
另外,如果导出的TypeScript文件(.ts
, .ets
)有对应的export
字段,Tuanjie
会修改tuanjieLib/exported.ets
文件,添加对应的字段,例如:
TypeScript
export {TestManager} from "./src/main/ets/TestClassUI"
If you add files (includes .ts
, .ets
,.har
) after exported , you can modify the tuanjieLib/build-profile.json5
and file tuanjieLib/exported.ets
by yourself.