Cask API¶
This document provides a reference of the public Cask API, which you may use in your own projects and extensions to Cask.
Table of Contents
Cask bundles¶
A bundle represents a specific Cask project. Essentially, a bundle is a loaded
Cask file.
Creating bundles¶
The following functions create bundles.
-
Function
cask-setupproject-path¶ Setup cask for project at PROJECT-PATH. This function return a
`cask-bundle'object.
-
Function
cask-initialize&optional project-path¶ Initialize packages under PROJECT-PATH or
`user-emacs-directory'. This function return a`cask-bundle'object.
Bundle paths¶
These functions return various paths associated with a bundle:
-
Function
cask-filebundle¶ Return path to BUNDLE Cask-file.
-
Function
cask-pathbundle¶ Return BUNDLE root path.
-
Function
cask-load-pathbundle¶ Return Emacs
`load-path'(including BUNDLE dependencies).
-
Function
cask-exec-pathbundle¶ Return Emacs
`exec-path'(including BUNDLE dependencies).
-
Function
cask-elpa-pathbundle¶ Return full path to BUNDLE elpa directory.
Package metadata of bundles¶
These functions give access to the metadata of the package, represented by the bundle.
-
Function
cask-package-namebundle¶ Return BUNDLE name. If BUNDLE is not a package, the error
`cask-not-a-package'is signaled.
-
Function
cask-package-versionbundle¶ Return BUNDLE version. If BUNDLE is not a package, the error
`cask-not-a-package'is signaled.
-
Function
cask-package-descriptionbundle¶ Return BUNDLE description. If BUNDLE is not a package, the error
`cask-not-a-package'is signaled.
Bundle contents¶
-
Function
cask-filesbundle¶ Return BUNDLE files list. This is done by expanding the patterns in the BUNDLE path. Files in the list are relative to the path.
Bundle dependencies¶
-
Function
cask-dependenciesbundle &optional deep¶ Return BUNDLE's runtime and development dependencies. If DEEP is true, return all dependencies, recursively. Return value is a list of
`cask-dependency'objects.
-
Function
cask-runtime-dependenciesbundle &optional deep¶ Return BUNDLE's runtime dependencies. If DEEP is true, return all dependencies, recursively. Return value is a list of
`cask-dependency'objects.
-
Function
cask-development-dependenciesbundle &optional deep¶ Return BUNDLE's development dependencies. If DEEP is true, return all dependencies, recursively. Return value is a list of
`cask-dependency'objects.
-
Function
cask-installed-dependenciesbundle &optional deep¶ Return list of BUNDLE's installed dependencies. If DEEP is t, all dependencies recursively will be returned.
-
Function
cask-add-dependencybundle name &rest args¶ Add dependency to BUNDLE. NAME is the name of the dependency. ARGS is a plist with these optional arguments:
`:version'Depend on at least this version for this dependency.`:scope'Add dependency to a certain scope. Allowed values are 'development and 'runtime.`:files'Only include files matching this pattern.`:ref'Fetcher ref to checkout.`:branch'Fetcher branch to checkout. ARGS can also include any of the items in`cask-fetchers'. The plist key is one of the items in the list and the value is the url to the fetcher source.
-
Function
cask-has-dependencybundle name¶ Return true if BUNDLE contain link with NAME, false otherwise.
-
Function
cask-find-dependencybundle name¶ Find dependency in BUNDLE with NAME.
-
Function
cask-dependency-pathbundle name¶ Return path to BUNDLE dependency with NAME. If no such dependency exist, return nil.
Dependency links¶
These functions deal with dependency links.
See also
-
Function
cask-linksbundle¶ Return a list of all links for BUNDLE. The list is a list of alist's where the key is the name of the link, as a string and the value is the absolute path to the link.
-
Function
cask-linkbundle name source¶ Add BUNDLE link with NAME to SOURCE. NAME is the name of the package to link as a string. SOURCE is the path to the directory to link to. SOURCE must have either a NAME-pkg.el or Cask file for the linking to be possible.
-
Function
cask-link-deletebundle name¶ Delete BUNDLE link with NAME.
-
Function
cask-linked-pbundle name¶ Return true if BUNDLE has link with NAME.
Dependency sources and package archives¶
These functions let you add and remove dependency sources, i.e., package archives where to get dependencies from.
-
Function
cask-add-sourcebundle name-or-alias &optional url¶ Add source to BUNDLE. NAME-OR-ALIAS is either a string with the name of the source or a symbol, which refers to some of the keys in
`cask-source-mapping'. Second argument URL is only required unless alias. If no alias, URL is the url to the mirror.
-
Function
cask-remove-sourcebundle name¶ Remove source from BUNDLE with NAME.
Dependency operations¶
These functions provide operations on dependencies, such as updating, or installing them:
-
Function
cask-installbundle¶ Install BUNDLE dependencies. Install all available dependencies. If some dependencies are not available, signal a
`cask-missing-dependencies'error, whose data is a list of all missing dependencies. All available dependencies are installed nonetheless. If a dependency failed to install, signal a`cask-failed-installation'error, whose data is a(DEPENDENCY . ERR), where DEPENDENCY is the`cask-dependency'which failed to install, and ERR is the original error data.
-
Function
cask-updatebundle¶ Update BUNDLE dependencies. Return list of updated packages.
-
Function
cask-outdatedbundle¶ Return list of
`epl-upgrade'objects for outdated BUNDLE dependencies.
Byte compilation¶
These function let you byte compile all Emacs Lisp files in a bundle:
-
Function
cask-buildbundle¶ Build BUNDLE Elisp files.
-
Function
cask-clean-elcbundle¶ Remove BUNDLE Elisp byte compiled files.
Packaging¶
These functions create packages and package descriptors:
-
Function
cask-define-package-stringbundle¶ Return
`define-package'string for BUNDLE.
-
Function
cask-define-package-filebundle¶ Return path to
`define-package'file for BUNDLE.
-
Function
cask-packagebundle &optional target-dir¶ Build an ELPA package of BUNDLE. Put package in TARGET-DIR if specified. If not specified, put in a directory specified by
`cask-dist-path'in the BUNDLE path.
Miscellaneous functions¶
-
Function
cask-caskifybundle &optional dev-mode¶ Create Cask-file for BUNDLE path. If DEV-MODE is true, the dev template is used, otherwise the configuration template is used.
-
Function
cask-version¶ Return Cask's version.