Name |
Ceylon Build Engine Platform Module |
---|---|
Description |
The goal of this module is to provide a goal/task based build engine to achieve actions. It could be used to handle development tasks like compile, test, document, run module, … or any other action like files copy, directory cleanup, …
More detailled documentation on how to create and use Build moduleA build module is a standard ceylon module that has in its import ceylon.build.engine { build } import ceylon.build.task { Goal } import ceylon.build.tasks.ceylon { ceylonModule } import ceylon.build.tasks.file { delete, copy } import ceylon.file { parsePath } void run() { String myModule = "mod"; build { project = "My Build Project"; Goal { name = "clean"; delete { path = parsePath("modules/``myModule``"); } }, ceylonModule { moduleName = myModule; testModuleVersion = "1.0.0"; }, Goal { name = "publish-local"; copy { source = parsePath("modules/``myModule``"); destination = parsePath("/path/to/local/ceylon/repo/``myModule``"); overwrite = true; } } }; } This simple build module defines two goals and one goal set.
ExecutionWhen this Using the above goals declarations, launching Arguments can be passed to each goal task using the For example, DependenciesSometimes, it is needed to always execute a goal before another one. In that case, the second goal can declare a dependency on the first one as below: import ceylon.build.engine { build } import ceylon.build.task { Goal } import ceylon.build.tasks.ceylon { compile, compileTests, document, runModule } void run() { String myModule = "mod"; String myTestModule = "test.mod"; Goal compileGoal = Goal { name = "compile"; compile { modules = myModule; } }; Goal compileTestsGoal = Goal { name = "tests-compile"; dependencies = [compileGoal]; compileTests { modules = myTestModule; } }; Goal testGoal = Goal { name = "test"; dependencies = [compileTestsGoal]; runModule { moduleName = myTestModule; version = "1.0.0"; } }; Goal docGoal = Goal { name = "doc"; document { modules = myModule; includeSourceCode = true; } }; build { project = "My Build Project"; compileGoal, compileTestsGoal, testGoal, docGoal }; } In this example, Executing Goals re-orderingAnother feature of the dependency resolution mechanism is that it will re-order goal execution list to satisfy dependencies. For example, executing In a general way, goals will be executed in the order they are requested as long that it satisfies declared dependencies. Otherwise, dependencies, will be moved before in the execution list to restore consistency. Multiple goals occurencesIn case a goal is requested multiple times (could be directly, or by dependency to it), the engine ensures that it will be executed only once. Using previous example, executing |
Rating | 5.00 (rated by 1 user) |
Last Published | Nov 11, 2013 |
Stats |
Downloads (JVM): 707 Downloads (JS): 0 Source downloads: 631 |
Module links |
Home Code repository Issue tracker Imported By Browse |
1.0.0 | JVM JVM: 1.0.0 (outdated) | Published Nov 11, 2013 |
Browse |
View docs |
Thanks, Loic!