aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt47
-rw-r--r--src/cli/CMakeLists.txt2
-rw-r--r--src/cli/stasis/CMakeLists.txt7
-rw-r--r--src/cli/stasis/stasis_main.c (renamed from src/stasis_main.c)3
-rw-r--r--src/cli/stasis_indexer/CMakeLists.txt6
-rw-r--r--src/cli/stasis_indexer/stasis_indexer.c (renamed from src/stasis_indexer.c)3
-rw-r--r--src/lib/CMakeLists.txt1
-rw-r--r--src/lib/core/CMakeLists.txt38
-rw-r--r--src/lib/core/artifactory.c (renamed from src/artifactory.c)2
-rw-r--r--src/lib/core/conda.c (renamed from src/conda.c)1
-rw-r--r--src/lib/core/copy.c (renamed from src/copy.c)0
-rw-r--r--src/lib/core/delivery.c (renamed from src/delivery.c)2
-rw-r--r--src/lib/core/delivery_artifactory.c (renamed from src/delivery_artifactory.c)0
-rw-r--r--src/lib/core/delivery_build.c (renamed from src/delivery_build.c)1
-rw-r--r--src/lib/core/delivery_conda.c (renamed from src/delivery_conda.c)0
-rw-r--r--src/lib/core/delivery_docker.c (renamed from src/delivery_docker.c)0
-rw-r--r--src/lib/core/delivery_init.c (renamed from src/delivery_init.c)0
-rw-r--r--src/lib/core/delivery_install.c (renamed from src/delivery_install.c)0
-rw-r--r--src/lib/core/delivery_populate.c (renamed from src/delivery_populate.c)0
-rw-r--r--src/lib/core/delivery_postprocess.c (renamed from src/delivery_postprocess.c)0
-rw-r--r--src/lib/core/delivery_show.c (renamed from src/delivery_show.c)0
-rw-r--r--src/lib/core/delivery_test.c (renamed from src/delivery_test.c)0
-rw-r--r--src/lib/core/docker.c (renamed from src/docker.c)1
-rw-r--r--src/lib/core/download.c (renamed from src/download.c)2
-rw-r--r--src/lib/core/envctl.c (renamed from src/envctl.c)1
-rw-r--r--src/lib/core/environment.c (renamed from src/environment.c)0
-rw-r--r--src/lib/core/github.c (renamed from src/github.c)1
-rw-r--r--src/lib/core/globals.c (renamed from src/globals.c)1
-rw-r--r--src/lib/core/ini.c (renamed from src/ini.c)0
-rw-r--r--src/lib/core/junitxml.c (renamed from src/junitxml.c)0
-rw-r--r--src/lib/core/multiprocessing.c (renamed from src/multiprocessing.c)1
-rw-r--r--src/lib/core/recipe.c (renamed from src/recipe.c)0
-rw-r--r--src/lib/core/relocation.c (renamed from src/relocation.c)0
-rw-r--r--src/lib/core/rules.c (renamed from src/rules.c)0
-rw-r--r--src/lib/core/str.c (renamed from src/str.c)0
-rw-r--r--src/lib/core/strlist.c (renamed from src/strlist.c)1
-rw-r--r--src/lib/core/system.c (renamed from src/system.c)0
-rw-r--r--src/lib/core/template.c (renamed from src/template.c)0
-rw-r--r--src/lib/core/template_func_proto.c (renamed from src/template_func_proto.c)2
-rw-r--r--src/lib/core/utils.c (renamed from src/utils.c)1
-rw-r--r--src/lib/core/wheel.c (renamed from src/wheel.c)0
41 files changed, 70 insertions, 54 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5c5bc6e..bfee276 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -2,49 +2,6 @@ include_directories(${CMAKE_BINARY_DIR}/include)
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${PROJECT_BINARY_DIR})
-add_library(stasis_core STATIC
- globals.c
- str.c
- strlist.c
- ini.c
- conda.c
- environment.c
- utils.c
- system.c
- download.c
- delivery_postprocess.c
- delivery_conda.c
- delivery_docker.c
- delivery_install.c
- delivery_artifactory.c
- delivery_test.c
- delivery_build.c
- delivery_show.c
- delivery_populate.c
- delivery_init.c
- delivery.c
- recipe.c
- relocation.c
- wheel.c
- copy.c
- artifactory.c
- template.c
- rules.c
- docker.c
- junitxml.c
- github.c
- template_func_proto.c
- envctl.c
- multiprocessing.c
-)
+add_subdirectory(lib)
+add_subdirectory(cli)
-add_executable(stasis
- stasis_main.c
-)
-target_link_libraries(stasis PRIVATE stasis_core)
-target_link_libraries(stasis PUBLIC LibXml2::LibXml2)
-add_executable(stasis_indexer
- stasis_indexer.c
-)
-target_link_libraries(stasis_indexer PRIVATE stasis_core)
-install(TARGETS stasis stasis_indexer RUNTIME)
diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt
new file mode 100644
index 0000000..92a21b7
--- /dev/null
+++ b/src/cli/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(stasis)
+add_subdirectory(stasis_indexer) \ No newline at end of file
diff --git a/src/cli/stasis/CMakeLists.txt b/src/cli/stasis/CMakeLists.txt
new file mode 100644
index 0000000..3766f6d
--- /dev/null
+++ b/src/cli/stasis/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_executable(stasis
+ stasis_main.c
+)
+target_link_libraries(stasis PRIVATE stasis_core)
+target_link_libraries(stasis PUBLIC LibXml2::LibXml2)
+
+install(TARGETS stasis RUNTIME)
diff --git a/src/stasis_main.c b/src/cli/stasis/stasis_main.c
index eecc419..75482c5 100644
--- a/src/stasis_main.c
+++ b/src/cli/stasis/stasis_main.c
@@ -4,6 +4,9 @@
#include <limits.h>
#include <getopt.h>
#include "core.h"
+#include "envctl.h"
+#include "delivery.h"
+#include "template_func_proto.h"
#define OPT_ALWAYS_UPDATE_BASE 1000
#define OPT_NO_DOCKER 1001
diff --git a/src/cli/stasis_indexer/CMakeLists.txt b/src/cli/stasis_indexer/CMakeLists.txt
new file mode 100644
index 0000000..eae1394
--- /dev/null
+++ b/src/cli/stasis_indexer/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_executable(stasis_indexer
+ stasis_indexer.c
+)
+target_link_libraries(stasis_indexer PRIVATE stasis_core)
+
+install(TARGETS stasis_indexer RUNTIME)
diff --git a/src/stasis_indexer.c b/src/cli/stasis_indexer/stasis_indexer.c
index 05b9e39..bd59920 100644
--- a/src/stasis_indexer.c
+++ b/src/cli/stasis_indexer/stasis_indexer.c
@@ -1,6 +1,7 @@
#include <getopt.h>
#include <fnmatch.h>
-#include "core.h"
+#include "delivery.h"
+#include "junitxml.h"
static struct option long_options[] = {
{"help", no_argument, 0, 'h'},
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
new file mode 100644
index 0000000..82bfe4a
--- /dev/null
+++ b/src/lib/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(core) \ No newline at end of file
diff --git a/src/lib/core/CMakeLists.txt b/src/lib/core/CMakeLists.txt
new file mode 100644
index 0000000..c569187
--- /dev/null
+++ b/src/lib/core/CMakeLists.txt
@@ -0,0 +1,38 @@
+include_directories(${PROJECT_BINARY_DIR})
+
+add_library(stasis_core STATIC
+ globals.c
+ str.c
+ strlist.c
+ ini.c
+ conda.c
+ environment.c
+ utils.c
+ system.c
+ download.c
+ delivery_postprocess.c
+ delivery_conda.c
+ delivery_docker.c
+ delivery_install.c
+ delivery_artifactory.c
+ delivery_test.c
+ delivery_build.c
+ delivery_show.c
+ delivery_populate.c
+ delivery_init.c
+ delivery.c
+ recipe.c
+ relocation.c
+ wheel.c
+ copy.c
+ artifactory.c
+ template.c
+ rules.c
+ docker.c
+ junitxml.c
+ github.c
+ template_func_proto.c
+ envctl.c
+ multiprocessing.c
+)
+
diff --git a/src/artifactory.c b/src/lib/core/artifactory.c
index 6c4079a..6b9635d 100644
--- a/src/artifactory.c
+++ b/src/lib/core/artifactory.c
@@ -1,4 +1,4 @@
-#include "core.h"
+#include "artifactory.h"
extern struct STASIS_GLOBAL globals;
diff --git a/src/conda.c b/src/lib/core/conda.c
index e60abc7..35caf02 100644
--- a/src/conda.c
+++ b/src/lib/core/conda.c
@@ -2,7 +2,6 @@
// Created by jhunk on 5/14/23.
//
-#include <unistd.h>
#include "conda.h"
int micromamba(struct MicromambaInfo *info, char *command, ...) {
diff --git a/src/copy.c b/src/lib/core/copy.c
index f69a756..f69a756 100644
--- a/src/copy.c
+++ b/src/lib/core/copy.c
diff --git a/src/delivery.c b/src/lib/core/delivery.c
index 07e04c8..e32ed4c 100644
--- a/src/delivery.c
+++ b/src/lib/core/delivery.c
@@ -1,4 +1,4 @@
-#include "core.h"
+#include "delivery.h"
void delivery_free(struct Delivery *ctx) {
guard_free(ctx->system.arch);
diff --git a/src/delivery_artifactory.c b/src/lib/core/delivery_artifactory.c
index 27f4823..27f4823 100644
--- a/src/delivery_artifactory.c
+++ b/src/lib/core/delivery_artifactory.c
diff --git a/src/delivery_build.c b/src/lib/core/delivery_build.c
index 3777a4c..b4d610a 100644
--- a/src/delivery_build.c
+++ b/src/lib/core/delivery_build.c
@@ -1,4 +1,3 @@
-#include <fnmatch.h>
#include "delivery.h"
int delivery_build_recipes(struct Delivery *ctx) {
diff --git a/src/delivery_conda.c b/src/lib/core/delivery_conda.c
index 93a06fc..93a06fc 100644
--- a/src/delivery_conda.c
+++ b/src/lib/core/delivery_conda.c
diff --git a/src/delivery_docker.c b/src/lib/core/delivery_docker.c
index e1d7f60..e1d7f60 100644
--- a/src/delivery_docker.c
+++ b/src/lib/core/delivery_docker.c
diff --git a/src/delivery_init.c b/src/lib/core/delivery_init.c
index e914f99..e914f99 100644
--- a/src/delivery_init.c
+++ b/src/lib/core/delivery_init.c
diff --git a/src/delivery_install.c b/src/lib/core/delivery_install.c
index 76c3f4a..76c3f4a 100644
--- a/src/delivery_install.c
+++ b/src/lib/core/delivery_install.c
diff --git a/src/delivery_populate.c b/src/lib/core/delivery_populate.c
index b37f677..b37f677 100644
--- a/src/delivery_populate.c
+++ b/src/lib/core/delivery_populate.c
diff --git a/src/delivery_postprocess.c b/src/lib/core/delivery_postprocess.c
index 1a902e3..1a902e3 100644
--- a/src/delivery_postprocess.c
+++ b/src/lib/core/delivery_postprocess.c
diff --git a/src/delivery_show.c b/src/lib/core/delivery_show.c
index adfa1be..adfa1be 100644
--- a/src/delivery_show.c
+++ b/src/lib/core/delivery_show.c
diff --git a/src/delivery_test.c b/src/lib/core/delivery_test.c
index cb78f64..cb78f64 100644
--- a/src/delivery_test.c
+++ b/src/lib/core/delivery_test.c
diff --git a/src/docker.c b/src/lib/core/docker.c
index 2d5e2cc..5834ef9 100644
--- a/src/docker.c
+++ b/src/lib/core/docker.c
@@ -1,4 +1,3 @@
-#include "core.h"
#include "docker.h"
diff --git a/src/download.c b/src/lib/core/download.c
index f83adda..bfb323e 100644
--- a/src/download.c
+++ b/src/lib/core/download.c
@@ -2,8 +2,6 @@
// Created by jhunk on 10/5/23.
//
-#include <string.h>
-#include <stdlib.h>
#include "download.h"
size_t download_writer(void *fp, size_t size, size_t nmemb, void *stream) {
diff --git a/src/envctl.c b/src/lib/core/envctl.c
index 78dd760..9037d9d 100644
--- a/src/envctl.c
+++ b/src/lib/core/envctl.c
@@ -1,5 +1,4 @@
#include "envctl.h"
-#include "core.h"
struct EnvCtl *envctl_init() {
struct EnvCtl *result;
diff --git a/src/environment.c b/src/lib/core/environment.c
index 580062c..580062c 100644
--- a/src/environment.c
+++ b/src/lib/core/environment.c
diff --git a/src/github.c b/src/lib/core/github.c
index 36e2e7c..c5e4534 100644
--- a/src/github.c
+++ b/src/lib/core/github.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include "core.h"
+#include "github.h"
struct GHContent {
char *data;
diff --git a/src/globals.c b/src/lib/core/globals.c
index 1b682cb..83465f1 100644
--- a/src/globals.c
+++ b/src/lib/core/globals.c
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include "core.h"
+#include "envctl.h"
const char *VERSION = "1.0.0";
const char *AUTHOR = "Joseph Hunkeler";
diff --git a/src/ini.c b/src/lib/core/ini.c
index d44e1cc..d44e1cc 100644
--- a/src/ini.c
+++ b/src/lib/core/ini.c
diff --git a/src/junitxml.c b/src/lib/core/junitxml.c
index c7d0834..c7d0834 100644
--- a/src/junitxml.c
+++ b/src/lib/core/junitxml.c
diff --git a/src/multiprocessing.c b/src/lib/core/multiprocessing.c
index 2a1b350..484c566 100644
--- a/src/multiprocessing.c
+++ b/src/lib/core/multiprocessing.c
@@ -1,4 +1,5 @@
#include "core.h"
+#include "multiprocessing.h"
/// The sum of all tasks started by mp_task()
size_t mp_global_task_count = 0;
diff --git a/src/recipe.c b/src/lib/core/recipe.c
index 833908c..833908c 100644
--- a/src/recipe.c
+++ b/src/lib/core/recipe.c
diff --git a/src/relocation.c b/src/lib/core/relocation.c
index 852aca4..852aca4 100644
--- a/src/relocation.c
+++ b/src/lib/core/relocation.c
diff --git a/src/rules.c b/src/lib/core/rules.c
index e42ee07..e42ee07 100644
--- a/src/rules.c
+++ b/src/lib/core/rules.c
diff --git a/src/str.c b/src/lib/core/str.c
index 868a6c7..868a6c7 100644
--- a/src/str.c
+++ b/src/lib/core/str.c
diff --git a/src/strlist.c b/src/lib/core/strlist.c
index 7a045f1..f0bffa8 100644
--- a/src/strlist.c
+++ b/src/lib/core/strlist.c
@@ -2,6 +2,7 @@
* String array convenience functions
* @file strlist.c
*/
+#include "download.h"
#include "strlist.h"
#include "utils.h"
diff --git a/src/system.c b/src/lib/core/system.c
index 4e605ec..4e605ec 100644
--- a/src/system.c
+++ b/src/lib/core/system.c
diff --git a/src/template.c b/src/lib/core/template.c
index a412fa8..a412fa8 100644
--- a/src/template.c
+++ b/src/lib/core/template.c
diff --git a/src/template_func_proto.c b/src/lib/core/template_func_proto.c
index 9c325bb..3305b4d 100644
--- a/src/template_func_proto.c
+++ b/src/lib/core/template_func_proto.c
@@ -1,4 +1,6 @@
#include "template_func_proto.h"
+#include "delivery.h"
+#include "github.h"
int get_github_release_notes_tplfunc_entrypoint(void *frame, void *data_out) {
int result;
diff --git a/src/utils.c b/src/lib/core/utils.c
index 6381cea..89950df 100644
--- a/src/utils.c
+++ b/src/lib/core/utils.c
@@ -1,5 +1,6 @@
#include <stdarg.h>
#include "core.h"
+#include "utils.h"
char *dirstack[STASIS_DIRSTACK_MAX];
const ssize_t dirstack_max = sizeof(dirstack) / sizeof(dirstack[0]);
diff --git a/src/wheel.c b/src/lib/core/wheel.c
index 4692d0a..4692d0a 100644
--- a/src/wheel.c
+++ b/src/lib/core/wheel.c