Skip to content
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release/0.30.0'
Browse files Browse the repository at this point in the history
* release/0.30.0: (62 commits)
  Fix new SDK Version issues
  Updated to Cake 0.30.0
  Updated Cake dependencies to 0.28.0
  Updated to Cake 0.25.0.
  Updated Cake to 0.24.0.
  Updated Cake references to version 0.23.0.
  (maint) Switching to https
  Updated build script and bootstrappers.
  Bumped Cake dependencies to 0.21.1.
  Added Martin and Alistair to the list of authors.
  Should now find tasks properly on net461
  Entry assembly should now be found for net461.
  Added net461 as an additional target framework.
  Added a new description of how to get started with Frosting.
  Updated nuspec details.
  Bumped Cake.Frosting version to 0.1.0-alpha0056.
  Added dotnet new template.
  Updated documentation.
  Added bootstrapper.
  Updated .NET Core SDK to 1.0.1.
  ...
  • Loading branch information
devlead committed Nov 20, 2018
2 parents 64e226a + ad57a05 commit 68b0d99
Show file tree
Hide file tree
Showing 135 changed files with 2,686 additions and 1,116 deletions.
26 changes: 5 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,21 @@
# Misc folders
[Bb]in/
[Oo]bj/
[Tt]emp/
[Ll]ib/
[Pp]ackages/
/[Aa]rtifacts/
/[Tt]ools/
*.sln.ide/
/template/[Tt]ools/

# .NET CLI
# .NET Core CLI
/.dotnet/
dotnet-install.sh*
/.packages/
dotnet-install.sh*
*.lock.json

# Visual Studio
.vs/
.vscode/
launchSettings.json
project.lock.json

# Build related
build-results/
tools/Cake/
tools/xunit.runners/
tools/xunit.runner.console/
tools/nuget.exe
tools/gitreleasemanager/
tools/GitVersion.CommandLine/
tools/Addins/
tools/packages.config.md5sum

# mstest test results
TestResults
*.sln.ide/

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
Expand Down
150 changes: 51 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,128 +1,80 @@
# Frosting

[![AppVeyor branch](https://img.shields.io/appveyor/ci/cakebuild/frosting/develop.svg)](https://ci.appveyor.com/project/cakebuild/frosting/branch/develop)
[![MyGet](https://img.shields.io/myget/cake/vpre/Cake.Frosting.svg?label=myget)](https://www.myget.org/feed/cake/package/nuget/Cake.Frosting)

A .NET Core host for Cake, that allows you to write your build scripts as a
portable console application (`netstandard1.0`). Frosting is currently
(portable) console application (`netcoreapp1.1` or `net461`). Frosting is currently
in alpha, but more information, documentation and samples will be added soon.

**Expect things to move around initially. Especially naming of things.**

## Table of Contents

1. [Example](https://github.com/cake-build/frosting#example)
2. [Acknowledgement](https://github.com/cake-build/frosting#documentation)
2. [Acknowledgement](https://github.com/cake-build/frosting#acknowledgement)
3. [License](https://github.com/cake-build/frosting#license)
4. [Thanks](https://github.com/cake-build/frosting#thanks)
5. [Code of Conduct](https://github.com/cake-build/frosting#code-of-conduct)
6. [.NET Foundation](https://github.com/cake-build/frosting#net-foundation)

## Example

Start by adding a `project.json` file.
The `Cake.Frosting` package will decide what version of `Cake.Core` and `Cake.Common`
you will run.

```json
{
"version": "0.1.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Cake.Frosting": "0.1.0-alpha001",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
}
}

### 1. Install .NET Core SDK 1.0.4 or later

You can find the SDK at [https://www.microsoft.com/net/download/core](https://www.microsoft.com/net/download/core).

### 2. Install the template

Cake.Frosting is currently in preview, so you will have to specify the
template version explicitly.

```
> dotnet new --install Cake.Frosting.Template::0.1.0-*
```

### 3. Create a new Frosting project

Now it's time to create a new Frosting project.
Go to the repository where you want to add a new Frosting build script and run the following command:

```
> dotnet new cakefrosting
```

For the sake of keeping the example simple, all classes are listed after each other,
but you should of course treat the source code of your build scripts like any other
code and divide them up in individual files.

```csharp
using Cake.Core;
using Cake.Core.Diagnostics;
using Cake.Frosting;

public class Program
{
public static int Main(string[] args)
{
// Create the host.
var host = new CakeHostBuilder()
.WithArguments(args)
.ConfigureServices(services =>
{
// Use a custom settings class.
services.UseContext<MySettings>();
})
.Build();

// Run the host.
return host.Run();
}
}

public class MySettings : FrostingContext
{
public bool Magic { get; set; }

public MySettings(ICakeContext context)
: base(context)
{
// You could also use a CakeLifeTime<Settings>
// to provide a Setup method to setup the context.
Magic = context.Arguments.HasArgument("magic");
}
}

[TaskName("Provide-Another-Name-Like-This")]
public class Build : FrostingTask<MySettings>
{
public override bool ShouldRun(Settings context)
{
// Don't run this task on OSX.
return context.Environment.Platform.Family != PlatformFamily.OSX;
}

public override void Run(FrostingTask context)
{
context.Log.Information("Magic: {0}", context.Magic);
}
}

[Dependency(typeof(Build))]
public class Default : FrostingTask
{
// If you don't inherit from the generic task
// the standard ICakeContext will be provided.
}

```

To run the script, simply run it like any .NET Core application.
### 4. Profit

Now you should be able to run your newly created builds script.

```powershell
> dotnet restore
> dotnet run --verbosity=verbose --working="./.."
> ./build.ps1
```

**NOTE:** You're not supposed to commit the produced binaries to your repository.
The above command is what you're expected to run from your bootstrapper.

## Building from source

### .NET Core SDK

To build from source, you will need to have
[.NET Core SDK 1.0.4](https://www.microsoft.com/net/download/core)
installed on your machine.

### Visual Studio 2017 (optional)

If you want to develop using Visual Studio, then you need to use Visual Studio 2017 (15.2) or higher.

## Acknowledgement

The API for configuring and running the host have been heavily influenced by
the [ASP.NET Core hosting API](https://github.com/aspnet/Hosting).

## License

Copyright © Patrik Svensson, Mattias Karlsson, Gary Ewan Park and contributors.
Copyright © [.NET Foundation](http://dotnetfoundation.org/) and contributors.
Frosting is provided as-is under the MIT license. For more information see
[LICENSE](https://github.com/cake-build/cake/blob/develop/LICENSE).

* For Autofac, see https://github.com/autofac/Autofac/blob/master/LICENSE
[LICENSE](https://github.com/cake-build/frosting/blob/develop/LICENSE).

## Thanks

Expand All @@ -144,4 +96,4 @@ in our community. For more information see the [.NET Foundation Code of Conduct]

## .NET Foundation

This project is supported by the [.NET Foundation](http://www.dotnetfoundation.org).
This project is supported by the [.NET Foundation](http://www.dotnetfoundation.org).
24 changes: 24 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build script
init:
- git config --global core.autocrlf true

# Build script
build_script:
- ps: .\build.ps1 -Target "AppVeyor"

# Tests
test: off

# Branches to build
branches:
# Whitelist
only:
- develop
- master
- /r/.*/
- /release/.*/
- /hotfix/.*/

# Build cache
cache:
- tools -> build.cake
93 changes: 0 additions & 93 deletions build.cake

This file was deleted.

Loading

0 comments on commit 68b0d99

Please sign in to comment.