aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-project
diff options
context:
space:
mode:
authorBob Tolbert <bob@eyesopen.com>2025-08-11 14:47:42 -0500
committerCalvin Rose <calsrose@gmail.com>2025-08-13 17:09:03 -0500
commit6f189ab0458075ac23f0d3306c8e9c870829ffe2 (patch)
treee43f42ab2b09820e41f4af9c4e416d273c317a3f /test-project
parentBrief: Fix use of `distinct` on macOS lflags with -framework (diff)
Brief: add more pre/post steps for janet-pm building
Adding these extra steps allows more user control of the build process for complicated builds, including pre/post steps for build, install, test and clean. This also fixes #225, so that prebuild is only run before build. Also removes redundant calls to build in the install hook since Janet's core install hook calls build first as well. Having this in spork too resulted in two calls to build when `janet-pm install` was run.
Diffstat (limited to 'test-project')
-rw-r--r--test-project/hello/init.janet2
-rw-r--r--test-project/project.janet44
-rw-r--r--test-project/test/test-hello.janet3
3 files changed, 49 insertions, 0 deletions
diff --git a/test-project/hello/init.janet b/test-project/hello/init.janet
new file mode 100644
index 0000000..bcbc349
--- /dev/null
+++ b/test-project/hello/init.janet
@@ -0,0 +1,2 @@
+(defn hello [arg]
+ (string/format "hello %s" arg)) \ No newline at end of file
diff --git a/test-project/project.janet b/test-project/project.janet
new file mode 100644
index 0000000..bce0aa8
--- /dev/null
+++ b/test-project/project.janet
@@ -0,0 +1,44 @@
+(declare-project
+ :name "test-project"
+ :description "Janet project to test pre/post steps"
+ :version "0.0.1"
+ :dependencies [])
+
+(declare-source
+ :source @["hello"])
+
+(task "pre-build" ["pre-build-test"])
+(task "post-build" ["post-build-test"])
+
+(task "pre-check" ["pre-check-test"])
+(task "post-check" ["post-check-test"])
+
+(task "pre-install" ["pre-install-test"])
+(task "post-install" ["post-install-test"])
+
+(task "pre-clean" ["pre-clean-test"])
+(task "post-clean" ["post-clean-test"])
+
+(task "pre-build-test" []
+ (printf "****** pre-build"))
+
+(task "post-build-test" []
+ (printf "****** post-build"))
+
+(task "pre-check-test" []
+ (printf "****** pre-check"))
+
+(task "post-check-test" []
+ (printf "****** post-check"))
+
+(task "pre-install-test" []
+ (printf "****** pre-install"))
+
+(task "post-install-test" []
+ (printf "****** post-install"))
+
+(task "pre-clean-test" []
+ (printf "****** pre-clean"))
+
+(task "post-clean-test" []
+ (printf "****** post-clean"))
diff --git a/test-project/test/test-hello.janet b/test-project/test/test-hello.janet
new file mode 100644
index 0000000..1316112
--- /dev/null
+++ b/test-project/test/test-hello.janet
@@ -0,0 +1,3 @@
+(import hello)
+
+(assert (= (hello/hello "tim") "hello tim"))