From eacb9308a7266dcb169b5372cbfa122ed71baf11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Sat, 15 Jul 2023 10:07:15 +0200 Subject: [PATCH 1/3] Utilize shards' `executables` There's no need for copying the executables manually (which happens in both makefile targets `bin` and `run_file`). Shards' `executables` takes care of that. The makefile targets could potentially be dropped as well, I don't think there would be other uses case for those. --- shard.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shard.yml b/shard.yml index 5fa36b7a0..9178a182b 100644 --- a/shard.yml +++ b/shard.yml @@ -10,10 +10,11 @@ targets: scripts: # TODO: remove pre-compiled executable in future releases - postinstall: make bin && make run_file + postinstall: make build executables: - ameba + - ameba.cr crystal: "~> 1.7.0" From 15ce5437d13f47e023778e3be2a78e55759c263b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Sat, 15 Jul 2023 10:10:42 +0200 Subject: [PATCH 2/3] Make `postinstall` portable Using `shards build` directly instead of `make build` improves portability a lot. This should basically "just work" almost anywhere (including Windows). No need for `make` to be available and makefile compatibility doesn't matter either. --- shard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shard.yml b/shard.yml index 9178a182b..b2f1f6519 100644 --- a/shard.yml +++ b/shard.yml @@ -10,7 +10,7 @@ targets: scripts: # TODO: remove pre-compiled executable in future releases - postinstall: make build + postinstall: shards build -Dpreview_mt executables: - ameba From efa9c9dba0795bfc9e4dfb2fc9cb9958ac2ff398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Sat, 15 Jul 2023 22:47:14 +0200 Subject: [PATCH 3/3] Makefile: Remove `run_file` target --- Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile b/Makefile index f59b75f35..a34f0be64 100644 --- a/Makefile +++ b/Makefile @@ -30,9 +30,5 @@ bin: build mkdir -p $(SHARD_BIN) cp ./bin/ameba $(SHARD_BIN) -.PHONY: run_file -run_file: - cp -n ./bin/ameba.cr $(SHARD_BIN) || true - .PHONY: test test: spec lint