Skip to content
/ cake Public
forked from cake-build/cake

Cake (C# Make) is a build automation system inspired by Fake.

License

Notifications You must be signed in to change notification settings

FredrikL/cake

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Cake

Cake (C# Make) is a build automation system inspired by Fake.

TeamCity CI Build Status

##Roadmap

The Cake engine is pretty much done, but there are still improvements to be made. I'm still experimenting with the script API to make it as easy and intuitive as possible, so expect changes along the road.

Currently basic MSBuild, xUnit, NuGet, ILMerge, NUnit, MSTest, compression and file system operations are implemented, but more features are planned. The full roadmap can be found here.

For more information and examples of how to use Cake, see the Wiki.

##Example

###1. Download Cake

C:\Project> NuGet.exe install Cake -OutputDirectory Tools -ExcludeVersion

###2. Create build script

var target = Argument("target", "NuGet");
var configuration = Argument("configuration", "Release");

/////////////////////////////////////////////////

Task("Clean")
    .Does(() =>
{
    // Clean directories.
    CleanDirectory("./build");
    CleanDirectory("./build/bin");
    CleanDirectories("./src/**/bin/" + configuration);
});

Task("Restore-NuGet-Packages")
    .IsDependentOn("Clean")
    .Does(context =>
{
    NuGetRestore("./src/Cake.sln");    
});

Task("Build")
    .IsDependentOn("Restore-NuGet-Packages")
    .Does(() =>
{
    MSBuild("./src/Cake.sln", s => 
        s.SetConfiguration(configuration));
});

Task("Unit-Tests")
    .IsDependentOn("Build")
    .Does(() =>
{
    XUnit("./src/**/bin/" + configuration + "/*.Tests.dll");
});

Task("Copy-Files")
    .IsDependentOn("Unit-Tests")
    .Does(() =>
{
    var sourcePath = "./src/Cake/bin/" + configuration;    
    var files = GetFiles(sourcePath + "/**/*.dll") + GetFiles(sourcePath + "/**/*.exe");
    var destinationPath = "./build/bin";

    CopyFiles(files, destinationPath);
});

Task("Pack")
    .IsDependentOn("Copy-Files")
    .Does(() =>
{   
    var root = "./build/bin";
    var output = "./build/" + configuration + ".zip";

    Zip(root, output);
});

Task("NuGet")
    .IsDependentOn("Pack")
    .Does(() =>
{
    // Create NuGet package.
    NuGetPack("./Cake.nuspec", new NuGetPackSettings {
        Version = "0.1.0",
        BasePath = "./build/bin",
        OutputDirectory = "./build",
        NoPackageAnalysis = true
    });
});

/////////////////////////////////////////////////

RunTarget(target);

###3. Run build script

C:\Project\Tools\Cake> Cake.exe ../../build.csx -verbosity=verbose -target=Pack

About

Cake (C# Make) is a build automation system inspired by Fake.

Resources

License

Stars

Watchers

Forks

Packages

No packages published