From 4fd92ec6b203d6b94b9e9f9531fd60a65736e810 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 11 Dec 2024 09:30:07 -0500 Subject: Restructure project * Move headers to relevant include directories within the target tree(s) * Adjust doxygen configuration to search correct paths * Adjust CMake configuration to use new include paths --- src/cli/stasis/CMakeLists.txt | 6 +++++- src/cli/stasis/args.h | 24 --------------------- src/cli/stasis/callbacks.h | 10 --------- src/cli/stasis/include/args.h | 24 +++++++++++++++++++++ src/cli/stasis/include/callbacks.h | 10 +++++++++ src/cli/stasis/include/system_requirements.h | 13 ++++++++++++ src/cli/stasis/include/tpl.h | 10 +++++++++ src/cli/stasis/system_requirements.h | 13 ------------ src/cli/stasis/tpl.h | 10 --------- src/cli/stasis_indexer/CMakeLists.txt | 8 ++++--- src/cli/stasis_indexer/args.h | 9 -------- src/cli/stasis_indexer/callbacks.h | 9 -------- src/cli/stasis_indexer/helpers.h | 27 ------------------------ src/cli/stasis_indexer/include/args.h | 9 ++++++++ src/cli/stasis_indexer/include/callbacks.h | 9 ++++++++ src/cli/stasis_indexer/include/helpers.h | 27 ++++++++++++++++++++++++ src/cli/stasis_indexer/include/junitxml_report.h | 8 +++++++ src/cli/stasis_indexer/include/readmes.h | 8 +++++++ src/cli/stasis_indexer/include/website.h | 8 +++++++ src/cli/stasis_indexer/junitxml_report.h | 8 ------- src/cli/stasis_indexer/readmes.h | 8 ------- src/cli/stasis_indexer/website.h | 8 ------- 22 files changed, 136 insertions(+), 130 deletions(-) delete mode 100644 src/cli/stasis/args.h delete mode 100644 src/cli/stasis/callbacks.h create mode 100644 src/cli/stasis/include/args.h create mode 100644 src/cli/stasis/include/callbacks.h create mode 100644 src/cli/stasis/include/system_requirements.h create mode 100644 src/cli/stasis/include/tpl.h delete mode 100644 src/cli/stasis/system_requirements.h delete mode 100644 src/cli/stasis/tpl.h delete mode 100644 src/cli/stasis_indexer/args.h delete mode 100644 src/cli/stasis_indexer/callbacks.h delete mode 100644 src/cli/stasis_indexer/helpers.h create mode 100644 src/cli/stasis_indexer/include/args.h create mode 100644 src/cli/stasis_indexer/include/callbacks.h create mode 100644 src/cli/stasis_indexer/include/helpers.h create mode 100644 src/cli/stasis_indexer/include/junitxml_report.h create mode 100644 src/cli/stasis_indexer/include/readmes.h create mode 100644 src/cli/stasis_indexer/include/website.h delete mode 100644 src/cli/stasis_indexer/junitxml_report.h delete mode 100644 src/cli/stasis_indexer/readmes.h delete mode 100644 src/cli/stasis_indexer/website.h (limited to 'src/cli') diff --git a/src/cli/stasis/CMakeLists.txt b/src/cli/stasis/CMakeLists.txt index da63d57..1996c4c 100644 --- a/src/cli/stasis/CMakeLists.txt +++ b/src/cli/stasis/CMakeLists.txt @@ -1,4 +1,3 @@ -include_directories(${CMAKE_SOURCE_DIR}) add_executable(stasis stasis_main.c args.c @@ -10,6 +9,11 @@ target_link_libraries(stasis PRIVATE stasis_core stasis_delivery ) +target_include_directories(stasis PRIVATE + ${core_INCLUDE} + ${delivery_INCLUDE} + ${CMAKE_CURRENT_SOURCE_DIR}/include +) target_link_libraries(stasis PUBLIC LibXml2::LibXml2) install(TARGETS stasis RUNTIME) diff --git a/src/cli/stasis/args.h b/src/cli/stasis/args.h deleted file mode 100644 index 5bad752..0000000 --- a/src/cli/stasis/args.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef STASIS_ARGS_H -#define STASIS_ARGS_H - -#include -#include -#include -#include - -#define OPT_ALWAYS_UPDATE_BASE 1000 -#define OPT_NO_DOCKER 1001 -#define OPT_NO_ARTIFACTORY 1002 -#define OPT_NO_ARTIFACTORY_BUILD_INFO 1003 -#define OPT_NO_ARTIFACTORY_UPLOAD 1004 -#define OPT_NO_TESTING 1005 -#define OPT_OVERWRITE 1006 -#define OPT_NO_REWRITE_SPEC_STAGE_2 1007 -#define OPT_FAIL_FAST 1009 -#define OPT_NO_PARALLEL 1010 -#define OPT_POOL_STATUS_INTERVAL 1011 - -extern struct option long_options[]; -void usage(char *progname); - -#endif //STASIS_ARGS_H diff --git a/src/cli/stasis/callbacks.h b/src/cli/stasis/callbacks.h deleted file mode 100644 index 369ce56..0000000 --- a/src/cli/stasis/callbacks.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef STASIS_CALLBACKS_H -#define STASIS_CALLBACKS_H - -#include "core.h" -#include "envctl.h" - -int callback_except_jf(const void *a, const void *b); -int callback_except_gh(const void *a, const void *b); - -#endif //STASIS_CALLBACKS_H diff --git a/src/cli/stasis/include/args.h b/src/cli/stasis/include/args.h new file mode 100644 index 0000000..5bad752 --- /dev/null +++ b/src/cli/stasis/include/args.h @@ -0,0 +1,24 @@ +#ifndef STASIS_ARGS_H +#define STASIS_ARGS_H + +#include +#include +#include +#include + +#define OPT_ALWAYS_UPDATE_BASE 1000 +#define OPT_NO_DOCKER 1001 +#define OPT_NO_ARTIFACTORY 1002 +#define OPT_NO_ARTIFACTORY_BUILD_INFO 1003 +#define OPT_NO_ARTIFACTORY_UPLOAD 1004 +#define OPT_NO_TESTING 1005 +#define OPT_OVERWRITE 1006 +#define OPT_NO_REWRITE_SPEC_STAGE_2 1007 +#define OPT_FAIL_FAST 1009 +#define OPT_NO_PARALLEL 1010 +#define OPT_POOL_STATUS_INTERVAL 1011 + +extern struct option long_options[]; +void usage(char *progname); + +#endif //STASIS_ARGS_H diff --git a/src/cli/stasis/include/callbacks.h b/src/cli/stasis/include/callbacks.h new file mode 100644 index 0000000..369ce56 --- /dev/null +++ b/src/cli/stasis/include/callbacks.h @@ -0,0 +1,10 @@ +#ifndef STASIS_CALLBACKS_H +#define STASIS_CALLBACKS_H + +#include "core.h" +#include "envctl.h" + +int callback_except_jf(const void *a, const void *b); +int callback_except_gh(const void *a, const void *b); + +#endif //STASIS_CALLBACKS_H diff --git a/src/cli/stasis/include/system_requirements.h b/src/cli/stasis/include/system_requirements.h new file mode 100644 index 0000000..ddc2705 --- /dev/null +++ b/src/cli/stasis/include/system_requirements.h @@ -0,0 +1,13 @@ +#ifndef STASIS_SYSTEM_REQUIREMENTS_H +#define STASIS_SYSTEM_REQUIREMENTS_H + +#include "delivery.h" +#include "callbacks.h" +#include "envctl.h" + +void check_system_path(); +void check_system_env_requirements(); +void check_system_requirements(struct Delivery *ctx); +void check_requirements(struct Delivery *ctx); + +#endif //STASIS_SYSTEM_REQUIREMENTS_H diff --git a/src/cli/stasis/include/tpl.h b/src/cli/stasis/include/tpl.h new file mode 100644 index 0000000..398f0fe --- /dev/null +++ b/src/cli/stasis/include/tpl.h @@ -0,0 +1,10 @@ +#ifndef STASIS_TPL_H +#define STASIS_TPL_H + +#include "template.h" +#include "template_func_proto.h" + +void tpl_setup_vars(struct Delivery *ctx); +void tpl_setup_funcs(struct Delivery *ctx); + +#endif //STASIS_TPL_H diff --git a/src/cli/stasis/system_requirements.h b/src/cli/stasis/system_requirements.h deleted file mode 100644 index ddc2705..0000000 --- a/src/cli/stasis/system_requirements.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef STASIS_SYSTEM_REQUIREMENTS_H -#define STASIS_SYSTEM_REQUIREMENTS_H - -#include "delivery.h" -#include "callbacks.h" -#include "envctl.h" - -void check_system_path(); -void check_system_env_requirements(); -void check_system_requirements(struct Delivery *ctx); -void check_requirements(struct Delivery *ctx); - -#endif //STASIS_SYSTEM_REQUIREMENTS_H diff --git a/src/cli/stasis/tpl.h b/src/cli/stasis/tpl.h deleted file mode 100644 index 398f0fe..0000000 --- a/src/cli/stasis/tpl.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef STASIS_TPL_H -#define STASIS_TPL_H - -#include "template.h" -#include "template_func_proto.h" - -void tpl_setup_vars(struct Delivery *ctx); -void tpl_setup_funcs(struct Delivery *ctx); - -#endif //STASIS_TPL_H diff --git a/src/cli/stasis_indexer/CMakeLists.txt b/src/cli/stasis_indexer/CMakeLists.txt index b100925..8c00ce4 100644 --- a/src/cli/stasis_indexer/CMakeLists.txt +++ b/src/cli/stasis_indexer/CMakeLists.txt @@ -5,11 +5,13 @@ add_executable(stasis_indexer helpers.c junitxml_report.c website.c - website.h readmes.c - readmes.h ) -target_include_directories(stasis_indexer PRIVATE ${CMAKE_SOURCE_DIR}) +target_include_directories(stasis_indexer PRIVATE + ${core_INCLUDE} + ${delivery_INCLUDE} + ${CMAKE_CURRENT_SOURCE_DIR}/include +) target_link_libraries(stasis_indexer PRIVATE stasis_core stasis_delivery diff --git a/src/cli/stasis_indexer/args.h b/src/cli/stasis_indexer/args.h deleted file mode 100644 index 543aa4b..0000000 --- a/src/cli/stasis_indexer/args.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef STASIS_ARGS_H -#define STASIS_ARGS_H - -#include - -extern struct option long_options[]; -void usage(char *name); - -#endif //STASIS_ARGS_H diff --git a/src/cli/stasis_indexer/callbacks.h b/src/cli/stasis_indexer/callbacks.h deleted file mode 100644 index 7d95cbb..0000000 --- a/src/cli/stasis_indexer/callbacks.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef CALLBACKS_H -#define CALLBACKS_H - -#include "delivery.h" - -int callback_sort_deliveries_cmpfn(const void *a, const void *b); -int callback_sort_deliveries_dynamic_cmpfn(const void *a, const void *b); - -#endif //CALLBACKS_H diff --git a/src/cli/stasis_indexer/helpers.h b/src/cli/stasis_indexer/helpers.h deleted file mode 100644 index d493f75..0000000 --- a/src/cli/stasis_indexer/helpers.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef HELPERS_H -#define HELPERS_H - -#include "delivery.h" - -#define ARRAY_COUNT_DYNAMIC(X, COUNTER) \ - do { \ - for (COUNTER = 0; X && X[COUNTER] != NULL; COUNTER++) {} \ - } while(0) - -#define ARRAY_COUNT_BY_STRUCT_MEMBER(X, MEMBER, COUNTER) \ - do { \ - for (COUNTER = 0; X[COUNTER].MEMBER != NULL; COUNTER++) {} \ - } while(0) - -struct StrList *get_architectures(struct Delivery ctx[], size_t nelem); -struct StrList *get_platforms(struct Delivery ctx[], size_t nelem); -int get_pandoc_version(size_t *result); -int pandoc_exec(const char *in_file, const char *out_file, const char *css_file, const char *title); -int get_latest_rc(struct Delivery ctx[], size_t nelem); -struct Delivery *get_latest_deliveries(struct Delivery ctx[], size_t nelem); -int get_files(struct StrList **out, const char *path, const char *pattern, ...); -struct StrList *get_docker_images(struct Delivery *ctx, char *pattern); -int load_metadata(struct Delivery *ctx, const char *filename); -int micromamba_configure(const struct Delivery *ctx, struct MicromambaInfo *m); - -#endif //HELPERS_H diff --git a/src/cli/stasis_indexer/include/args.h b/src/cli/stasis_indexer/include/args.h new file mode 100644 index 0000000..543aa4b --- /dev/null +++ b/src/cli/stasis_indexer/include/args.h @@ -0,0 +1,9 @@ +#ifndef STASIS_ARGS_H +#define STASIS_ARGS_H + +#include + +extern struct option long_options[]; +void usage(char *name); + +#endif //STASIS_ARGS_H diff --git a/src/cli/stasis_indexer/include/callbacks.h b/src/cli/stasis_indexer/include/callbacks.h new file mode 100644 index 0000000..7d95cbb --- /dev/null +++ b/src/cli/stasis_indexer/include/callbacks.h @@ -0,0 +1,9 @@ +#ifndef CALLBACKS_H +#define CALLBACKS_H + +#include "delivery.h" + +int callback_sort_deliveries_cmpfn(const void *a, const void *b); +int callback_sort_deliveries_dynamic_cmpfn(const void *a, const void *b); + +#endif //CALLBACKS_H diff --git a/src/cli/stasis_indexer/include/helpers.h b/src/cli/stasis_indexer/include/helpers.h new file mode 100644 index 0000000..d493f75 --- /dev/null +++ b/src/cli/stasis_indexer/include/helpers.h @@ -0,0 +1,27 @@ +#ifndef HELPERS_H +#define HELPERS_H + +#include "delivery.h" + +#define ARRAY_COUNT_DYNAMIC(X, COUNTER) \ + do { \ + for (COUNTER = 0; X && X[COUNTER] != NULL; COUNTER++) {} \ + } while(0) + +#define ARRAY_COUNT_BY_STRUCT_MEMBER(X, MEMBER, COUNTER) \ + do { \ + for (COUNTER = 0; X[COUNTER].MEMBER != NULL; COUNTER++) {} \ + } while(0) + +struct StrList *get_architectures(struct Delivery ctx[], size_t nelem); +struct StrList *get_platforms(struct Delivery ctx[], size_t nelem); +int get_pandoc_version(size_t *result); +int pandoc_exec(const char *in_file, const char *out_file, const char *css_file, const char *title); +int get_latest_rc(struct Delivery ctx[], size_t nelem); +struct Delivery *get_latest_deliveries(struct Delivery ctx[], size_t nelem); +int get_files(struct StrList **out, const char *path, const char *pattern, ...); +struct StrList *get_docker_images(struct Delivery *ctx, char *pattern); +int load_metadata(struct Delivery *ctx, const char *filename); +int micromamba_configure(const struct Delivery *ctx, struct MicromambaInfo *m); + +#endif //HELPERS_H diff --git a/src/cli/stasis_indexer/include/junitxml_report.h b/src/cli/stasis_indexer/include/junitxml_report.h new file mode 100644 index 0000000..6d2a248 --- /dev/null +++ b/src/cli/stasis_indexer/include/junitxml_report.h @@ -0,0 +1,8 @@ +#ifndef JUNITXML_REPORT_H +#define JUNITXML_REPORT_H + +#include "helpers.h" + +int indexer_junitxml_report(struct Delivery ctx[], size_t nelem); + +#endif //JUNITXML_REPORT_H diff --git a/src/cli/stasis_indexer/include/readmes.h b/src/cli/stasis_indexer/include/readmes.h new file mode 100644 index 0000000..d4fa7ac --- /dev/null +++ b/src/cli/stasis_indexer/include/readmes.h @@ -0,0 +1,8 @@ +#ifndef READMES_H +#define READMES_H + +#include "helpers.h" + +int indexer_readmes(struct Delivery ctx[], size_t nelem); + +#endif //READMES_H diff --git a/src/cli/stasis_indexer/include/website.h b/src/cli/stasis_indexer/include/website.h new file mode 100644 index 0000000..e67d58b --- /dev/null +++ b/src/cli/stasis_indexer/include/website.h @@ -0,0 +1,8 @@ +#ifndef WEBSITE_H +#define WEBSITE_H + +#include "helpers.h" + +int indexer_make_website(const struct Delivery *ctx); + +#endif //WEBSITE_H diff --git a/src/cli/stasis_indexer/junitxml_report.h b/src/cli/stasis_indexer/junitxml_report.h deleted file mode 100644 index 6d2a248..0000000 --- a/src/cli/stasis_indexer/junitxml_report.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef JUNITXML_REPORT_H -#define JUNITXML_REPORT_H - -#include "helpers.h" - -int indexer_junitxml_report(struct Delivery ctx[], size_t nelem); - -#endif //JUNITXML_REPORT_H diff --git a/src/cli/stasis_indexer/readmes.h b/src/cli/stasis_indexer/readmes.h deleted file mode 100644 index d4fa7ac..0000000 --- a/src/cli/stasis_indexer/readmes.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef READMES_H -#define READMES_H - -#include "helpers.h" - -int indexer_readmes(struct Delivery ctx[], size_t nelem); - -#endif //READMES_H diff --git a/src/cli/stasis_indexer/website.h b/src/cli/stasis_indexer/website.h deleted file mode 100644 index e67d58b..0000000 --- a/src/cli/stasis_indexer/website.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef WEBSITE_H -#define WEBSITE_H - -#include "helpers.h" - -int indexer_make_website(const struct Delivery *ctx); - -#endif //WEBSITE_H -- cgit