Browse Source

Replace dependency to Cask with a Makefile

workspaces
Nicolas Petton 3 years ago
parent
commit
6285031bc4
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
6 changed files with 51 additions and 71 deletions
  1. +4
    -7
      .gitlab-ci.yml
  2. +0
    -15
      Cask
  3. +47
    -0
      Makefile
  4. +0
    -38
      run-lint.el
  5. +0
    -2
      run-lint.sh
  6. +0
    -9
      run-tests.sh

+ 4
- 7
.gitlab-ci.yml View File

@ -1,23 +1,20 @@
image: nicolaspetton/emacs-docker:latest
image: nicolaspetton/emacs-nodejs-docker:latest
.prepare_job_template: &prepare_job_template
before_script:
- curl -sL https://deb.nodesource.com/setup_8.x | bash -
- apt-get install -y nodejs
- evm use $EMACS_VERSION
- emacs --version
- cask upgrade-cask
- cask install
- make ci-dependencies
.test_job_template: &test_job_definition
<<: *prepare_job_template
script:
- ./run-tests.sh
- make test
.lint_job_template: &lint_job_definition
<<: *prepare_job_template
script:
- ./run-lint.sh
- make lint
test:emacs:25.1:
variables:


+ 0
- 15
Cask View File

@ -1,15 +0,0 @@
(source gnu)
(source melpa)
(package-file "indium.el")
(depends-on "websocket")
(depends-on "company")
(development
(depends-on "undercover")
(depends-on "buttercup")
(depends-on "seq")
(depends-on "js2-mode")
(depends-on "assess")
(depends-on "exec-path-from-shell"))

+ 47
- 0
Makefile View File

@ -0,0 +1,47 @@
SRCS = indium*.el
LOAD_PATH = -L .
EMACSBIN ?= emacs
BATCH = $(EMACSBIN) -Q --batch $(LOAD_PATH) \
--eval "(setq load-prefer-newer t)" \
--eval "(require 'package)" \
--eval "(add-to-list 'package-archives '(\"melpa-stable\" . \"http://stable.melpa.org/packages/\"))" \
--funcall package-initialize
SILENCE-SOME-DEPRECATION = --load subr-x
SILENCE-SOME-DEPRECATION += --eval "(put 'when-let 'byte-obsolete-info nil)"
SILENCE-SOME-DEPRECATION += --eval "(put 'if-let 'byte-obsolete-info nil)"
.PHONY: all clean ci-dependencies check test lint
all: check
clean:
rm -f /tmp/undercover_coveralls_report
ci-dependencies:
# Install dependencies in ~/.emacs.d/elpa
$(BATCH) \
--funcall package-refresh-contents \
--eval "(package-install 'websocket)" \
--eval "(package-install 'company)" \
--eval "(package-install 'undercover)" \
--eval "(package-install 'buttercup)" \
--eval "(package-install 'js2-mode)" \
--eval "(package-install 'assess)" \
--eval "(package-install 'exec-path-from-shell)"
check: test lint
test:
TRAVIS=true $(BATCH) $(SILENCE-SOME-DEPRECATION) \
-l buttercup \
-l test/test-helper.el \
-f buttercup-run-discover
lint:
# Byte compile all and stop on any warning or error
$(BATCH) $(SILENCE-SOME-DEPRECATION) \
--eval "(setq byte-compile-error-on-warn t)" \
-f batch-byte-compile ${SRCS}

+ 0
- 38
run-lint.el View File

@ -1,38 +0,0 @@
;;; run-lint.el --- Lint project files -*- lexical-binding: t; -*-
;; Copyright (C) 2017-2018 Nicolas Petton
;; Author: Nicolas Petton <nicolas@petton.fr>
;; 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 <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Run checkdoc in batch mode on all project files.
;;; Code:
(require 'checkdoc)
(require 'seq)
(let ((files (seq-filter (lambda (file)
(string= (file-name-extension file) "el"))
(directory-files "."))))
(seq-doseq (file files)
(with-current-buffer (find-file file)
(message "Linting %s..." file)
(checkdoc-current-buffer))))
(provide 'run-lint)
;;; run-lint.el ends here

+ 0
- 2
run-lint.sh View File

@ -1,2 +0,0 @@
#!/bin/sh -e
cask emacs -batch -L . -l run-lint.el

+ 0
- 9
run-tests.sh View File

@ -1,9 +0,0 @@
#!/bin/sh
set -e
if [ -f /tmp/undercover_coveralls_report ]; then
rm /tmp/undercover_coveralls_report
fi
TRAVIS=true cask exec buttercup -l test/test-helper.el -L . "$@"

Loading…
Cancel
Save