• Modules
    • By category
    • By name
    • Most popular
    • Most downloaded
    • Repository
  • Register
  • Log in
  • Help
    • Start using Ceylon Herd
    • Publish your first module
    • Module publishing guidelines
    • All about Ceylon
    • Keyboard Shortcuts

    • s Focus search module bar
      ? Open this information panel
      j Move selection down
      k Move selection up
      enter Open current selection
Module info
Name
loic / ceylon.build.tasks.file / 1.0.0
Ceylon Build File Tasks Platform Module
Backends JVM
Maven coordinates
Compatible Ceylon release JVM: 1.0.0 (outdated)
Published Nov 11, 2013
Stats Downloads (JVM): 468
Source downloads: 477
License [ASL 2.0](http://www.apache.org/licenses/LICENSE-2.0)
Description

Functions and Task wrappers to copy / delete files and directories.

Delete

This module provides two functions to delete files and directories.

  • deletePath: function to delete files / directories that can be used in your own tasks
  • delete: function creating a wrapper Task for deletePath function

Here is an example of a task which will delete "modules" directory.

Task cleanTarget = delete {
    path = parsePath("modules");
};

A filter can be added to that task to only delete files with extensions "car" and "car.sha1"

Task cleanTarget = delete {
    path = parsePath("modules");
    filter = extensions("car", "car.sha1");
};

Copy

This module provides two functions to copy files and directories.

  • copyFiles: function to copy files / directories that can be used in your own tasks
  • copy: function creating a wrapper Task for copyFiles function

Here is an example of a task which will copy file "modules/mymodule/1.0.0/module-1.0.0.car" to "container/modules".

Task deploy = copy {
    source = parsePath("modules/mymodule/1.0.0/module-1.0.0.car");
    destination = parsePath("container/modules");
};

Note that copy acts the same way as the cp Unix command when a single file is given in input

  • If the destination is a directory, it will copy the file under the destination directory. (modules/mymodule/1.0.0/module-1.0.0.car -> "container/modules/module-1.0.0.car in our example)
  • If the destination is a file it will overwrite it or fail depending of overwrite configuration (modules/mymodule/1.0.0/module-1.0.0.car -> "container/modules" in our example)
  • If the destination doesn't exist, it will use copy input file to destination (modules/mymodule/1.0.0/module-1.0.0.car -> "container/modules" in our example)

A directory can also be copied recursively as below

Task deploy = copy {
    source = parsePath("modules");
    destination = parsePath("container/modules");
    filter = extensions("car");
};
Dependencies
ceylon.build.task/1.0.0 shared
ceylon.file/1.0.0 shared
Usage
  • Import
 import ceylon.build.tasks.file "1.0.0";
Module links Members
Imported By
Home
Code repository
Issue tracker
Browse
Download .car
No .js archive
Download source archive
Download module documentation
View API documentation

Ceylon Herd v1.24 Copyright 2012-2021 Red Hat. About