Skip to content

Commit

Permalink
(GH-5) Move to Cake.Recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
gep13 committed Feb 1, 2017
1 parent f8f9326 commit ea85135
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 90 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -272,4 +272,5 @@ __pycache__/

# Cake - Uncomment if you are using it
tools/**
!tools/packages.config
!tools/packages.config
BuildArtifacts/
10 changes: 1 addition & 9 deletions build.ps1
Expand Up @@ -5,14 +5,11 @@
##########################################################################

<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Script
The build script to execute.
.PARAMETER Target
Expand All @@ -32,10 +29,8 @@ Tells Cake to use the Mono scripting engine.
Skips restoring of packages.
.PARAMETER ScriptArgs
Remaining arguments are added here.
.LINK
http://cakebuild.net
#>

[CmdletBinding()]
Expand Down Expand Up @@ -165,7 +160,7 @@ if(-Not $SkipToolPackageRestore.IsPresent) {
}

Write-Verbose -Message "Restoring tools from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -PreRelease -OutputDirectory `"$TOOLS_DIR`" -Source https://www.myget.org/F/cake/api/v3/index.json"

if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring NuGet tools."
Expand All @@ -183,9 +178,6 @@ if (!(Test-Path $CAKE_EXE)) {
Throw "Could not find Cake.exe at $CAKE_EXE"
}

# Make sure that re-usable build.cake file exists.
Invoke-Expression "&`"$NUGET_EXE`" install gep13.DefaultBuild -ExcludeVersion -PreRelease -OutputDirectory `"$TOOLS_DIR`" -Source `"https://www.myget.org/F/gep13/api/v3/index.json`""

# Start Cake
Write-Host "Running build script..."
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
Expand Down
84 changes: 17 additions & 67 deletions setup.cake
@@ -1,72 +1,22 @@
///////////////////////////////////////////////////////////////////////////////
// ENVIRONMENT VARIABLE NAMES
///////////////////////////////////////////////////////////////////////////////
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease

private static string githubUserNameVariable = "GITHUB_USERNAME";
private static string githubPasswordVariable = "GITHUB_PASSWORD";
private static string myGetApiKeyVariable = "MYGET_API_KEY";
private static string myGetSourceUrlVariable = "MYGET_SOURCE";
private static string nuGetApiKeyVariable = "NUGET_API_KEY";
private static string nuGetSourceUrlVariable = "NUGET_SOURCE";
private static string chocolateyApiKeyVariable = "CHOCOLATEY_API_KEY";
private static string chocolateySourceUrlVariable = "CHOCOLATEY_SOURCE";
private static string gitterTokenVariable = "GITTER_TOKEN";
private static string gitterRoomIdVariable = "GITTER_ROOM_ID";
private static string slackTokenVariable = "SLACK_TOKEN";
private static string slackChannelVariable = "SLACK_CHANNEL";
private static string twitterConsumerKeyVariable = "TWITTER_CONSUMER_KEY";
private static string twitterConsumerSecretVariable = "TWITTER_CONSUMER_SECRET";
private static string twitterAccessTokenVariable = "TWITTER_ACCESS_TOKEN";
private static string twitterAccessTokenSecretVariable = "TWITTER_ACCESS_TOKEN_SECRET";
private static string appVeyorApiTokenVariable = "APPVEYOR_API_TOKEN";
private static string coverallsRepoTokenVariable = "COVERALLS_REPO_TOKEN";
Environment.SetVariableNames();

///////////////////////////////////////////////////////////////////////////////
// BUILD ACTIONS
///////////////////////////////////////////////////////////////////////////////
BuildParameters.SetParameters(context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "Cake.FluentMigrator",
repositoryOwner: "cake-contrib",
repositoryName: "Cake.FluentMigrator",
appVeyorAccountName: "cakecontrib");

var sendMessageToGitterRoom = true;
var sendMessageToSlackChannel = true;
var sendMessageToTwitter = true;
BuildParameters.PrintParamters(Context);

///////////////////////////////////////////////////////////////////////////////
// PROJECT SPECIFIC VARIABLES
///////////////////////////////////////////////////////////////////////////////
ToolSettings.SetToolSettings(context: Context,
dupFinderExcludePattern: new string[] {
BuildParameters.RootDirectoryPath + "/src/Cake.FluentMigrator.Tests/*.cs" },
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* ",
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs");

var rootDirectoryPath = MakeAbsolute(Context.Environment.WorkingDirectory);
var sourceDirectoryPath = "./src";
var solutionFilePath = "./src/Cake.FluentMigrator.sln";
var solutionDirectoryPath = "./src/Cake.FluentMigrator";
var title = "Cake.FluentMigrator";
var resharperSettingsFileName = "Cake.FluentMigrator.sln.DotSettings";
var repositoryOwner = "cake-contrib";
var repositoryName = "Cake.FluentMigrator";
var appVeyorAccountName = "cakecontrib";
var appVeyorProjectSlug = "cake-fluentmigrator";

// NOTE: Only populate this, if required, but leave as is otherwise.
var dupFinderExcludePattern = new string[] { rootDirectoryPath + "/src/Cake.FluentMigrator.Tests/*.cs" };
var testCoverageFilter = "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* ";
var testCoverageExcludeByAttribute = "*.ExcludeFromCodeCoverage*";
var testCoverageExcludeByFile = "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs";

///////////////////////////////////////////////////////////////////////////////
// CAKE FILES TO LOAD IN
///////////////////////////////////////////////////////////////////////////////

#l .\Tools\gep13.DefaultBuild\Content\appveyor.cake
#l .\Tools\gep13.DefaultBuild\Content\chocolatey.cake
#l .\Tools\gep13.DefaultBuild\Content\coveralls.cake
#l .\Tools\gep13.DefaultBuild\Content\credentials.cake
#l .\Tools\gep13.DefaultBuild\Content\gitreleasemanager.cake
#l .\Tools\gep13.DefaultBuild\Content\gitter.cake
#l .\Tools\gep13.DefaultBuild\Content\gitversion.cake
#l .\Tools\gep13.DefaultBuild\Content\nuget.cake
#l .\Tools\gep13.DefaultBuild\Content\packages.cake
#l .\Tools\gep13.DefaultBuild\Content\parameters.cake
#l .\Tools\gep13.DefaultBuild\Content\paths.cake
#l .\Tools\gep13.DefaultBuild\Content\resharper.cake
#l .\Tools\gep13.DefaultBuild\Content\slack.cake
#l .\Tools\gep13.DefaultBuild\Content\testing.cake
#l .\Tools\gep13.DefaultBuild\Content\twitter.cake
#l .\Tools\gep13.DefaultBuild\Content\build.cake
Build.Run();
13 changes: 1 addition & 12 deletions src/Cake.FluentMigrator.Tests/Cake.FluentMigrator.Tests.csproj
Expand Up @@ -41,24 +41,13 @@
<HintPath>..\packages\Cake.Core.0.17.0\lib\net45\Cake.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="NSubstitute, Version=1.10.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<HintPath>..\packages\NSubstitute.1.10.0.0\lib\net45\NSubstitute.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
<Link>Properties\SolutionInfo.cs</Link>
Expand Down
2 changes: 1 addition & 1 deletion tools/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake" version="0.17.0" />
<package id="Cake" version="0.18.0-alpha0033" />
</packages>

0 comments on commit ea85135

Please sign in to comment.