Icing on the Cake – reviewing the recipe for 2016

As 2016 is just about to be fully baked, the year has been packed with many ingredients, with this post we would like to take the opportunity to reflect on a few of the essences of what's been a truly amazing and eventful Cake year.

Community

First of all we must highlight, and send a big THANK YOU to, the amazing community that has formed around Cake!

There are now over one hundred individual contributors to the various Cake projects, helping out with documentation, adding new features, raising issues and fixing bugs. In addition, over a quarter of a million downloads of the main Cake NuGet package! Together, with you, during 2016 we released no less than fifteen releases!

As maintainers of an open source project it's both amazing and humbling so see how people are getting a taste for your project and going out speaking, blogging, tweeting and helping out fellow bakers on the Gitter chat, Stack Overflow, forums and social media.

Debugging support

In May we added support for debugging your Cake scripts with Visual Studio, enabling you to do things like stepping through code, setting break points and watch variables. In September we added debugging in VSCode as well.

.NET Foundation

One of the bigger announcements of 2016, was in June when Gary at NDC Oslo announced that Cake joins the .NET foundation. Joining the foundation ensures the longevity of the Cake project, making sure it's here to stay and has the resources to do so.

Cake Contribution Organization

In August we launched the Cake Contribution Organization to ensure that any addins and modules that are created, can continue to be maintained, should the original developer no longer be in a position to maintain it. It has been very well received and there's now almost one hundred NuGet packages that have adopted the cake-contrib as a co-maintainer of the package and twenty-six projects that have chosen to move their repositories into the GitHub organization.

.NET Core support

Cake was early to support the .NET Core tooling, but in September we announced Cake v0.16.0 released. With this release finally Cake itself was able to run cross platform on .NET Core. This was the largest refactoring we've ever done and it was a great feeling to get that out the door!

The Team

In December we added an additional member to the team, Alistair Chapman, he's been an amazing asset, contributing directly to Cake, surrounding tooling and in supporting the community. He's been the mastermind behind the Cake for Visual Studio extension and Cake for Yeoman.

In the spotlight

2016 certainly feels like the year awareness of the project exponentially increased, Cake core team members appeared on no less than six podcasts, a number of conference presentations, articles in the news and blog posts. It's truly amazing and humbling feeling that so many have found and appreciate the project.

Closing words

Yet again a big thanks do all that have contributed to Cake, 2016 has been a great journey and we're really looking forward to what 2017 will bring!

The Cake Team thanks you for 2016 and wishes you Happy New Year!

happy new year

Installing prerelease versions of Cake for Visual Studio

We released the Cake for Visual Studio extension back in September and have been thrilled with the response from the whole community. There's been plenty of activity over on the GitHub repo with new issues, bug reports, features and even PRs. Now, you can get the benefits of all the brand new features as they arrive, right in Visual Studio.

Read more...

Cake v0.17.0 released

Version 0.17.0 of Cake has been released.

This release of Cake sees a number of new features added, as well as some bug fixes, however, most importantly, there was a breaking change.

This breaking change centred around the VSTestSettings class, where the decision was wait to allow custom loggers to be passed into the VSTestRunner. As a result, the previous enumeration named VSTestLogger has been removed, and replaced with a fully customizable string. If you are using this enumeration in your scripts then you will see errors being generated if you update to the latest version of Cake. You should be able to make use of the new extension methods called WithVisualStudioLogger and WithAppVeyorLogger on the VSTestSettings to replace the enumeration values.

Please let us know if you run into any issues with this latest release.

Once again, the Cake Team have been overwhelmed by the number of contributions from our Community Members. Simply put... THANK YOU!

Contributions were included from:

Full details of everything that was included in this release can be seen below.

Read more...

Email addins released

There are many scenarios where you need to send notifications during your build process, such as notifying colleagues that a build has passed/failed, notifying stakeholders that a package has been published to nuget, etc. One of the most popular ways to send such notification is, of course, email. That's why we recently released three new addins to send emails.

Cake.Email

The first addin allows you to send emails via your own SMTP server.

When invoking the Email.SendEmail alias, you must specify the name and email address of the sender (this is what the recipient will see in the from field when they receive your email). Typically, you would use your name and email address but you could use a generic address such as notifications@yourcompany.com), the name and email address of the recipient, the subject and content of the email, a boolean value indicating if the content should be sent as HTML or plain text and finally you must also specify the settings that are necessary to establish a connection to your SMTP server.

The source is available on GitHub.

Here's a code sample that demonstrates how you can send an email from a Cake task:

