Note: information on this page refers to Ceylon 1.1, not to the current release.


A package is a collection of toplevel declarations contained in one or more compilation units together with an optional package descriptor.

A package may belong to a module.


An example package descriptor:

shared package;

This would occur in the source file <source-dir>/com/example/foo/bar/package.ceylon where <source-dir> is the directory containing ceylon source code, conventionally source.



A package's members are the top-level declarations contained in its compliation unit(s).


The package descriptor holds metadata about the package and is declared in a source file called package.ceylon in the package being described. Here's an example:

"An example package"
shared package;

The package declaration may be preceeded by annotations, including:

  • shared to allow the package to be visible outside its containing module,
  • doc to let you to specify package-level documentation,
  • by to document the package's author or authors.

The package declaration consists of the package keyword followed by the package name.

It is common not to have a package descriptor if the package is not shared.


Packages can be manipulated at runtime via their representation as Package instances.

See also