diff --git a/Eldev b/Eldev index c7e302a..e8c6f83 100644 --- a/Eldev +++ b/Eldev @@ -6,3 +6,24 @@ ;(eldev-use-package-archive 'melpa) (eldev-use-plugin 'autoloads) + +(eldev-defcommand tag (tag) + "Make a new tag" + :parameters "TAG" + (unless tag + (signal 'eldev-wrong-command-usage)) + (let ((name "typewriter-roll-mode.el") + (buff (get-buffer-create "*output*"))) + (when (< 0 (call-process "git" nil buff nil "add" "-f" ".")) + (eldev-output (with-current-buffer buff (buffer-string))) + (error "Failed to add files")) + (when (< 0 (call-process "git" nil buff nil "stash")) + (eldev-output (with-current-buffer buff (buffer-string))) + (error "Failed to stash files")) + (with-temp-buffer + (insert-file-contents name) + (goto-char (point-min)) + (re-search-forward tag)) + (when (< 0 (call-process "git" nil buff nil "tag" tag "--sign")) + (eldev-output (with-current-buffer buff (buffer-string))) + (error "Failed to tag and sign")))) diff --git a/Makefile b/Makefile deleted file mode 100644 index 18189d0..0000000 --- a/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -EMACS := emacs - -.PHONY: all -all: byte-compile test - -.PHONY: clean -clean: - @-rm typewriter*.elc 2>/dev/null - @-rm *.ok 2>/dev/null - -%.elc: %.el - @-rm "$@" 2>/dev/null - @$(EMACS) --batch --quick \ - --directory . \ - --load compile-setup \ - --eval '(byte-compile-file "$(subst .elc,.el,$@)")' \ - && test -f "$@" - -byte-compile: \ - typewriter-roll-mode.elc \ - typewriter-roll-mode-tests.elc - -.PHONY: test -test: byte-compile main-tests - -typewriter-roll-mode-tests.ok: \ - typewriter-roll-mode.elc typewriter-roll-mode-tests.elc - $(EMACS) --batch --quick \ - --directory . \ - --load typewriter-roll-mode-tests.el \ - --funcall ert-run-tests-batch \ - && touch typewriter-roll-mode-tests.ok -main-tests: typewriter-roll-mode-tests.ok - -Makefile.ok: Makefile - @make -n all - @docker run \ - --network=none \ - --volume "$(PWD)"/Makefile:/Makefile \ - backplane/checkmake /Makefile -lint-makefile: Makefile.ok - -.PHONY: tag -tag: - $(MAKE) all - git add -f . && git stash - @grep ";; Version:" typewriter-roll-mode.el \ - | tee /dev/stderr | grep "$(TAG)" - @git tag "$(TAG)" --sign diff --git a/compile-setup b/compile-setup deleted file mode 100644 index 7793cea..0000000 --- a/compile-setup +++ /dev/null @@ -1,2 +0,0 @@ -;; because --eval X --eval Y doesn't work -(setq byte-compile-error-on-warn t)