-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When switching between normal build and running tests it takes a while for modules to be rebuilt. With the beam-cache the files are saved and can be restored when switching between contexts. This greatly speeds up the context switching.
- Loading branch information
Showing
5 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (c) 2024, Loïc Hoguin <[email protected]> | ||
# This file is part of erlang.mk and subject to the terms of the ISC License. | ||
|
||
.PHONY: beam-cache-restore-app beam-cache-restore-test clean-beam-cache distclean-beam-cache | ||
|
||
BEAM_CACHE_DIR ?= $(ERLANG_MK_TMP)/beam-cache | ||
PROJECT_BEAM_CACHE_DIR = $(BEAM_CACHE_DIR)/$(PROJECT) | ||
|
||
clean:: clean-beam-cache | ||
|
||
clean-beam-cache: | ||
$(verbose) rm -rf $(PROJECT_BEAM_CACHE_DIR) | ||
|
||
distclean:: distclean-beam-cache | ||
|
||
$(PROJECT_BEAM_CACHE_DIR): | ||
$(verbose) mkdir -p $(PROJECT_BEAM_CACHE_DIR) | ||
|
||
distclean-beam-cache: | ||
$(gen_verbose) rm -rf $(BEAM_CACHE_DIR) | ||
|
||
beam-cache-restore-app: | $(PROJECT_BEAM_CACHE_DIR) | ||
$(verbose) rm -rf $(PROJECT_BEAM_CACHE_DIR)/ebin-test | ||
ifneq ($(wildcard ebin/),) | ||
$(verbose) mv ebin/ $(PROJECT_BEAM_CACHE_DIR)/ebin-test | ||
endif | ||
ifneq ($(wildcard $(PROJECT_BEAM_CACHE_DIR)/ebin-app),) | ||
$(gen_verbose) mv $(PROJECT_BEAM_CACHE_DIR)/ebin-app ebin/ | ||
else | ||
$(verbose) $(MAKE) --no-print-directory clean-app | ||
endif | ||
|
||
beam-cache-restore-test: | $(PROJECT_BEAM_CACHE_DIR) | ||
$(verbose) rm -rf $(PROJECT_BEAM_CACHE_DIR)/ebin-app | ||
ifneq ($(wildcard ebin/),) | ||
$(verbose) mv ebin/ $(PROJECT_BEAM_CACHE_DIR)/ebin-app | ||
endif | ||
ifneq ($(wildcard $(PROJECT_BEAM_CACHE_DIR)/ebin-test),) | ||
$(gen_verbose) mv $(PROJECT_BEAM_CACHE_DIR)/ebin-test ebin/ | ||
else | ||
$(verbose) $(MAKE) --no-print-directory clean-app | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters