Commit e4441c49 authored by Sebastian Wiesner's avatar Sebastian Wiesner

Use carton for dependency management

parent 3498bc87
......@@ -4,5 +4,6 @@ env:
- EMACS=emacs-snapshot
before_script:
- sh vagrant/provision.sh
- make deps
script:
- make EMACS=${EMACS} test
\ No newline at end of file
- make EMACS=${EMACS} CARTON=/opt/carton/bin/carton test
\ No newline at end of file
(source "melpa" "http://melpa.milkbox.net/packages/")
(package "flycheck" "0.6.1" "Flymake done right
Flycheck provides on-the-fly syntax checker with
- major-mode based checkers,
- simple declarative checker definitions,
- built-in checkers for many languages,
- standard error navigation,
- easy customization,
- and a clean, concise and understandable implementation.")
(depends-on "s" "1.3.1")
(depends-on "dash" "1.0.3")
;; Various modes for use in the unit tests
(development
(depends-on "coffee-mode")
(depends-on "haml-mode")
(depends-on "js2-mode")
(depends-on "js3-mode")
(depends-on "lua-mode")
(depends-on "cperl-mode")
(depends-on "php-mode")
(depends-on "php+-mode")
(depends-on "sass-mode"))
EMACS = emacs
EMACSFLAGS =
CARTON = carton
VAGRANT = vagrant
OBJECTS = flycheck.elc
.PHONY: deps
deps :
$(CARTON) install
$(CARTON) update
.PHONY: build
build : $(OBJECTS)
build : deps $(OBJECTS)
.PHONY: test
test : build
@$(EMACS) --no-site-file --no-site-lisp --batch $(EMACSFLAGS) \
-l dependencies.el -l tests/testsuite.el \
-f ert-run-tests-batch-and-exit
$(CARTON) exec $(EMACS) --no-site-file --no-site-lisp --batch \
$(EMACSFLAGS) \
-l tests/testsuite.el -f ert-run-tests-batch-and-exit
.PHONY: virtual-test
virtual-test :
$(VAGRANT) up
$(VAGRANT) ssh -c "make -C /vagrant EMACS=$(EMACS) clean test"
$(VAGRANT) ssh -c "make -C /vagrant CARTON=/opt/carton/bin/carton EMACS=$(EMACS) clean test"
.PHONY: clean
clean :
......@@ -24,5 +30,6 @@ clean :
rm -rf elpa # Clean packages installed for development
%.elc : %.el
$(EMACS) --no-site-file --no-site-lisp --batch $(EMACSFLAGS) \
-l dependencies.el -f batch-byte-compile $<
$(CARTON) exec $(EMACS) --no-site-file --no-site-lisp --batch \
$(EMACSFLAGS) \
-f batch-byte-compile $<
;;; dependencies.el --- Install and load development dependencies
;; Copyright (c) 2013 Sebastian Wiesner <lunaryorn@gmail.com>
;;
;; Author: Sebastian Wiesner <lunaryorn@gmail.com>
;; URL: https://github.com/lunaryorn/flycheck
;; This file is not part of GNU Emacs.
;; 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/>.
;;; Code:
(defconst source-dir (file-name-directory load-file-name)
"The source directory.")
;; Enable installation of dependencies
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
;; Install packages into the source directory (not into ~/.emacs.d!)
(setq package-user-dir (expand-file-name "elpa") source-dir)
;; Initialize the package system and fetch the archive contents
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(defun package-need (package)
"Require PACKAGE to be installed."
(unless (package-installed-p package)
(package-install package)))
(package-need 'dash)
(package-need 's)
(require 'dash)
(require 's)
;;; dependencies.el ends here
......@@ -25,7 +25,6 @@
(require 'ert)
(require 'flycheck)
(package-need 'coffee-mode)
(require 'coffee-mode)
(ert-deftest checker-coffeelint-throwing-strings ()
......
......@@ -25,7 +25,6 @@
(require 'ert)
(require 'flycheck)
(package-need 'haml-mode)
(require 'haml-mode)
(ert-deftest checker-haml-inconsistent-indentation ()
......
......@@ -25,9 +25,7 @@
(require 'ert)
(require 'flycheck)
(package-need 'js2-mode)
(require 'js2-mode)
(package-need 'js3-mode)
(require 'js3-mode)
(ert-deftest checker-javascript-jshint-missing-semicolon ()
......
......@@ -31,8 +31,7 @@
;; HACK: Use system-wide installation in Vagrant and on Travis. The MELPA
;; package of lua-mode causes tests to hang in these environments
(load "/usr/share/emacs/site-lisp/lua-mode/lua-mode.el")
(package-need 'lua-mode))
(require 'lua-mode)
(require 'lua-mode))
(ert-deftest checker-lua-missing-quote ()
"Test a syntax error with Lua."
......
......@@ -26,7 +26,6 @@
(require 'dash)
(require 'flycheck)
(package-need 'cperl-mode)
(require 'cperl-mode)
(ert-deftest checker-perl-unused-variable ()
......
......@@ -25,9 +25,7 @@
(require 'ert)
(require 'flycheck)
(package-need 'php-mode)
(require 'php-mode)
(package-need 'php+-mode)
(require 'php+-mode)
(ert-deftest checker-php-missing-quote ()
......
......@@ -25,9 +25,7 @@
(require 'ert)
(require 'flycheck)
(package-need 'php-mode)
(require 'php-mode)
(package-need 'php+-mode)
(require 'php+-mode)
(ert-deftest checker-php-phpcs-uppercase-keyqord ()
......
......@@ -25,7 +25,6 @@
(require 'ert)
(require 'flycheck)
(package-need 'sass-mode)
(require 'sass-mode)
(ert-deftest checker-sass-inconsistent-indentation ()
......
......@@ -53,7 +53,7 @@ export DEBIAN_FRONTEND='noninteractive'
apt_update
# Install basic packages
apt make python-software-properties
apt git make python-software-properties
# Bring in the necessary PPAs
ppa ppa:cassou/emacs
......@@ -92,3 +92,10 @@ npm coffee-script coffeelint \
gem haml \
sass
# Install carton for Emacs dependency management
rm -rf /tmp/carton
git clone https://github.com/rejeep/carton /tmp/carton
mkdir -p /opt/
rm -rf /opt/carton
sudo mv /tmp/carton /opt/carton
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment