From 6472d699f1114a6828f85be4726d2474703b31bd Mon Sep 17 00:00:00 2001 From: Mikhail Bystretskiy Date: Fri, 15 Nov 2024 18:00:14 +0300 Subject: [PATCH] Rework arkts build tasks --- .gitlab-ci.yml | 2 +- arktsconfig-peers-main.json | 15 +++++++++++++++ arktsconfig-peers.json | 13 ++++++------- native/meson.build | 2 +- package.json | 29 +++++++++++++++-------------- 5 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 arktsconfig-peers-main.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d92c47fe3..854466988 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,7 +49,7 @@ compile arkts subset: - !reference [.setup, script] - PANDA_SDK_VERSION=1.5.0-dev.7123 npm run panda:sdk:install script: - - npm run compile:all:arkts:idl + - npm run compile:all:arkts arkts subset tsc: stage: test diff --git a/arktsconfig-peers-main.json b/arktsconfig-peers-main.json new file mode 100644 index 000000000..e19d4fab4 --- /dev/null +++ b/arktsconfig-peers-main.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "outDir": "out/abc-peers", + "rootDir": "./out/arkts-peers/generated", + "paths": { + "#components": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/arkts"], + "@arkoala/arkui": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated"], + "@koalaui/interop": ["./external/interop/src/arkts"], + "@koalaui/common": ["./external/incremental/common/src"], + "@koalaui/compat": ["./external/incremental/compat/src/arkts"], + "@koalaui/runtime": ["./external/incremental/runtime/src"] + } + }, + "include": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/main.ts"] +} diff --git a/arktsconfig-peers.json b/arktsconfig-peers.json index d71df484f..51f01cd96 100644 --- a/arktsconfig-peers.json +++ b/arktsconfig-peers.json @@ -1,19 +1,18 @@ { "compilerOptions": { - "outDir": "out/abc-peers", - "rootDir": "./out/arkts-peers/generated", + "baseUrl": ".", "paths": { "#components": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/arkts"], "@arkoala/arkui": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated", "./"], - "@arkoala/arkui/*": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/*", "./*"], - "@koalaui/arkoala": ["./out/arkts-peers/generated/sig/arkoala-arkts/framework/src"], "@koalaui/interop": ["./external/interop/src/arkts"], "@koalaui/common": ["./external/incremental/common/src"], "@koalaui/compat": ["./external/incremental/compat/src/arkts"], "@koalaui/runtime": ["./external/incremental/runtime/src"] } }, - "include": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/**/*\\.ts"], - "exclude": ["./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/ts/*\\.ts", - "./out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/main.ts"] + "include": ["out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/**/*\\.ts"], + "exclude": [ + "out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/ts/*\\.ts", + "out/arkts-peers/generated/sig/arkoala-arkts/arkui/src/generated/main.ts" + ] } diff --git a/native/meson.build b/native/meson.build index 4cfca3128..bb4178e6d 100644 --- a/native/meson.build +++ b/native/meson.build @@ -24,7 +24,7 @@ is_jni = java_home != 'undefined' compile_events_test = get_option('events_test') compile_callbacks_test = get_option('callbacks_test') -if ['ts-peers', 'ts-subset', 'java-subset', 'arkts-subset', 'cangjie-subset'].contains(source_set) +if ['ts-peers', 'ts-subset', 'java-subset', 'arkts-subset', 'arkts-peers', 'cangjie-subset'].contains(source_set) gen_dir = '../out/' / source_set / 'generated' else endif diff --git a/package.json b/package.json index ef4195e63..8eeefd090 100644 --- a/package.json +++ b/package.json @@ -88,14 +88,15 @@ "compile:native-node-host-ts-subset": "npm run configure:native-node-host-ts-subset && cd native && meson compile --verbose -C build-node-host-ts-subset && meson install -C build-node-host-ts-subset", "configure:native-node-host-arkts-subset": "cd ./native && meson setup -Dsource_set=arkts-subset build-node-host-arkts-subset", "compile:native-node-host-arkts-subset": "npm run configure:native-node-host-arkts-subset && cd native && meson compile --verbose -C build-node-host-arkts-subset && meson install -C build-node-host-arkts-subset", + "configure:native-node-host-arkts-full": "cd ./native && meson setup -Dsource_set=arkts-peers build-node-host-arkts-full", + "compile:native-node-host-arkts-full": "npm run configure:native-node-host-arkts-full && cd native && meson compile --verbose -C build-node-host-arkts-full && meson install -C build-node-host-arkts-full", "configure:native-node-host-full": "cd ./native && meson setup -Dsource_set=ts-peers build-node-host-full", "compile:native-node-host-full": "npm run configure:native-node-host-full && cd native && meson compile --verbose -C build-node-host-full && meson install -C build-node-host-full", - "sanity": "npm run check:subset:run && npm run check:peers:run && npm run run:all && npm run lint:test && npm run make:arkts:idl", + "sanity": "npm run check:subset:run && npm run check:peers:run && npm run run:all && npm run lint:test && npm run make:arkts", "panda:sdk:install": "npm run panda:sdk:install --prefix external/incremental/tools/panda", - "make:arkts": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --input-dir ./tests/subset/ets --output-dir ./out/arkts-subset/generated --language arkts", - "make:arkts:idl": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --input-dir ./tests/arkts-subset/ets,./tests/arkts-subset/resource --output-dir ./out/arkts-subset/generated --language arkts", + "make:arkts": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --input-dir ./tests/arkts-subset/ets,./tests/arkts-subset/resource --output-dir ./out/arkts-subset/generated --language arkts", "make:arkts:subset:tsc": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --only-integrated --input-dir ./tests/arkts-subset/ets/,./tests/arkts-subset/resource --arkoala-destination ./out/arkts-subset-tsc/generated --generator-target arkoala --language=arkts", - "make:arkts:peers": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --input-dir ./interface_sdk-js/api/@internal/component/ets/ --output-dir ./out/arkts-peers/generated --language arkts", + "make:arkts:peers": "npm run compile && node . --api-version 99 --dts2peer --need-interfaces --input-dir ./interface_sdk-js/api/@internal/component/ets/,./interface_sdk-js/api/global --output-dir ./out/arkts-peers/generated --language arkts", "compile:arkts": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-subset.json --ets-module --extension sts --list-files", "compile:arkts:compat": "cd ./external/incremental/compat/ && npm run compile:arkts", "compile:arkts:common": "cd ./external/incremental/common/ && npm run compile:arkts", @@ -103,16 +104,16 @@ "compile:arkts:interop": "cd ./external/interop/ && npm run compile:arkts && echo ATTENTION: an interop is compiled without unmemoization here!", "compile:arkts:peers": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-peers.json --ets-module --extension sts --list-files --compiler-memory-size=1073741824", "compile:arkts:subset": "npm run make:arkts && npm run compile:arkts", - "compile:arkts:idl:subset": "npm run make:arkts:idl && npm run compile:arkts", "compile:arkts:subset:main": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-subset-main.json --extension sts --list-files", - "make:compile:arkts:peers": "npm run make:arkts:peers && npm run compile:arkts:peers", + "compile:arkts:peers:main": "bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-peers-main.json --extension sts --list-files", + "compile:arkts:libs": "npm run compile:arkts:compat && npm run compile:arkts:common && npm run compile:arkts:runtime && npm run compile:arkts:interop", + "make:compile:arkts:peers": "npm run make:arkts:peers && npm run compile:arkts:peers && npm run compile:native-node-host-arkts-full && npm run compile:arkts:libs && npm run compile:arkts:peers:main && npm run link:incremental --prefix ./external/incremental/runtime && cp ./external/incremental/runtime/build/incremental.abc ./out/abc-peers/sig/arkoala-arkts/arkui/src/generated", "run:arkts-link-interfaces": "bash ./external/incremental/tools/panda/arkts/arklink --output ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/dts_interfaces.abc -- `find ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/ -name *Interfaces.abc`", - "compile:all:arkts": "npm run compile:arkts:subset && npm run compile:native-node-host-arkts-subset && npm run compile:arkts:compat && npm run compile:arkts:common && npm run compile:arkts:runtime && npm run compile:arkts:interop && npm run compile:arkts:subset:main && npm run link:incremental --prefix ./external/incremental/runtime && cp ./external/incremental/runtime/build/incremental.abc ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated", - "compile:all:arkts:idl": "npm run compile:arkts:idl:subset && npm run compile:native-node-host-arkts-subset && npm run compile:arkts:compat && npm run compile:arkts:common && npm run compile:arkts:runtime && npm run compile:arkts:interop && npm run compile:arkts:subset:main", - "execute:panda": "ACE_LIBRARY_PATH=./native/build-node-host-arkts-subset LD_LIBRARY_PATH=./native bash ./external/incremental/tools/panda/arkts/ark --ark-entry-point ETSGLOBAL::main --ark-boot-files ./external/incremental/compat/build/abc/arkts/index.abc:./out/abc-subset:./external/interop/build/abc:./external/incremental/runtime/build/abc:./external/incremental/compat/build/abc:./external/incremental/common/build/abc ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/main.abc --driver-log info && echo 'Workaround: make sure compat/src/arkts/index.ts abc goes first until index.ETSGLOBAL issues is reolved'", - "run:panda": "npm run compile:all:arkts && npm run execute:panda", - "run:panda:idl": "npm run compile:all:arkts:idl && npm run execute:panda", - "run:panda:peers": "npm run make:compile:arkts:peers", + "compile:all:arkts": "npm run compile:arkts:subset && npm run compile:native-node-host-arkts-subset && npm run compile:arkts:libs && npm run compile:arkts:subset:main && npm run link:incremental --prefix ./external/incremental/runtime && cp ./external/incremental/runtime/build/incremental.abc ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated", + "execute:panda:subset": "ACE_LIBRARY_PATH=./native/build-node-host-arkts-subset LD_LIBRARY_PATH=./native bash ./external/incremental/tools/panda/arkts/ark --ark-entry-point ETSGLOBAL::main --ark-boot-files ./external/incremental/compat/build/abc/arkts/index.abc:./out/abc-subset:./external/interop/build/abc:./external/incremental/runtime/build/abc:./external/incremental/compat/build/abc:./external/incremental/common/build/abc ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/main.abc --driver-log info && echo 'Workaround: make sure compat/src/arkts/index.ts abc goes first until index.ETSGLOBAL issues is reolved'", + "execute:panda:peers": "ACE_LIBRARY_PATH=./native/build-node-host-arkts-peers LD_LIBRARY_PATH=./native bash ./external/incremental/tools/panda/arkts/ark --ark-entry-point ETSGLOBAL::main --ark-boot-files ./external/incremental/compat/build/abc/arkts/index.abc:./out/abc-peers:./external/interop/build/abc:./external/incremental/runtime/build/abc:./external/incremental/compat/build/abc:./external/incremental/common/build/abc ./out/abc-peers/sig/arkoala-arkts/arkui/src/generated/main.abc --driver-log info && echo 'Workaround: make sure compat/src/arkts/index.ts abc goes first until index.ETSGLOBAL issues is reolved'", + "run:panda:subset": "npm run compile:all:arkts && npm run execute:panda:subset", + "run:panda:peers": "npm run make:compile:arkts:peers && npm run execute:panda:peers", "compile:java": "npm run compile && node . --api-version 99 --dts2peer --input-dir ./tests/java-subset/ets/,./tests/java-subset/resource --output-dir ./out/java-subset/generated --language java --need-interfaces && npm run compile:native-node-host-java-subset && bash -c \"find ./out/java-subset/generated/sig/arkoala/framework/java/src/org/koalaui/arkoala/ -name *.java > ./out/java-subset/generated/sig/arkoala/framework/java/src/org/koalaui/arkoala/files.list\" && javac -sourcepath ./out/java-subset/generated/sig/arkoala/framework/java/src -d ./out/java-subset/bin @./out/java-subset/generated/sig/arkoala/framework/java/src/org/koalaui/arkoala/files.list", "run:java": "npm run compile:java && npm run compile:native-node-host-java-subset && ACE_LIBRARY_PATH=./native java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Main", "run:java:concurrent": "npm run compile:java && npm run compile:native-node-host-java-subset && java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Concurrent", @@ -120,7 +121,7 @@ "run:dummy-panda:java": "npm run compile:java && npm run compile:native-node-host-java-subset && java -Djava.library.path=./native -cp ./out/java-subset/bin org.koalaui.arkoala.Application", "run:dummy-panda:panda": "rimraf build && npm run make:arkts && bash ./external/incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-application.json && npm run compile:native-node-host-arkts-subset && LD_LIBRARY_PATH=./native PANDA_LIB_PATH=./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/ bash ./external/incremental/tools/panda/arkts/ark --ark-boot-files ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated ./out/abc-subset/sig/arkoala-arkts/arkui/src/generated/Application.abc", "run:app:java": "npm run compile:dummy-panda && ACE_LIBRARY_PATH=./native node lib/loader.js java", - "run:app:panda": "cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs && npm run compile:all:arkts:idl && PANDA_HOME=./external/incremental/tools/panda/node_modules/@panda/sdk ACE_LIBRARY_PATH=./native node lib/loader.js panda", + "run:app:panda": "cross-env mode=subset rollup -c rollup.config.dummy-panda.mjs && npm run compile:all:arkts && PANDA_HOME=./external/incremental/tools/panda/node_modules/@panda/sdk ACE_LIBRARY_PATH=./native node lib/loader.js panda", "run:es2panda": "npm run compile && npm run compile:dummy-panda && node lib/loader.js es2panda", "compile:native-ohos-subset-arm32": "npm run check:subset && node ./native/nativeBuild.mjs subset arm32", "compile:native-ohos-subset-arm64": "npm run check:subset && node ./native/nativeBuild.mjs subset arm64", @@ -152,7 +153,7 @@ "arkoala:har": "npm run generate:ts && cd external && npm run arkoala:har", "arkoala:har-arm32": "npm run generate:ts && cd external && npm run arkoala:har-arm32", "sig:arkts:subset:clean": "cd ./external/arkoala-arkts/arkui && rm -rf src/generated/ && rm -rf build/ && rm -rf unmemoized/", - "sig:arkts:subset:copy": "npm run make:arkts:idl && cp -r ./out/arkts-subset/generated/sig/arkoala-arkts/arkui/src/generated/ ./external/arkoala-arkts/arkui/src/", + "sig:arkts:subset:copy": "npm run make:arkts && cp -r ./out/arkts-subset/generated/sig/arkoala-arkts/arkui/src/generated/ ./external/arkoala-arkts/arkui/src/", "sig:arkts:subset:compile": "cd external/arkoala-arkts/arkui && npm run compile:arkts:unmemoized", "sig:arkts:subset:all": "npm run sig:arkts:subset:clean && npm run sig:arkts:subset:copy && npm run sig:arkts:subset:compile" } -- Gitee