#addin Cake.Email

Task("SendEmail")
    .Does(() =>
{
    try
    {
        var result = Email.Send(
                senderName: "Bob Smith", 
                senderAddress: "bob@example.com",
                recipientName: "Jane Doe",
                recipientAddress: "jane@example.com",
                subject: "This is a test",
                content: "<html><body>This is a test</body></html>",
                sendAsHtml: true,
                settings: new EmailSettings 
                {
                    SmtpHost = "smtp.gmail.com",
                    Port = 587,
                    EnableSsl = true,
                    Username = "my_gmail_address@gmail.com",
                    Password = "my_password"
                }
        );

        if (result.Ok)
        {
            Information("Email succcessfully sent");
        }
        else
        {
            Error("Failed to send email: {0}", result.Error);
        }
    }
    catch(Exception ex)
    {
        Error("{0}", ex);
    }
});

Cake.SendGrid

The second addin allows you to send emails via a third-party Email Service Provider (ESP) called SendGrid. The parameters you pass to the SendGrid.SendEmail alias are very similar to what we described earlier except that it accepts both the HTML and the plain text versions which will be sent in the same "multi-part" email, and also the only setting expected by SendGrid is your API Key.

The source is available on GitHub.

Please note that this addin has a dependency on a library I created which allows using SendGrid's v3 API. The library is called StrongGrid and source is available on GitHub.

Here's a code sample that demonstrates how you can send an email via SendGrid from a Cake task:

#addin Cake.SendGrid

var sendGridApiKey = EnvironmentVariable("SENDGRID_API_KEY");

Task("SendEmail")
    .Does(() =>
{
    try
    {
        var result = SendGrid.SendEmail(
                senderName: "Bob Smith", 
                senderAddress: "bob@example.com",
                recipientName: "Jane Doe",
                recipientAddress: "jane@example.com",
                subject: "This is a test",
                htmlContent: "<html><body>This is a test</body></html>",
                textContent: "This is a test",
                settings: new SendGridEmailSettings { ApiKey = sendGridApiKey }
        );

        if (result.Ok)
        {
            Information("Email succcessfully sent");
        }
        else
        {
            Error("Failed to send email: {0}", result.Error);
        }
    }
    catch(Exception ex)
    {
        Error("{0}", ex);
    }
});

Cake.CakeMail

And finally, the third addin allows you to send emails via another ESP called CakeMail (the fact that their name contains 'Cake' is totally coincidental!). Once again, the expected parameters are very similar except that they do not allow setting the name of the recipient and they expect a username and password in addition to an API key.

The source is available on GitHub.

Please note that this addin has a dependency on a library I created which allows using CakeMail's API. The library is called CakeMail.RestClient and source is available on GitHub.

Here's a code sample that demonstrates how you can send an email via CakeMail from a Cake task:

#addin Cake.CakeMail

var apiKey = EnvironmentVariable("CAKEMAIL_API_KEY");
var userName = EnvironmentVariable("CAKEMAIL_USERNAME");
var password = EnvironmentVariable("CAKEMAIL_PASSWORD");

Task("SendEmail")
    .Does(() =>
{
    try
    {
        var result = CakeMail.SendEmail(
                senderName: "Bob Smith", 
                senderAddress: "bob@example.com",
                recipientAddress: "jane@example.com",
                subject: "This is a test",
                htmlContent: "<html><body>This is a test</body></html>",
                textContent: "This is a test",
                settings: new CakeMailEmailSettings
                {
                    ApiKey = apiKey,
                    UserName = userName,
                    Password = password
                }
        );

        if (result.Ok)
        {
            Information("Email succcessfully sent");
        }
        else
        {
            Error("Failed to send email: {0}", result.Error);
        }
    }
    catch(Exception ex)
    {
        Error("{0}", ex);
    }
});

Cake v0.16.2 released

Version 0.16.2 of Cake has been released.

Following the release of Cake v0.16.1, Redth identified an issue with Cake not being identified as a .NET assembly when launched from a Mono process. With the help of akoeplinger we identified the issue in the Mono runtime and the PE32+ format assemblies generated by Roslyn/csc.exe when targeting x64 (which is the default in .NET Core project.json toolchain). akoeplinger has already submitted a pull request to Mono for this, so we expect this to be fixed in future versions of Mono, meanwhile the workaround is to set platform to use AnyCPU explicitly in the project.json file.

As a result, v0.16.2 of Cake is now available.

Please let us know if you run into any issues with this latest release.

Full details of everything that was included in this release can be seen below.

Read more...