Cake build Flashcards Preview

.NET / C# > Cake build > Flashcards

Flashcards in Cake build Deck (34)
Loading flashcards...
1

What is cake and what was it based on?

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

2

What is DSL?

Domain system language.

3

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

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

4

What benefit the dependency-tracking model gives?

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

5

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

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

6

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

as simple as doing an using statement.

7

What tools integrate with cake?

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

8

How does cake work? which compiler does it use?

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

9

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

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

10

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

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

11

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

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

12

What is fluent interface?

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

13

Does the order of the fluent interface chaning methods matter?

Yes.. top down

14

What are the four basic building blocks of cake?

Task, IsDependentOn, RunTarget, Argument.

15

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

Asserts a condition. halts and throw error if false.

16

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

ContinueOnError, ReportError, OnError

17

How to manually halt a script?

just throw an exception.

18

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

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

19

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

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

What do the information and verbose aliases do?

they log information

21

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

DotNetBuild(), uses msbuild behind the scene.

22

Why not using directly MsBuild alias?

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

23

What does the bootstraper do?

downloads nuget and then downloads the cake packages.

24

What are the default arguments of the build.ps1?

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

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

Argument > cake.config > EnvironmentVariables.

26

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

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

.NET CORE = DEFAULT TO USE.

27

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

can download tools or reference other cake scripts.

28

When the preprocessor directive is read?

before anything else.

29

What are the two most common tool directives?

tools and references to other libs.

30

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

yes, call context tools register file commands.