Cask Domain Specific Language¶
This document provides a reference on the DSL.
Package metadata¶
-
Function
packagename version description¶ Declare a package with the given name, version and description:
(package "ecukes" "0.2.1" "Cucumber for Emacs.")
All arguments are strings. The version must be a version understood by Emacs’ built-in
version-to-list.
-
Function
package-filefile¶ Declare a package by taking the package metadata from the given file. Relative filenames are relative to the directory of the
Caskfile.The package name will be the name of the given file, sans directory and extension. The description is taken from the very first line of file. The version and the run-time dependencies are taken from the library headers of file. See Library Headers(elisp) for details about library headers
-
Function
package-descriptorfile¶ Declare all package metadata directly by specifying a package descriptor contained in file with name given by file
See Multi-file Packages for examples on defining packages with the
define-packagefunction.
Package contents¶
-
Function
files&rest patterns¶ The files to include in the package built by cask package. The patterns have the same format as the
:filesin an MELPA recipe, as Cask uses the same library to build packages.Each pattern in patterns is either a simple glob pattern as string or an expression
(target pattern...). In the former case, all files matching the pattern (relative to the directory of theCaskfile) are included at the top-level of the package.:defaultsmay be used as the first pattern to explicitly include the default patterns. This allows subsequent patterns to append to the defaults.In the latter case, target is the unqualified target directory within the package, each pattern describes the contents of the package under the target directory recursively.
Hence, the pattern
(“*.el” (“resources” (“snippets” “*.snippet”)))would include all.elfiles from the project root in the package root, and all.snippetfiles from the project root in the directoryresources/snippetsunder the package root.
Dependencies¶
-
Function
depends-onpackage-name &optional minimum-version¶ -
Function
depends-onpackage-name :fetcher repourl &optional :ref hash :branch name :files patterns Specify a dependency of this package.
package-name is the name of a package which is a dependency of this package.
In the first variant, install the package from a package archive (see
source), optionally requiring a minimum-version.In the second variant, install the package from a VCS repository. Replace fetcher with any of the following:
:git,:bzr,:hg,:darcs,:svnor:cvs. repourl is the repository URL to install the package from.ref and branch specify the commit hash or branch name to install from. If both are omitted, default to the
masterbranch.files gives the files from the repository to include in the package, in the same format as
files. If omitted, try to take the files from theCaskfile of the repository.
-
Function
development&rest body¶ Scope all
depends-onexpressions in body to development.Development dependencies are installed with cask install, but are not included in package descriptors generated by cask pkg-file and cask package.
-
Function
sourcealias¶ -
Function
sourcename url Add a package archive to install dependencies from.
In the first variant, add a built-in package archive. In the second variant, add a package archive with the given name, and the given url.
Cask includes the following built-in package archives:
gnuThe standard GNU ELPA archive at https://elpa.gnu.org/.
Warning
Unlike an interactive Emacs, Cask does not enable any archive by default. Hence, you must explicitly add the
gnuarchive if you need it.melpa-stable- An archive of stable versions built automatically from upstream repositories, at https://stable.melpa.org/.
melpa- An archive of VCS snapshots built automatically from upstream repositories, at https://melpa.org/.
marmalade- An archive of packages uploaded by users and maintainers, at https://marmalade-repo.org/.
SC- An archive providing packages for Sunrise Commander, at http://joseito.republika.pl/sunrise-commander/.
orgAn archive providing packages for Org Mode, at http://orgmode.org/elpa/.
Note that unlike the
gnuarchive, which also provides anorgpackage, this archive provides theorg-plus-contribpackage, which installs additional extensions for Org Mode maintained by the Org Mode maintainers, which are not included in the standardgnupackages for copyright reasons.