$30 off During Our Annual Pro Sale. View Details »

DotNet Meetup - Jan 2017 - Cake

DotNet Meetup - Jan 2017 - Cake

Presentation deck for CAKE (C# Make)

Gareth Burns

January 23, 2017
Tweet

More Decks by Gareth Burns

Other Decks in Programming

Transcript

  1. Introduction to Cake (C# Make)

    View Slide

  2. Introduction to Cake (C# Make)
    • What is Cake?
    • What makes Cake different?
    • Format of Cake Scripts
    • How to get started with Cake
    • Resources
    • Examples
    • Example extended
    • Thoughts

    View Slide

  3. What is Cake?
    • Cake is a tool for building code
    • It allows you to build code in C#
    • It is cross platform compatible
    • You should always get the same
    experience
    • It integrates with other tools
    • Continuous Integration
    • Unit Testing
    • Build tools
    • It’s Open Source

    View Slide

  4. What makes Cake different?
    • Why would you use Cake?
    • Building .NET Core applications on different platforms
    • You don’t want to get bogged down in other languages
    • You want to use your C# skills
    • You already have tools in place and want to just change the build
    script provider
    • You want the flexibility of Open Source software
    Cake is not a Continuous Integration platform and shouldn’t be used for this purpose

    View Slide

  5. Format of Cake Scripts
    • There are some key components
    • Tasks
    • Dependencies
    • Criteria
    • Extending it out further with
    • Error Handling
    • Setup and Teardown
    • Arguments and variables
    • and more…….

    View Slide

  6. Tasks
    • Tasks are the basic building blocks of Cake
    • Tasks essentially define a build
    • A cake build script is a list of tasks

    View Slide

  7. Dependency
    • Dependencies allow you to chain tasks together
    • When you run your script you call the last task in the dependancy
    chain

    View Slide

  8. Criteria
    • Conditions that have to be satisfied before a task is run
    • If you call a chain then these can stop everything

    View Slide

  9. How to get started with Cake
    • cakebuild.net
    • Getting Started Section
    • Bootstrapping
    • Basic example script
    • Documentation
    • Fundamentals of Cake
    • Extensions
    • Tooling
    • Reference
    • Key commands, properties and inbuilt methods

    View Slide

  10. Examples on the website
    • Example with bootstrapped script online
    • Scripts run through Powershell
    • Permissions are critical here
    • You can run on Linux using Mono and Bash
    • Example includes
    • .NET Solution
    • Class library
    • Unit Test Project
    • Cake Script
    • Cleans, builds and tests

    View Slide

  11. Extending the example
    • Adding a console application to run a basic program
    • Uses the existing class library DLL
    • Changes to the example Build script
    • Adding tasks
    • Build the Console application
    • Clean out a deployment location
    • Deploy to a location
    • Running the deployed application
    • Let’s have a look

    View Slide

  12. Outcomes – My thoughts
    • Powerful tool
    • Cross platform (.NET CORE Ready)
    • Easy to pick-up
    • .NET friendly
    • Integrates with various existing tools
    • Does require some exposure and experience
    • Not sure exactly what the motivation to move to it would be

    View Slide