branch: elpa/with-editor
commit f6021135f16b95847412c94e52b39d85967f2bfa
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
make: add bump-versions target
---
Makefile | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 52 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 84c1ec5..bceb36e 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@ ELS = with-editor.el
DEPS = dash
+TEXIPAGES = with-editor.texi
INFOPAGES = with-editor.info
ELCS = $(ELS:.el=.elc)
@@ -13,14 +14,23 @@ BATCH = $(EMACS) -batch -Q -L . $(EFLAGS)
MAKEINFO ?= makeinfo
INSTALL_INFO ?= $(shell command -v ginstall-info || printf install-info)
+WITH_EDITOR_VERSION = 2.5.1
+ASYNC_VERSION = 1.5
+DASH_VERSION = 2.12.1
+
.PHONY: help clean AUTHORS.md
help:
- $(info make all - compile elisp and manual)
- $(info make lisp - compile elisp)
- $(info make info - generate info manual)
- $(info make authors - generate AUTHORS.md)
- $(info make clean - remove generated files)
+ $(info make all - compile elisp and manual)
+ $(info make lisp - compile elisp)
+ $(info make info - generate info manual)
+ $(info make clean - remove generated files)
+ $(info )
+ $(info Release Managment)
+ $(info =================)
+ $(info )
+ $(info make authors - generate AUTHORS.md)
+ $(info make bump-versions - bump versions for release)
@printf "\n"
all: lisp info
@@ -32,6 +42,8 @@ lisp: $(ELCS)
--eval '(setq with-editor-emacsclient-executable nil)'\
-f batch-byte-compile $<
+texi: $(TEXIPAGES)
+
info: $(INFOPAGES) dir
%.info: %.texi
@printf "Generating $@\n"
@@ -53,3 +65,38 @@ AUTHORS.md:
clean:
@printf "Cleaning...\n"
@rm -f $(ELCS)
+
+define set_package_requires
+(require 'dash)
+(with-current-buffer (find-file-noselect "with-editor.el")
+ (goto-char (point-min))
+ (re-search-forward "^;; Package-Requires: ")
+ (let ((s (read (buffer-substring (point) (line-end-position)))))
+ (--when-let (assq 'async s) (setcdr it (list async-version)))
+ (--when-let (assq 'dash s) (setcdr it (list dash-version)))
+ (delete-region (point) (line-end-position))
+ (insert (format "%S" s))
+ (save-buffer)))
+endef
+export set_package_requires
+#'
+
+define set_manual_version
+(let ((version (split-string "$(WITH_EDITOR_VERSION)" "\\.")))
+ (setq version (concat (car version) "." (cadr version)))
+ (with-current-buffer (find-file-noselect "with-editor.org")
+ (goto-char (point-min))
+ (re-search-forward "^#\\+SUBTITLE: for version ")
+ (delete-region (point) (line-end-position))
+ (insert version)
+ (save-buffer)))
+endef
+export set_manual_version
+
+bump-versions: bump-versions-1 texi
+bump-versions-1:
+ @$(BATCH) --eval "(progn\
+ (setq async-version \"$(ASYNC_VERSION)\")\
+ (setq dash-version \"$(DASH_VERSION)\")\
+ $$set_package_requires\
+ $$set_manual_version)"