Browse Source

Automatically add relx dependency on bootstrap-rel

Loïc Hoguin 3 years ago
parent
commit
099d602e82
2 changed files with 2 additions and 24 deletions
  1. 2 0
      plugins/bootstrap.mk
  2. 0 24
      test/plugin_relx.mk

+ 2 - 0
plugins/bootstrap.mk

@@ -451,6 +451,8 @@ endif
 	$(verbose) mkdir config/
 	$(verbose) $(call core_render,bs_sys_config,config/sys.config)
 	$(verbose) $(call core_render,bs_vm_args,config/vm.args)
+	$(verbose) sed '/^include erlang.mk/i BUILD_DEPS += relx' Makefile > Makefile.tmp
+	$(verbose) mv Makefile.tmp Makefile
 
 new-app:
 ifndef in

+ 0 - 24
test/plugin_relx.mk

@@ -22,9 +22,6 @@ relx-rel: init
 	$t cp ../erlang.mk $(APP)/
 	$t $(MAKE) -C $(APP) -f erlang.mk bootstrap bootstrap-rel $v
 
-	$i "Add Relx to the list of release dependencies"
-	$t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = relx\n"}' $(APP)/Makefile
-
 	$i "Build the release"
 	$t $(MAKE) -C $(APP) $v
 
@@ -60,9 +57,6 @@ relx-apps-with-deps: init
 	$t cp ../erlang.mk $(APP)/
 	$t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib bootstrap-rel $v
 
-	$i "Add Relx to the list of release dependencies"
-	$t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = relx\n"}' $(APP)/Makefile
-
 	$i "Create a new application my_app"
 	$t $(MAKE) -C $(APP) new-app in=my_app $v
 
@@ -97,9 +91,6 @@ relx-bare-rel: init
 	$t cp ../erlang.mk $(APP)/
 	$t $(MAKE) -C $(APP) -f erlang.mk bootstrap bootstrap-rel $v
 
-	$i "Add Relx to the list of release dependencies"
-	$t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = relx\n"}' $(APP)/Makefile
-
 	$i "Build the release"
 	$t $(MAKE) -C $(APP) rel $v
 
@@ -118,9 +109,6 @@ relx-post-rel: init
 	$t cp ../erlang.mk $(APP)/
 	$t $(MAKE) -C $(APP) -f erlang.mk bootstrap bootstrap-rel $v
 
-	$i "Add Relx to the list of release dependencies"
-	$t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = relx\n"}' $(APP)/Makefile
-
 	$i "Add relx-post-rel target to Makefile"
 	$t echo "relx-post-rel::" >> $(APP)/Makefile
 	$t echo "	echo test post rel > _rel/$(APP)_release/test_post_rel" >> $(APP)/Makefile
@@ -168,9 +156,6 @@ relx-relup: init
 	$t cp ../erlang.mk $(APP)/
 	$t $(MAKE) -C $(APP) -f erlang.mk bootstrap bootstrap-rel $v
 
-	$i "Add Relx to the list of release dependencies"
-	$t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = relx\n"}' $(APP)/Makefile
-
 	$i "Set the initial application version"
 ifeq ($(LEGACY),1)
 	$t sed -i.bak s/"{vsn, \"0.1.0\"}"/"{vsn, \"1\"}"/ $(APP)/src/$(APP).app.src
@@ -293,9 +278,6 @@ relx-start-stop: init
 	$t cp ../erlang.mk $(APP)/
 	$t $(MAKE) -C $(APP) -f erlang.mk bootstrap bootstrap-rel $v
 
-	$i "Add Relx to the list of release dependencies"
-	$t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = relx\n"}' $(APP)/Makefile
-
 	$i "Build the release"
 	$t $(MAKE) -C $(APP) $v
 
@@ -338,9 +320,6 @@ relx-tar: init
 	$t cp ../erlang.mk $(APP)/
 	$t $(MAKE) -C $(APP) -f erlang.mk bootstrap bootstrap-rel $v
 
-	$i "Add Relx to the list of release dependencies"
-	$t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = relx\n"}' $(APP)/Makefile
-
 	$i "Build the release without a tarball"
 	$t $(MAKE) -C $(APP) RELX_TAR=0 $v
 
@@ -360,9 +339,6 @@ relx-vsn: init
 	$t cp ../erlang.mk $(APP)/
 	$t $(MAKE) -C $(APP) -f erlang.mk bootstrap bootstrap-rel $v
 
-	$i "Add Relx to the list of release dependencies"
-	$t perl -ni.bak -e 'print;if ($$.==1) {print "REL_DEPS = relx\n"}' $(APP)/Makefile
-
 	$i "Replace the vsn"
 	$t sed -i.bak s/"\"1\""/"{cmd, \"printf 2\"}"/ $(APP)/relx.config