-
Notifications
You must be signed in to change notification settings - Fork 110
/
Makefile
64 lines (53 loc) · 2.1 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
EMACS=$(shell which emacs) -Q -batch -L .
WORKDIR=/tmp/emacs_tide
export HOME := $(WORKDIR)
define ESCRIPT
(with-temp-buffer
(require 'pp)
(require 'subr-x)
(insert-file-contents "tide.el")
(while
(ignore-errors
(let ((sexp (read (current-buffer))))
(when sexp
(when (eq (car sexp) 'defcustom)
(unless (cadr (cddr sexp))
(princ (format "Documentation missing for defcustom %S\n" (cadr sexp)))
(kill-emacs 1))
(princ (format "##### %s `%s`\n\n%s\n\n" (cadr sexp) (string-trim (pp-to-string (car (cddr sexp)))) (replace-regexp-in-string "`\\([^ ]*\\)'" "`\\1`" (cadr (cddr sexp))))))
t)))))
endef
export ESCRIPT
setup:
cd .. && git clone [email protected]:Microsoft/TypeScript.git
update-tsserver:
cd ../TypeScript && npm install && gulp clean && gulp local
cd ../TypeScript/built/local && cp lib.*.d.ts tsserver.js typingsInstaller.js ../../../tide/tsserver
cd ../TypeScript && git reset --hard HEAD
cask:
cask build
test: cask
emacs --version
node --version
mkdir $(WORKDIR) || echo Already has workdir.
+ $(EMACS) -l tide-tests.el -f ert-run-tests-batch-and-exit
clean:
rm -rf *.elc
rm -rf $(WORKDIR)
.PHONY: doc test sandbox
doc:
cd doc && mermaid -c config.json architecture.mmd -w 940 -p
readme:
ruby -e 'puts IO.read("README.md").split("### Custom Variables")[0] + "### Custom Variables\n\n" + `emacs --batch --eval "$$ESCRIPT"`' | sponge README.md
sandbox:
rm -rf sandbox
mkdir sandbox
emacs -Q --debug \
--eval '(setq user-emacs-directory (file-truename "sandbox"))' \
-l package \
--eval "(add-to-list 'package-archives '(\"gnu\" . \"http://elpa.gnu.org/packages/\") t)" \
--eval "(add-to-list 'package-archives '(\"melpa\" . \"https://melpa.org/packages/\") t)" \
--eval "(package-refresh-contents)" \
--eval "(package-initialize)" \
--eval "(package-install 'tide)" \
--eval "(when (eq system-type 'darwin) (setq mac-option-key-is-meta nil mac-command-key-is-meta t mac-command-modifier 'meta mac-option-modifier 'none))"