From e362ba0edb6b1219fe429bd77f415c594e8fa143 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 25 Apr 2022 01:30:42 +0800 Subject: [PATCH 1/5] Replace Cask with Eask --- .github/workflows/test.yml | 41 +++-------------------- .gitignore | 3 +- Cask | 12 ------- Eask | 26 +++++++++++++++ Makefile | 66 +++++++------------------------------- test/windows-bootstrap.el | 46 -------------------------- 6 files changed, 44 insertions(+), 150 deletions(-) delete mode 100644 Cask create mode 100644 Eask delete mode 100644 test/windows-bootstrap.el diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4b0333..b7c13a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,22 +14,18 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] emacs-version: - 26.3 - 27.1 - 27.2 + - 28.1 - snapshot steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: '3.6' - architecture: 'x64' - - - uses: purcell/setup-emacs@master + - uses: jcs090218/setup-emacs@master with: version: ${{ matrix.emacs-version }} @@ -37,34 +33,5 @@ jobs: run: | echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV - - uses: conao3/setup-cask@master - with: - version: 0.8.4 - - name: Run tests - run: 'make unix-ci' - - windows-test: - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - emacs-version: - - 26.3 - - 27.1 - - 27.2 - - snapshot - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-python@v2 - with: - python-version: '3.6' - architecture: 'x64' - - - uses: jcs090218/setup-emacs-windows@master - with: - version: ${{ matrix.emacs-version }} - - - name: Run tests - run: 'make windows-ci' + run: 'make ci' diff --git a/.gitignore b/.gitignore index 781f8c0..284d6ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -.cask +.eask +/dist *.elc tmp/ flycheck* diff --git a/Cask b/Cask deleted file mode 100644 index f7a3cda..0000000 --- a/Cask +++ /dev/null @@ -1,12 +0,0 @@ -(source gnu) -(source melpa) - -(package-file "lsp-dart.el") - -(development - (depends-on "f") - (depends-on "el-mock") - (depends-on "ert-runner") - (depends-on "undercover") - (depends-on "spinner") - (depends-on "dart-mode")) diff --git a/Eask b/Eask new file mode 100644 index 0000000..275ef46 --- /dev/null +++ b/Eask @@ -0,0 +1,26 @@ +(package "lsp-dart" + "1.21.0" + "Dart support lsp-mode") + +(package-file "lsp-dart.el") + +(files "lsp-dart-**.el") + +(source "gnu") +(source "melpa") + +(depends-on "emacs" "26.3") +(depends-on "lsp-treemacs") +(depends-on "lsp-mode") +(depends-on "dap-mode") +(depends-on "f") +(depends-on "dash") +(depends-on "dart-mode") + +(development + (depends-on "el-mock") + (depends-on "ert-runner") + (depends-on "undercover") + (depends-on "spinner")) + +(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 diff --git a/Makefile b/Makefile index 6342f33..f026617 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ SHELL=/usr/bin/env bash EMACS ?= emacs -CASK ?= cask +EASK ?= eask WINDOWS-INSTALL=-l test/windows-bootstrap.el @@ -23,71 +23,29 @@ ARCHIVES-INIT="(progn \ (setq package-archives '((\"melpa\" . \"https://melpa.org/packages/\") \ (\"gnu\" . \"http://elpa.gnu.org/packages/\"))))" -# NOTE: Bad request occurs during Cask installation on macOS in Emacs -# version 26.x. By setting variable `package-archives` manually resolved -# this issue. build: - @$(CASK) $(EMACS) -Q --batch \ - --eval $(ARCHIVES-INIT) - cask install + $(EASK) package + $(EASK) install - -unix-ci: WINDOWS-INSTALL= -unix-ci: clean build compile checkdoc lint unix-test - -windows-ci: CASK= -windows-ci: clean compile checkdoc lint windows-test +ci: clean build compile checkdoc lint test compile: @echo "Compiling..." - @$(CASK) $(EMACS) -Q --batch \ - $(WINDOWS-INSTALL) \ - -L . \ - --eval '(setq byte-compile-error-on-warn t)' \ - -f batch-byte-compile \ - *.el + $(EASK) compile checkdoc: - $(eval LOG := $(shell mktemp -d)/checklog.log) - @touch $(LOG) - - @echo "checking doc..." - - @for f in *.el ; do \ - $(CASK) $(EMACS) -Q --batch \ - -L . \ - --eval "(checkdoc-file \"$$f\")" \ - *.el 2>&1 | tee -a $(LOG); \ - done - - @if [ -s $(LOG) ]; then \ - echo ''; \ - exit 1; \ - else \ - echo 'checkdoc ok!'; \ - fi + $(EASK) checkdoc lint: @echo "package linting..." - @$(CASK) $(EMACS) -Q --batch \ - -L . \ - --eval $(INIT) \ - --eval $(LINT) \ - *.el - -unix-test: - @$(CASK) exec ert-runner + $(EASK) lint -windows-test: - @$(EMACS) -Q --batch \ - $(WINDOWS-INSTALL) \ - -L . \ - $(LOAD-TEST-FILES) \ - --eval "(ert-run-tests-batch-and-exit \ - '(and (not (tag no-win)) (not (tag org))))" +test: + $(EASK) install-deps --dev + $(EASK) ert clean: - rm -rf .cask *.elc + $(EASK) clean-all tag: $(eval TAG := $(filter-out $@,$(MAKECMDGOALS))) @@ -103,4 +61,4 @@ tag: %: @: -.PHONY : ci compile checkdoc lint unix-test windows-test clean tag +.PHONY : ci compile checkdoc lint test clean tag diff --git a/test/windows-bootstrap.el b/test/windows-bootstrap.el deleted file mode 100644 index 81e3d0b..0000000 --- a/test/windows-bootstrap.el +++ /dev/null @@ -1,46 +0,0 @@ -;;; windows-bootstrap.el --- Windows test bootstrap -*- lexical-binding: t; -*- -;; -;; Copyright (C) 2020-2021 emacs-lsp maintainers -;; -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . -;; -;;; Commentary: -;; -;; Windows test bootstrap -;; -;;; Code: - -(require 'package) - -(setq user-emacs-directory (expand-file-name (make-temp-name ".emacs.d") - "~") - package-user-dir (expand-file-name (make-temp-name "tmp-elpa") - user-emacs-directory)) - -(let* ((package-archives '(("melpa" . "https://melpa.org/packages/") - ("gnu" . "https://elpa.gnu.org/packages/"))) - (pkgs (append '(lsp-treemacs lsp-mode dap-mode f dash dart-mode) - '(el-mock ert-runner undercover spinner)))) - (package-initialize) - (package-refresh-contents) - - (mapc (lambda (pkg) - (unless (package-installed-p pkg) - (package-install pkg))) - pkgs) - - (add-hook 'kill-emacs-hook - `(lambda () (delete-directory ,user-emacs-directory t)))) - -;;; windows-bootstrap.el ends here From f398c8cb073e8fe1d3aeb599ec3a881930f3c546 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 25 Apr 2022 01:32:11 +0800 Subject: [PATCH 2/5] setup eask --- .github/workflows/test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7c13a4..91599a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,14 @@ jobs: with: version: ${{ matrix.emacs-version }} + - uses: actions/setup-node@v2 + with: + node-version: '14' + + - uses: emacs-eask/setup-eask@master + with: + version: 'snapshot' + - name: Set workaround env var run: | echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV From 3305f8e1207d23329b635f0b8f2535559d298fbc Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 25 Apr 2022 01:55:27 +0800 Subject: [PATCH 3/5] Fix exclude --- Eask | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eask b/Eask index 275ef46..7be8d0b 100644 --- a/Eask +++ b/Eask @@ -4,7 +4,7 @@ (package-file "lsp-dart.el") -(files "lsp-dart-**.el") +(files "*.el") (source "gnu") (source "melpa") From a5bb6cd43cd43ae81c3fe337e103d57b504cb4aa Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 25 Apr 2022 02:47:00 +0800 Subject: [PATCH 4/5] test --- Makefile | 2 +- lsp-dart-test-support.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f026617..793ed7a 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ lint: test: $(EASK) install-deps --dev - $(EASK) ert + $(EASK) ert ./test/*.el clean: $(EASK) clean-all diff --git a/lsp-dart-test-support.el b/lsp-dart-test-support.el index 65092f2..f5ba8d4 100644 --- a/lsp-dart-test-support.el +++ b/lsp-dart-test-support.el @@ -181,9 +181,9 @@ NOTIFICATION is the event notification.") "Spawn COMMAND with ARGS on a separated buffer." (lsp-dart-test--clean-process-buffer) (let ((process-buffer (get-buffer-create lsp-dart-test--process-buffer-name)) - (project-root (lsp-dart-get-project-root))) + (project-rt (lsp-dart-get-project-root))) (with-current-buffer process-buffer - (setq-local default-directory (or project-root default-directory)) + (setq-local default-directory (or project-rt default-directory)) (unless (derived-mode-p 'lsp-dart-test-process-mode) (lsp-dart-test-process-mode)) (apply #'make-comint-in-buffer lsp-dart-test--process-buffer-name process-buffer command nil args)))) From 263964a1c8169ba6dfa5e4042f611965ca2b2acf Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Mon, 25 Apr 2022 03:21:17 +0800 Subject: [PATCH 5/5] rename job to test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 91599a8..2eaf59c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ on: - master jobs: - unix-test: + test: runs-on: ${{ matrix.os }} strategy: fail-fast: false