Cask has an extensive API, which is briefly described in this document. For full documentation of each function, read the function doc-string.
As you will see, almost every API function takes a bundle
as first
argument. A bundle is an object that describes the current Cask
project. You should not modify this object directly, but use the API
functions to do so.
To create a bundle
object, use either cask-setup
or
cask-initialize
, which are described below.
(project-path)
(&optional project-path)
(bundle)
(bundle)
(bundle)
(bundle &optional dev-mode)
(bundle)
(bundle)
(bundle)
()
(bundle)
(bundle)
(bundle)
(bundle &optional deep)
(bundle &optional deep)
(bundle &optional deep)
(bundle &optional deep)
(bundle name)
(bundle name)
(bundle)
(bundle)
(bundle name)
(bundle)
(bundle)
(bundle)
(bundle name &rest args)
(bundle name-or-alias &optional url)
(bundle name)
(bundle)
(bundle)
(bundle)
(bundle name source)
(bundle name)
(bundle name)
(bundle &optional target-dir)
(project-path)
Create a bundle
object for project-path
. Use this function for
packages and cask-initialize
for your local Emacs configuration.
(let ((bundle (cask-setup "/path/to/project")))
;; ...
)
(&optional project-path)
Like cask-setup
, but also initializes all dependencies. Use this
function for your local Emacs configuration and cask-setup
for
packages.
(let ((bundle (cask-initialize "/path/to/project")))
;; ...
)
(bundle)
Update dependencies and return list of updated dependencies.
(let ((updated (cask-update bundle)))
;; ...
)
(bundle)
Return a list of all outdated dependencies.
(let ((outdated (cask-outdated bundle)))
;; ...
)
(bundle)
Install dependencies.
(cask-install bundle)
(bundle &optional dev-mode)
Create Cask
-file.
(cask-caskify bundle) ;; For Emacs configuration
(cask-caskify bundle 'dev-mode) ;; For packages
(bundle)
Return package name.
(cask-package-name bundle) ;; => 'foo
(bundle)
Return package version.
(cask-package-version bundle) ;; => "0.1.2"
(bundle)
Return package description.
(cask-package-description bundle) ;; => "Description for Foo package"
()
Return Cask's version.
(cask-version)
(bundle)
Return load-path
including dependencies.
(cask-load-path bundle) ;; => '("/path/to/.cask/24.3.1/elpa/foo-1.2.3" ...)
(bundle)
Return exec-path
including dependencies.
(cask-exec-path bundle) ;; => '("/path/to/.cask/24.3.1/elpa/foo-1.2.3/bin" ...)
(bundle)
Return path to elpa directory.
(cask-elpa-path bundle) ;; => "/path/to/.cask/24.3.1/elpa"
(bundle &optional deep)
Return list of runtime dependencies.
(cask-runtime-dependencies bundle)
(cask-runtime-dependencies bundle 'deep)
(bundle &optional deep)
Return list of development dependencies.
(cask-development-dependencies bundle)
(cask-development-dependencies bundle 'deep)
(bundle &optional deep)
Return list of runtime and development dependencies.
(cask-dependencies bundle)
(cask-dependencies bundle 'deep)
(bundle &optional deep)
Return list of installed dependencies.
(cask-installed-dependencies bundle)
(cask-installed-dependencies bundle 'deep)
(bundle name)
Return true if project has dependency with name
.
(cask-has-dependency bundle 'foo)
(bundle name)
Return dependency with name
.
(cask-find-dependency bundle 'foo)
(bundle)
Return define-package
string used for -pkg.el
files.
(cask-define-package-string bundle) ;; => "(define-package ...)"
(bundle)
Return path to -pkg.el
file.
(cask-define-package-file bundle) ;; => "/path/to/project-pkg.el"
(bundle name)
Return path to dependency with name
.
(cask-dependency-path bundle 'foo) ;; => "/path/to/.cask/24.3.1/elpa/foo-1.3.3"
(bundle)
Return path to project root.
(cask-path bundle) ;; => "/path/to"
(bundle)
Return path to project Cask
-file.
(cask-file bundle) ;; => "/path/to/Cask"
(bundle)
Return list of project files.
(cask-files bundle) ;; => '("foo.el" "foo-core.el" ...)
(bundle name &rest args)
Add dependency with name
.
Last argument args
, can be:
:ref
- Fetcher ref to checkout.:branch
- Fetcher branch to checkout.:files
- Only include files matching this pattern.(cask-add-dependency bundle 'foo)
(cask-add-dependency bundle 'foo "1.2.3")
(cask-add-dependency bundle 'foo :git "https://foo.git" :ref "ij7ads0" :files '("*.el" (:exclude ".git")))
(cask-add-dependency bundle 'foo :git "https://foo.git" :branch "experimental")
(bundle name-or-alias &optional url)
Add ELPA source.
(cask-add-dependency bundle "name" "http://path.to.elpa/packages/")
(cask-add-dependency bundle 'alias)
(bundle name)
Remove ELPA source.
(cask-remove-dependency bundle "name")
(bundle)
Byte compile project files.
(cask-build bundle)
(bundle)
Remove byte compiled files.
(cask-clean-elc bundle)
(bundle)
Return list of links.
(cask-links bundle) ;; => '((foo "/path/to/too") (bar "/path/to/bar"))
(bundle name source)
Create link with name
to source
path.
(cask-link bundle 'foo "/path/to/foo")
(bundle name)
Delete link with name
.
(cask-delete-link bundle 'foo)
(bundle name)
Return true if link with name
exist, false otherwise.
(cask-linked-p bundle 'foo)
(bundle &optional target-dir)
Create an ELPA package of this project. Put package in directory
called dist
or target-dir
if specified.
(cask-package bundle)
(cask-package bundle "/path/to/dist")