Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Cake Build #59

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.{config,xml,js,json,html,css,sql,csproj,props,yml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.sh]
end_of_line = lf

[*.{cmd, bat}]
end_of_line = crlf
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ AppPackages/
*.DS_Store

_book
/node_modules
/node_modules

# Cake
tools/**
!tools/packages.config

# Artifacts
artifacts/**
40 changes: 23 additions & 17 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
version: 4.1.7.{build}

branches:
only:
- master
- develop
- develop
- master

skip_tags: true

skip_commits:
files:
- docs/*
- docs/**/*
- '**/*.html'
image: Visual Studio 2017
build_script:
- cmd: >-
@echo off

cls

If Not Exist src\.nuget\nuget.exe msbuild src\.nuget\NuGet.targets -Target:RestorePackages
image:
- Visual Studio 2017

If Not Exist src\packages\FAKE\tools\fake.exe src\.nuget\nuget.exe Install FAKE -OutputDirectory "src\packages" -ExcludeVersion
build: off
test: off

src\packages\FAKE\tools\fake.exe build.fsx %*
test:
assemblies: src/Automatonymous.Tests/bin/Release/Automatonymous.Tests.dll
artifacts:
- path: build_artifacts/*.nupkg
- path: build_artifacts/*.xml
- path: artifacts/*.*nupkg
name: Packages

build_script:
- ps: .\Build.ps1

deploy:
- provider: NuGet
name: Prerelease
api_key:
secure: 0B2TmwiOnNW+CavGbvgr6S8WcuB2A/5enkf/ZrlRW+8Q8AwW5P9T7+B3QDAtYiEi
on:
branch: develop
- provider: NuGet
name: Release
api_key:
secure: 0B2TmwiOnNW+CavGbvgr6S8WcuB2A/5enkf/ZrlRW+8Q8AwW5P9T7+B3QDAtYiEi
on:
branch: master

5 changes: 0 additions & 5 deletions build.bat

This file was deleted.

110 changes: 110 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
//////////////////////////////////////////////////////////////////////
// TOOLS
//////////////////////////////////////////////////////////////////////

// Load other scripts.
#load "./build/parameters.cake"

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");

//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////

Setup<BuildParameters>(setupContext =>
{
var buildParams = BuildParameters.GetParameters(setupContext);
buildParams.Initialize(setupContext);
return buildParams;
});

//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Task("Clean")
.Does<BuildParameters>(data =>
{
CleanDirectories($"./src/**/obj/{data.Configuration}");
CleanDirectories($"./src/**/bin/{data.Configuration}");
CleanDirectory(data.Paths.Directories.Artifacts);
});

Task("CleanAll")
.Does<BuildParameters>(data =>
{
CleanDirectories($"./src/**/obj");
CleanDirectories($"./src/**/bin");
CleanDirectory(data.Paths.Directories.Artifacts);
});

Task("Restore-NuGet")
.Does<BuildParameters>(data =>
{
DotNetCoreRestore(data.Paths.Directories.Solution.FullPath);
});

Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Restore-NuGet")
.Does<BuildParameters>(data =>
{
var settings = new DotNetCoreBuildSettings{
NoRestore = true,
Configuration = data.Configuration,
MSBuildSettings = new DotNetCoreMSBuildSettings().WithProperty("Version", data.Version.Version)
};

DotNetCoreBuild(data.Paths.Directories.Solution.FullPath, settings);
});

Task("Test")
.IsDependentOn("Build")
.Does<BuildParameters>(data =>
{
var settings = new DotNetCoreTestSettings
{
NoBuild = true,
Configuration = data.Configuration,
DiagnosticOutput = true
};

if(data.IsRunningOnAppVeyor) settings.ArgumentCustomization = args => args.Append($"--test-adapter-path:.").Append("--logger:Appveyor");

DotNetCoreTest(data.Paths.Directories.Solution.FullPath, settings);
});

Task("Pack")
.IsDependentOn("Build")
// .WithCriteria<BuildParameters>((context,data) => data.ShouldPublish)
.Does<BuildParameters>(data =>
{
var settings = new DotNetCorePackSettings{
NoBuild = true,
OutputDirectory = data.Paths.Directories.Artifacts,
Configuration = data.Configuration,
MSBuildSettings = new DotNetCoreMSBuildSettings().WithProperty("Version", data.Version.Version)
};
DotNetCorePack(data.Paths.Directories.Solution.FullPath, settings);
});

//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

Task("Default")
.IsDependentOn("Clean")
.IsDependentOn("Restore-NuGet")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("Pack");

//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////

RunTarget(target);
108 changes: 0 additions & 108 deletions build.fsx

This file was deleted.

Loading