Skip to content

Commit e979da9

Browse files
committed
refactor(net): trim generated network test artifacts
1 parent 09144e4 commit e979da9

56 files changed

Lines changed: 709 additions & 25490 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
function(pocketjs_generate_test_artifact output_variable generator)
2+
set(_pocketjs_output_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
3+
if(CMAKE_BUILD_EARLY_EXPANSION)
4+
set(${output_variable} "${_pocketjs_output_dir}" PARENT_SCOPE)
5+
return()
6+
endif()
7+
8+
get_filename_component(_pocketjs_component_dir "${generator}" DIRECTORY)
9+
get_filename_component(
10+
_pocketjs_root
11+
"${_pocketjs_component_dir}/../../../.."
12+
ABSOLUTE
13+
)
14+
15+
find_program(_pocketjs_bun NAMES bun)
16+
if(NOT _pocketjs_bun)
17+
message(FATAL_ERROR
18+
"PocketJS test artifact generation requires Bun in PATH")
19+
endif()
20+
21+
file(MAKE_DIRECTORY "${_pocketjs_output_dir}")
22+
23+
file(GLOB_RECURSE _pocketjs_artifact_inputs
24+
CONFIGURE_DEPENDS
25+
LIST_DIRECTORIES false
26+
"${_pocketjs_component_dir}/*.json"
27+
"${_pocketjs_component_dir}/*.pem"
28+
"${_pocketjs_component_dir}/*.ts"
29+
"${_pocketjs_root}/contracts/spec/*.ts"
30+
"${_pocketjs_root}/framework/compiler/*.ts"
31+
"${_pocketjs_root}/framework/src/manifest/*.ts"
32+
"${_pocketjs_root}/framework/src/net/*.ts"
33+
"${_pocketjs_root}/hosts/esp-idf/components/pocketjs_net_formal_*_artifact/*.pem"
34+
"${_pocketjs_root}/hosts/esp-idf/components/pocketjs_net_formal_*_artifact/*.ts"
35+
)
36+
list(APPEND _pocketjs_artifact_inputs
37+
"${_pocketjs_root}/bun.lock"
38+
"${_pocketjs_root}/package.json"
39+
"${_pocketjs_root}/tools/build.ts"
40+
"${_pocketjs_root}/tools/network-bundle-factory.ts"
41+
"${_pocketjs_root}/tools/test-artifact-output.ts"
42+
)
43+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
44+
${_pocketjs_artifact_inputs})
45+
46+
execute_process(
47+
COMMAND
48+
"${_pocketjs_bun}"
49+
"${generator}"
50+
"--output-dir=${_pocketjs_output_dir}"
51+
WORKING_DIRECTORY "${_pocketjs_root}"
52+
RESULT_VARIABLE _pocketjs_generate_result
53+
OUTPUT_VARIABLE _pocketjs_generate_stdout
54+
ERROR_VARIABLE _pocketjs_generate_stderr
55+
)
56+
if(NOT _pocketjs_generate_result EQUAL 0)
57+
message(FATAL_ERROR
58+
"PocketJS test artifact generation failed (${_pocketjs_generate_result})\n"
59+
"${_pocketjs_generate_stdout}${_pocketjs_generate_stderr}")
60+
endif()
61+
62+
set(${output_variable} "${_pocketjs_output_dir}" PARENT_SCOPE)
63+
endfunction()

hosts/esp-idf/components/pocketjs_net_esp_http/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

hosts/esp-idf/components/pocketjs_net_esp_http/README.md

Lines changed: 0 additions & 100 deletions
This file was deleted.

hosts/esp-idf/components/pocketjs_net_esp_http/idf_component.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)