-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
72 lines (59 loc) · 2.55 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
export EMACS ?= $(shell which emacs)
.DEFAULT_GOAL := compile
CASK_DIR := $(shell cask package-directory)
.PHONY: cask
cask: $(CASK_DIR)
$(CASK_DIR): Cask
cask install
touch $(CASK_DIR)
.PHONY: schema
schema: language-server-protocol/_specifications/lsp/3.17/metaModel/metaModel.json
$(EMACS) -Q --batch -L . -l xlsp-utils -l pp --eval " \
(with-temp-buffer \
(save-excursion (insert-file-contents \"$^\")) \
(let ((alist (json-parse-buffer :object-type (quote alist) \
:null-object nil \
:false-object :json-false))) \
(dolist (entry alist) \
(cl-destructuring-bind (what . schema) \
entry \
(unless (memq what (quote (metaData))) \
(with-temp-file (format \"_%s.el\" (xlsp-hyphenate (symbol-name what))) \
(princ \";; -*- lexical-binding: t -*-\n\n\" (current-buffer)) \
(pp schema (current-buffer))))))))"
README.rst: README.in.rst xlsp.el
grep ';;' xlsp.el \
| awk '/;;;\s*Commentary/{within=1;next}/;;;\s*/{within=0}within' \
| sed -e 's/^\s*;;\s\?/ /g' \
| bash readme-sed.sh "COMMENTARY" README.in.rst > README.rst
.PHONY: clean
clean:
git clean -dfX
.PHONY: microsoft
microsoft:
git submodule add https://github.com/microsoft/language-server-protocol.git
.PHONY: compile
compile: cask
cask emacs -batch -L . -L tests \
--eval "(setq byte-compile-error-on-warn t)" \
-f batch-byte-compile $$(cask files) tests/test-*.el; \
(ret=$$? ; rm -f *.elc tests/*.elc && exit $$ret)
.PHONY: test
test: compile
2>&1 cask emacs -batch -L . -L tests -l test-xlsp -f ert-run-tests-batch | tee /tmp/xlsp.test.out
@! grep -q "unexpected results" /tmp/xlsp.test.out
.PHONY: dist-clean
dist-clean:
rm -rf dist
.PHONY: dist
dist: dist-clean
mkdir dist
cp -p $$(git ls-files *.el) dist
.PHONY: install
install: dist
$(EMACS) -Q --batch -f package-initialize \
--eval "(add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\"))" \
-f package-refresh-contents \
--eval "(ignore-errors (apply (function package-delete) (alist-get (quote xlsp) package-alist)))" \
--eval "(with-current-buffer (dired \"dist\") \
(package-install-from-buffer))"