Loïc Wacquant - Parias Urbanos - Marginalidad en La Ciudad a Comienzos Del Milenio
Ceylon.build by Loïc Rouchon
Click here to load reader
-
Upload
unfromage -
Category
Technology
-
view
13.709 -
download
0
description
Transcript of Ceylon.build by Loïc Rouchon
Introduction to ceylon.buildBy Loïc Rouchon
Executive Summary
• What is ceylon.build
• Why ceylon.build
• Definitions• Features
What is ceylon.build
• Tool to run goals from command line
• Aims to be an alternative to Ant / Maven / Gradle
Why ceylon.build
• Write code, not XML
• Type-safety
• Built-in module system
Definition
• Goal:– A function– With a name– And dependencies on other goals
First syntax attempt
import ceylon.build.engine { build }import ceylon.build.task { Goal }import ceylon.build.tasks.misc { echo }
void run() { build { Goal { name = "hello"; echo("hello") }, Goal { name = "bye"; echo("bye") } };}
First syntax attempt
import ceylon.build.engine { build }import ceylon.build.task { Goal }import ceylon.build.tasks.misc { echo }
void run() { build { Goal { name = "hello"; echo("hello") }, Goal { name = "bye"; echo("bye") } };}
• Hard to read for an IDE plugin
First syntax attempt
import ceylon.build.engine { build }import ceylon.build.task { Goal }import ceylon.build.tasks.misc { echo }
void run() { value bar = Goal { name = "bar"; echo("bar") } value foo = Goal { name = "foo"; dependencies = [bar]; echo("foo") } build { foo, bar };}
• Hard to read for an IDE plugin
• Dependencies break Tree-like syntax
Future syntax
import ceylon.build.task { goal }import ceylon.build.tasks.misc { echo }
"Say Hello"goal shared void hello() { echo("hello");}
"Say Bye"goal shared void bye() { echo("bye");}
Command line usage
$ ceylon build hello $ ceylon build hello bye
## ceylon.build# running goals: [hello] in order# running hello()hello world## success duration 0s
## ceylon.build# running goals: [hello, bye] in order# running hello()hello# running bye()bye## success duration 0s
Usage: ceylon run ceylon.build.runner your.build.module [<goal...>]Or, if your build module is in build folder: ceylon build [<goal...>]
Import a set of goals
Goal set definition Your build moduleimport ceylon.build.task { goal }import ceylon.build.tasks.misc { echo }
shared class FooBar() { goal shared void foo() { echo("foo"); } goal shared void bar() { echo("bar"); }}
import ceylon.build.task { include }
include shared fooBar = FooBar();
Dependency management
• A goal can define dependencies on other goals– Dependencies will be executed prior to this goal
– Each goal requested (directly or by dependency) will only be executed once
Dependency management
$ ceylon build foo
## ceylon.build# running goals: [bar, foo] in order# running bar()bar# running foo()foo## success duration 0s
import ceylon.build.task { goal }import ceylon.build.tasks.misc { echo }
goal { dependencies = [`function bar`]; }shared void foo() { echo("foo");}
goal shared void bar() { echo("bar");}
Useful links
• Github– https://github.com/ceylon/ceylon.build
• Engine documentation: – http://modules.ceylon-lang.org/repo/1/ceylon/build
/engine/1.0.0/module-doc/
• Task API documentation:– http://modules.ceylon-lang.org/repo/1/ceylon/build
/task/1.0.0/module-doc/
Q&A
• Questions! Answers?