Git Product home page Git Product logo

cake-build / cake Goto Github PK

View Code? Open in Web Editor NEW
3.8K 3.8K 722.0 11.31 MB

:cake: Cake (C# Make) is a cross platform build automation system.

Home Page: https://cakebuild.net

License: MIT License

C# 99.91% PowerShell 0.06% Shell 0.03%
build-automation build-automation-tool build-tool c-sharp cake cake-build continuous-integration dotnet dotnetcore hacktoberfest nuget nunit orchestration unit-testing xunit

cake's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cake's Issues

Simplified task graph configuration

Simplified task graph configuration.

Graph("Clean")
   .Then("Build")
   .Then("Run-Unit-Tests", If(() => runTests))
   .Then("Copy-Files")
   .Then("Zip-Files", If(c => c.HasArgument("zipFiles")))
   .Then("Create-NuGet-Package")
   .Then("Publish-NuGet-Package", If(publish))
   .Then("All")

NuGet pack: Set nuspec metadata

  • id
  • title
  • version
  • authors
  • owners
  • description
  • summary
  • projectUrl
  • iconUrl
  • licenseUrl
  • copyright
  • requireLicenseAcceptance
  • releaseNotes
  • tags

ILMerge support

var outputAssembly = "./output/merged.exe";
var primaryAssembly = "./build/application.exe";
var assemblyPaths = GetFiles("/build/*.dll");

ILMerge(outputAssembly, primaryAssembly, assemblyPaths, 
    new ILMergeSettings {
        TargetKind = TargetKind.Exe,
        Internalize = true    
    }
);

Add method to describe tasks

Add option to add a description to a task.

Task("Magic")
   .HasDescription("Performs magic")
   .Does(() =>
{
   DoMagic();
});

When starting Cake with the -showtasks parameter, the following output should be shown.

Tasks         Description
===============================
Magic         Performs magic

Add friendly name to tasks

The friendly name should be used when printing the task name in the output or presenting the task in the report.

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

TeamCity support

Should probably introduce script alias properties to make it cleaner and easier to use.

  • Set build version
  • Block opened/closed
  • Progress message/start/finish
  • Publish artifact

Script aliases:

// Detect if this is a team city build
bool IsTeamCityBuild();

// Set progress.
void SetTeamCityProgress("Building things");

// Start and finish progress scope.
void StartTeamCityProgress("Building things");
void FinishTeamCityProgress("Building thing");

// Set build version.
void SetTeamCityBuildVersion("1.0.0");

// Open and close message block.
void OpenTeamCityBlock("Run unit tests");
void CloseTeamCityBlock("Run unit tests");

// Publish artifact.
PublishTeamCityArtifact("./bin/**/*");

Convenience:

// Report progress
using(TeamCityProgress("Building things")
{
    // Do magic 
}

// Wrap operations in message block.
using(TeamCityBlock("Run unit tests"))
{
    // Do magic
}

Make a difference between running order and dependencies

A dependency is something that HAS to be run before something else. If it does not have to be run, it should allow the task to run anyway.

Task("First")
   .WithCriteria(() => shouldDoStuff)
   .Does(() =>
{
});

Task("Second")
   .RunsAfter("First")
   .Does(() =>
{
});

Task("Third")
   .IsDependentOn("Second")
   .Does(() =>
{
});

In the example before, the task Second will be run regardless if shouldDoStuff was true or not, Third is dependent on Second though, so if Second did not run, an exception will be thrown.

Add tools path option

By convention, all external tools are located under ./tools/thetool/. All script extensions that uses external tools should have a tool path option, so the script can tell were to find them.

Task("NuGet")
    .IsDependentOn("Pack")
    .Does(() =>
{
    // Create NuGet package.
    NuGetPack("./Cake.nuspec", new NuGetPackSettings
    {
        Version = "0.1.0",
        BasePath = "./src/Cake/bin/" + configuration,
        OutputDirectory = "./build",
        NoPackageAnalysis = true,
        ToolPath = @"C:/NuGet.exe"
    });
});

Benchmark report

The Cake engine should return a benchmark report if the built went well.

NuGet packaging support

Start out with minimal package support.
For example; files, references and release notes have to be added as part of nuspec file, but version information can be passed to method directly.

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

Templating support should be added later on.

MSBuild support

Features:

  • Properties
  • Targets
  • Configuration
  • 64 bit support (AMD64)
  • Platform target support

Versions:

  • Visual Studio 2013
  • Visual Studio 2012
  • Visual Studio 2010
  • Visual Studio 2008
  • Visual Studio 2005

Add script alias methods that accept strings

  • void CopyFiles(IEnumerable<string> files, DirectoryPath target)
  • void CleanDirectories(IEnumerable<string> directories)
  • void DeleteDirectories(IEnumerable<string> directories, bool recursive = false)
  • void Zip(DirectoryPath root, FilePath output, IEnumerable<string> files)
  • void XUnit(IEnumerable<string> assemblies)
  • void XUnit(IEnumerable<string> assemblies, XUnitSettings settings)
  • void NUnit(IEnumerable<string> assemblies)
  • void NUnit(IEnumerable<string> assemblies, NUnitSettings settings)

Generate script host methods

At the moment, all script host methods exposing functionality from ICakeContext is hard coded. These should be generated before executing the script.

This will also eliminate the need for a separate script host (and a lot of redundant code).

Example

If this extension method is declared:

namespace MyStuff
{
   public static class MyFunctionality
   {
      public static void DoMagic(this ICakeContext context, int value)
      {
         context.Log.Verbose("Hello: {0}", value)
      }
   }
}

We could add a using statement to namespace MyStuff and generate a script method:

public void DoMagic(int value)
{
   ((ICakeContext)this).DoMagic(value);
}

Or call the extension method like a normal method:

public void DoMagic(int value)
{
   MyStuff.MyFunctionality.DoMagic((ICakeContext)this, value);
}

Unicorns.

Needs more unicorns. They are fabulous.

Steps to take

  • add unicorn
  • make sure it is fabulous
  • ???
  • profit

You can have mine.
unicorn

xUnit support

  • Run unit tests
  • Shadow copying
  • Output directory
  • Xml report
  • Html report

Custom collections for file and directory paths

They could also use operator overloading (+ and -) to make it easier to add and remove files. Globber should return these collections.

Examples

GetFiles("bin/**/*")
   .Remove(GetFiles("bin/**/*.md"))
   .Add(GetFiles("other/**/*.dll");
GetFiles("bin/**/*") 
   - GetFiles("bin/**/*.md") 
   + GetFiles("other/**/*.dll");

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.