diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4b0333..2eaf59c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,62 +9,37 @@ on: - master jobs: - unix-test: + test: runs-on: ${{ matrix.os }} 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 + - uses: jcs090218/setup-emacs@master with: - python-version: '3.6' - architecture: 'x64' + version: ${{ matrix.emacs-version }} - - uses: purcell/setup-emacs@master + - uses: actions/setup-node@v2 with: - version: ${{ matrix.emacs-version }} + 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 - - 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..7be8d0b --- /dev/null +++ b/Eask @@ -0,0 +1,26 @@ +(package "lsp-dart" + "1.21.0" + "Dart support lsp-mode") + +(package-file "lsp-dart.el") + +(files "*.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..793ed7a 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 ./test/*.el 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/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)))) 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