Cake build Flashcards

1
Q

What is cake and what was it based on?

A

Cake is a scripting tool using C# DSL. Based in the famous make tool for unix systems (1976)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is DSL?

A

Domain system language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the dependency-tracking model (aka dependency-based programming)?

A

You tell which tasks the specific tasks depend on (instead of calling one after another).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What benefit the dependency-tracking model gives?

A

You can run specific jobs and the dependent jobs will be run naturally.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why would I use Cake in a C# project? What other reason (which is actually more important) than the first one?

A

because you’ll be using a single language for everything. Rich ecosystem of integrations (built-in tools) - integrate with everything you need.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to use a built-in tool? Is it difficult?

A

as simple as doing an using statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What tools integrate with cake?

A

see:
https://pasteboard.co/JH67c5r.png

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does cake work? which compiler does it use?

A

cake is a c# script which is parsed and compiled by Roslyn ON THE FLY.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Can I run regular .NET code in cake? Which namespaces are available to us by default?

A

yes. cake.core.dll and cake.common.dll are available by default to us.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How would we import an assembly if we did not have cake (think on powershell)? How does cake solve it?

A

We would need to store the dlls (and its dependencies) manually. Cake solve it by allowing referencing nuget packages (awesome).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a Task (Task = cake alias)? What does it execute?

A

meant to do one single thing (such as compile the application). Execute an anonymous function (aka lamba)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is fluent interface?

A

Is when you can chain call to methods together (Task.DependsOn().Does(() =>)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Does the order of the fluent interface chaning methods matter?

A

Yes.. top down

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the four basic building blocks of cake?

A

Task, IsDependentOn, RunTarget, Argument.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the WithCriteria alias do? What happens when not met?

A

Asserts a condition. halts and throw error if false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Does cake allow error handling? What are the three aliases?

A

ContinueOnError, ReportError, OnError

17
Q

How to manually halt a script?

A

just throw an exception.

18
Q

What does the setup and teardown methods passes as parameters? When are they ran?

A

context and task information. Before the first task and after the last one.

19
Q

How does the cake object model look like? What are the main concepts?

A

https://pasteboard.co/JIa6o1z.png
main concepts: Script inherits from script host (contains RunTarget, Task and other aliases), where Script encapsulates the Context object which contains environment variables and other handy stuff.

20
Q

What do the information and verbose aliases do?

A

they log information

21
Q

how to build a sln? what does it run behind the scenes?

A

DotNetBuild(), uses msbuild behind the scene.

22
Q

Why not using directly MsBuild alias?

A

because DotNetBuild is multi platform (which in the past called xbuild, now i think they all call the same thing).

23
Q

What does the bootstraper do?

A

downloads nuget and then downloads the cake packages.

24
Q

What are the default arguments of the build.ps1?

A
FilePath, default to build.cake
Target TaskName, Default to Default
Configuration Name, default release
Verbosity level, default verbose
Experimental, allows using latest c# features
DryRun do not actually execute anything
Any custom argument, argument=value
25
Q

Besides sending arguments to build.ps1, what are the other two options? What is the priority?

A

Argument > cake.config > EnvironmentVariables.

26
Q

What are the versions of cake? which platforms does it run?

A
cake = framework / mono,
Cake.CoreCLR = .NET Core

.NET CORE = DEFAULT TO USE.

27
Q

What does the processor directive can do for cake? is it equal to c#?

A

can download tools or reference other cake scripts.

28
Q

When the preprocessor directive is read?

A

before anything else.

29
Q

What are the two most common tool directives?

A

tools and references to other libs.

30
Q

Can I register a custom tool on cake, how’s that done?

A

yes, call context tools register file commands.

31
Q

How to load another cake script? what’s the short version?

A

via preprocessor directive #load path to cake. #l

32
Q

Can I load cake scripts from nuget packages?

A

yes, use the same load but with nuget

33
Q

how to change the nuget_package source on cake?

A

change on config file

34
Q

does cake has a FilePath type? why using it?

A

yes, brings convenience to deal with files.