build: add a 'app' build target which only compiles the code
but no release
This commit is contained in:
parent
fed931859a
commit
516c52bdc7
5
Makefile
5
Makefile
|
@ -140,6 +140,11 @@ COMMON_DEPS := $(REBAR)
|
||||||
$(REL_PROFILES:%=%): $(COMMON_DEPS)
|
$(REL_PROFILES:%=%): $(COMMON_DEPS)
|
||||||
@$(BUILD) $(@) rel
|
@$(BUILD) $(@) rel
|
||||||
|
|
||||||
|
.PHONY: compile $(PROFILES:%=compile-%)
|
||||||
|
compile: $(PROFILES:%=compile-%)
|
||||||
|
$(PROFILES:%=compile-%):
|
||||||
|
@$(BUILD) $(@:compile-%=%) apps
|
||||||
|
|
||||||
## Not calling rebar3 clean because
|
## Not calling rebar3 clean because
|
||||||
## 1. rebar3 clean relies on rebar3, meaning it reads config, fetches dependencies etc.
|
## 1. rebar3 clean relies on rebar3, meaning it reads config, fetches dependencies etc.
|
||||||
## 2. it's slow
|
## 2. it's slow
|
||||||
|
|
12
build
12
build
|
@ -124,16 +124,19 @@ assert_no_compile_time_only_deps() {
|
||||||
:
|
:
|
||||||
}
|
}
|
||||||
|
|
||||||
make_rel() {
|
just_compile() {
|
||||||
local release_or_tar="${1}"
|
|
||||||
./scripts/pre-compile.sh "$PROFILE"
|
./scripts/pre-compile.sh "$PROFILE"
|
||||||
# make_elixir_rel always create rebar.lock
|
# make_elixir_rel always create rebar.lock
|
||||||
# delete it to make git clone + checkout work because we use shallow close for rebar deps
|
# delete it to make git clone + checkout work because we use shallow close for rebar deps
|
||||||
rm -f rebar.lock
|
rm -f rebar.lock
|
||||||
# compile all beams
|
# compile all beams
|
||||||
./rebar3 as "$PROFILE" compile
|
./rebar3 as "$PROFILE" compile
|
||||||
# generate docs (require beam compiled), generated to etc and priv dirs
|
|
||||||
make_docs
|
make_docs
|
||||||
|
}
|
||||||
|
|
||||||
|
make_rel() {
|
||||||
|
local release_or_tar="${1}"
|
||||||
|
just_compile
|
||||||
# now assemble the release tar
|
# now assemble the release tar
|
||||||
./rebar3 as "$PROFILE" "$release_or_tar"
|
./rebar3 as "$PROFILE" "$release_or_tar"
|
||||||
assert_no_compile_time_only_deps
|
assert_no_compile_time_only_deps
|
||||||
|
@ -375,6 +378,9 @@ export_elixir_release_vars() {
|
||||||
log "building artifact=$ARTIFACT for profile=$PROFILE"
|
log "building artifact=$ARTIFACT for profile=$PROFILE"
|
||||||
|
|
||||||
case "$ARTIFACT" in
|
case "$ARTIFACT" in
|
||||||
|
apps)
|
||||||
|
just_compile
|
||||||
|
;;
|
||||||
doc|docs)
|
doc|docs)
|
||||||
make_docs
|
make_docs
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue