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

<ceylon-compile> Ant task

Usage

Note: In M5 the <ceylonc> task was renamed <ceylon-compile>.

Note: You must declare the tasks with a <typedef>.

To compile the module com.example.foo whose source code is in the src directory to a module repository in the build directory, with verbose compiler messages:

<target name="compile" depends="ceylon-ant-taskdefs">
  <ceylon-compile src="src" out="build" verbose="true">
    <module name="com.example.foo"/>
  </ceylon-compile>
</target>

Description

The <ceylon-compile> ant task supports compilation of Ceylon and Java source code to .car archives in a Ceylon repository using the Ant build tool. It provides similar features to the ceylon compile command line tool.

Parameters

Note: In addition to the parameters in the table below, a nested <module>s and/or a <files> element is required.

Attribute Description Required
out The output module repository (which must be publishable). No, default is modules
user The user name to use when connecting to the output repository. Only used for HTTP output repositories. No
pass The password to use when connecting to the output repository. Only used for HTTP output repositories. No
src A source directory. No, default is source
encoding The character encoding used for source files No, default is the OS default encoding
verbose Whether the compiler should emit verbose logging information. The zero or more of the following flags can be passed separated by commas: 'all', 'loader', 'ast', 'code', 'cmr' or 'benchmark'. If you do not pass a flag 'all' will be assumed. No
nomtimecheck Whether to perform a comparison of file modification times to determine whether to compile a module or file. The most recent modification time of the source files is compared with the oldest modification time of the output artifacts. This can speed up builds when the source files have not changed but is not able to detect deletion of source files. Milestone 3 No, default is false
executable The filesystem location of the ceylon command line tool. If not specified it is searched in the directory indicated by the ceylon.home system property, or if that is not set the CEYLON_HOME environment variable. No

Nested elements

Note: Unlike ant's <javac> task, <ceylon-compile> does not support an implict FileSet so you cannot add <include>/<exclude> etc as direct subelements. You must use <files> explicitly.

<moduleset>

A reference to a <moduleset> defined elsewhere in the ant build file.

<module>

A module to compile. Can be specified multiple times.

Attribute Description Required
name The module name Yes

<files>

A FileSet of source files to pass to ceylon compile. Milestone 2

<reposet>

A reference to a <reposet> defined elsewhere in the ant build file.

<rep>

A module repository containing dependencies. Can be specified multiple times. Defaults to modules.

Attribute Description Required
url The URL of the module repository Yes

<javacoption>

The text between begin and end tags will be passed as an option to the underlying Java compiler. Optionally it is possible to use the attributes listed below which will then be interpreted as passing -key:value to the compiler.

Attribute Description Required
key The name of the option to pass No
value The value of the option to pass No

Output

The <ceylon-compile> task outputs a module archive and a source archive for each module named on the command line. The compiler produces .car files directly; it does not produce individual .class files as javac does.

See also