|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Builds native app and website artifact metadata and emits JSON or HTML report payloads. More...
#include "native_artifact_emit.h"#include "native_support.h"#include "native_yyjson_helpers.h"#include <stdio.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Macros | |
| #define | pharos_artifact_emit_strdup strdup |
Functions | |
| int | count_substring_occurrences (const char *text, const char *needle) |
| Counts how many times a substring occurs in a string. | |
| char * | json_string_dup_native (const char *value) |
| Duplicates a string while escaping it for JSON string output. | |
| char * | native_website_artifact_dir (const char *build_dir, const char *target_id) |
| Builds the artifact directory path for a generated website target. | |
| char * | native_website_report_path (const char *build_dir, const char *verb, const char *target_id) |
| Builds the report file path for a website build or status operation. | |
| char * | build_native_website_status_report_json (const char *report_id, const char *verb, const char *target_id, const char *artifact_dir) |
| Builds a JSON status report for a native website artifact. | |
| char * | build_native_app_index_html (const char *app_id) |
| Builds the default index.html payload for a native app artifact. | |
| char * | build_artifact_local_app_manifest_json (const char *manifest_text, const char *artifact_generated_by, const char *state_path, const char *base_path, const char *log_path, const char *log_format, const char *error_report_path, const char *debug, const char *compiled_entrypoint, int route_count, int surface_count, int workflow_count) |
| Builds an artifact-localized copy of the app-owned manifest. | |
| char * | build_native_app_build_report_json (const char *artifact_dir, const char *app_id, const char *state_path, const char *base_path, const char *log_path, const char *log_format, const char *error_report_path, const char *debug, const char *host_profile, const char *compiled_entrypoint) |
| Builds a JSON report describing a native app build result. | |
Builds native app and website artifact metadata and emits JSON or HTML report payloads.
Definition in file native_artifact_emit.c.
| #define pharos_artifact_emit_strdup strdup |
Definition at line 18 of file native_artifact_emit.c.
| char * build_artifact_local_app_manifest_json | ( | const char * | manifest_text, |
| const char * | artifact_generated_by, | ||
| const char * | state_path, | ||
| const char * | base_path, | ||
| const char * | log_path, | ||
| const char * | log_format, | ||
| const char * | error_report_path, | ||
| const char * | debug, | ||
| const char * | compiled_entrypoint, | ||
| int | route_count, | ||
| int | surface_count, | ||
| int | workflow_count ) |
Builds an artifact-localized copy of the app-owned manifest.
| manifest_text | Source app manifest JSON text. |
| artifact_generated_by | Generator identifier to stamp into the artifact section. |
| state_path | Effective state file path. |
| base_path | Effective base path. |
| log_path | Effective log path. |
| log_format | Effective log format. |
| error_report_path | Effective error report path. |
| debug | Effective debug setting. |
| compiled_entrypoint | Compiled runtime entrypoint path. |
| route_count | Number of emitted routes. |
| surface_count | Number of emitted surfaces. |
| workflow_count | Number of emitted workflows. |
Definition at line 125 of file native_artifact_emit.c.
References native_json_doc_free(), native_json_doc_load_text(), yyjson_doc_mut_copy(), yyjson_mut_doc_free(), yyjson_mut_doc_get_root(), yyjson_mut_is_obj(), yyjson_mut_obj(), yyjson_mut_obj_add_int(), yyjson_mut_obj_add_strcpy(), yyjson_mut_obj_get(), yyjson_mut_obj_put(), yyjson_mut_obj_remove_key(), yyjson_mut_strcpy(), yyjson_mut_write(), YYJSON_WRITE_ESCAPE_UNICODE, and YYJSON_WRITE_PRETTY.
Referenced by build_app_from_root_native().
| char * build_native_app_build_report_json | ( | const char * | artifact_dir, |
| const char * | app_id, | ||
| const char * | state_path, | ||
| const char * | base_path, | ||
| const char * | log_path, | ||
| const char * | log_format, | ||
| const char * | error_report_path, | ||
| const char * | debug, | ||
| const char * | host_profile, | ||
| const char * | compiled_entrypoint ) |
Builds a JSON report describing a native app build result.
| artifact_dir | Emitted artifact directory. |
| app_id | App identifier. |
| state_path | Effective state file path. |
| base_path | Effective base path. |
| log_path | Effective log path. |
| log_format | Effective log format. |
| error_report_path | Effective error report path. |
| debug | Effective debug setting. |
| host_profile | Host profile selected for the app. |
| compiled_entrypoint | Compiled runtime entrypoint path. |
Definition at line 244 of file native_artifact_emit.c.
References json_string_dup_native().
Referenced by build_app_from_root_native(), and handle_native_runtime_app_command().
| char * build_native_app_index_html | ( | const char * | app_id | ) |
Builds the default index.html payload for a native app artifact.
| app_id | App identifier to embed. |
Definition at line 115 of file native_artifact_emit.c.
Referenced by build_app_from_root_native().
| char * build_native_website_status_report_json | ( | const char * | report_id, |
| const char * | verb, | ||
| const char * | target_id, | ||
| const char * | artifact_dir ) |
Builds a JSON status report for a native website artifact.
| report_id | Stable report identifier. |
| verb | Report verb such as status. |
| target_id | Website target identifier. |
| artifact_dir | Website artifact directory. |
Definition at line 100 of file native_artifact_emit.c.
Referenced by emit_website_status_native().
| int count_substring_occurrences | ( | const char * | text, |
| const char * | needle ) |
Counts how many times a substring occurs in a string.
| text | Text to scan. |
| needle | Substring to count. |
Definition at line 21 of file native_artifact_emit.c.
Referenced by build_app_from_root_native().
| char * json_string_dup_native | ( | const char * | value | ) |
Duplicates a string while escaping it for JSON string output.
| value | Source string value. |
Definition at line 35 of file native_artifact_emit.c.
References buffer_append(), buffer_free(), buffer_init(), and Buffer::data.
Referenced by build_native_app_build_report_json(), build_native_app_config_report_local_json(), build_native_app_deploy_check_report_local_json(), build_native_app_doctor_report_local_json(), build_native_app_drift_report_local_json(), build_native_app_runtime_report_json(), build_native_backup_report_local_json(), build_native_restore_report_local_json(), build_native_runtime_build_report_json(), build_native_runtime_status_report_json(), build_runtime_summary_json_from_app(), handle_native_deploy_package_deb_command(), native_append_json_string_item(), native_build_sqlite_migrate_verify_failure_report_json(), native_capture_migrate_verify_sqlite_report_json(), native_db_check_json(), native_json_nullable_string_dup(), native_json_object_string_json_dup(), native_output_path_check_json(), and write_error_report_native().
| char * native_website_artifact_dir | ( | const char * | build_dir, |
| const char * | target_id ) |
Builds the artifact directory path for a generated website target.
| build_dir | Base build directory. |
| target_id | Website target identifier. |
Definition at line 83 of file native_artifact_emit.c.
References path_join().
Referenced by emit_website_status_native().
| char * native_website_report_path | ( | const char * | build_dir, |
| const char * | verb, | ||
| const char * | target_id ) |
Builds the report file path for a website build or status operation.
| build_dir | Base build directory. |
| verb | Report verb such as build or status. |
| target_id | Website target identifier. |
Definition at line 87 of file native_artifact_emit.c.
References path_join().
Referenced by build_app_from_root_native(), emit_website_status_native(), and handle_native_runtime_command().