Skip to content

Commit

Permalink
Merge pull request #52 from cake-contrib/release/1.0.0
Browse files Browse the repository at this point in the history
Release/1.0.0
  • Loading branch information
mvput authored Jun 8, 2021
2 parents e883b1f + 0562eb2 commit 2e3c306
Show file tree
Hide file tree
Showing 14 changed files with 365 additions and 76 deletions.
13 changes: 7 additions & 6 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#---------------------------------#
# Build Image #
#---------------------------------#
image: Visual Studio 2017
image: Visual Studio 2019

#---------------------------------#
# Build Script #
#---------------------------------#
build_script:
- ps: .\build.ps1 -Target AppVeyor
- ps: .\build.ps1 --bootstrap
- ps: .\build.ps1 --target=CI

#---------------------------------#
# Tests
Expand All @@ -33,18 +34,18 @@ branches:
only:
- develop
- master
- /release\/.*/
- /hotfix\/.*/
- /release/.*/
- /hotfix/.*/

#---------------------------------#
# Build Cache #
#---------------------------------#
cache:
- tools -> recipe.cake, tools/packages.config
- tools -> recipe.cake

#---------------------------------#
# Skip builds for doc changes #
#---------------------------------#
skip_commits:
# Regex for matching commit message
message: /\(doc\).*/
message: /\(doc\).*/
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ Cake.DotNetCoreEf is an Addin that extends [Cake](http://cakebuild.net/) for exe

- [Documentation](https://cake-contrib.github.io/Cake.DotNetCoreEf/)

## Chat Room
## Discussion

Come join in the conversation about Cake.DotNetCoreEf in our Gitter Chat Room
For questions and to discuss ideas & feature requests, use the [GitHub discussions on the Cake GitHub repository](https://github.com/cake-build/cake/discussions), under the [Extension Q&A](https://github.com/cake-build/cake/discussions/categories/extension-q-a) category.

[![Join the chat at https://gitter.im/cake-contrib/Lobby](https://badges.gitter.im/cake-contrib/Lobby.svg)](https://gitter.im/cake-contrib/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join in the discussion on the Cake repository](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/cake-build/cake/discussions)

## Contribution GuideLines

Expand Down
2 changes: 1 addition & 1 deletion docs/input/blog/new-release-0.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Within this release, the following things have been done...

- [__#8__](https://github.com/cake-contrib/Cake.DotNetCoreEf/issues/8) Add Wyam Documentation generation

Please do not hesitate to reach out in the [Gitter Channel](https://gitter.im/cake-contrib/Lobby) if you have any issues using this addin.
Please do not hesitate to reach out in the [GitHub discussions](https://github.com/cake-build/cake/discussions) if you have any issues using this addin.
2 changes: 1 addition & 1 deletion docs/input/blog/new-release-0.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Within this release, the following things have been done...
- [__#13__](https://github.com/cake-contrib/Cake.DotNetCoreEf/issues/13) Support for migrations remove
- [__#14__](https://github.com/cake-contrib/Cake.DotNetCoreEf/issues/14) Support for migrations script

Please do not hesitate to reach out in the [Gitter Channel](https://gitter.im/cake-contrib/Lobby) if you have any issues using this addin.
Please do not hesitate to reach out in the [GitHub discussions](https://github.com/cake-build/cake/discussions), if you have any issues using this addin.
16 changes: 9 additions & 7 deletions recipe.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load nuget:?package=Cake.Recipe&version=1.0.0
#load nuget:?package=Cake.Recipe&version=2.2.1

Environment.SetVariableNames();

Expand All @@ -8,18 +8,20 @@ BuildParameters.SetParameters(context: Context,
title: "Cake.DotNetCoreEf",
repositoryOwner: "cake-contrib",
repositoryName: "Cake.DotNetCoreEf",
shouldRunDotNetCorePack: true,
shouldRunDupFinder: false,
shouldRunInspectCode: false,
shouldRunCodecov: false,
shouldGenerateDocumentation: false, // until wyam oin recipe is fixed
appVeyorAccountName: "cakecontrib",
shouldRunGitVersion: true);
shouldRunDotNetCorePack: true);

BuildParameters.PrintParameters(Context);

ToolSettings.SetToolSettings(context: Context,
dupFinderExcludePattern: new string[] {
BuildParameters.RootDirectoryPath + "/src/Cake.DotNetCoreEf.Tests/**/*.cs" },
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* ",
BuildParameters.RootDirectoryPath + "/src/**/*.AssemblyInfo.cs",
BuildParameters.RootDirectoryPath + "/src/Cake.DotNetCoreEf/Migration/DotNetCoreEfMigrationLister.cs",
BuildParameters.RootDirectoryPath + "/src/Cake.DotNetCoreEf/DotNetCoreEfTool.cs",
BuildParameters.RootDirectoryPath + "/src/Cake.DotNetCoreEf.UnitTests/**/*.cs" },
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* -[FakeItEasy]* -[FluentAssertions]* -[FluentAssertions.Core]*",
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs");

Expand Down
25 changes: 15 additions & 10 deletions src/Cake.DotNetCoreEf.UnitTests/Cake.DotNetCoreEf.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFrameworks>net5.0</TargetFrameworks>

<IsPackable>false</IsPackable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Common" Version="0.33.0" />
<PackageReference Include="Cake.Core" Version="0.33.0" />
<PackageReference Include="Cake.Testing" Version="0.33.0" />
<PackageReference Include="Castle.Core" Version="4.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="Cake.Common" Version="1.0.0" />
<PackageReference Include="Cake.Core" Version="1.0.0" />
<PackageReference Include="Cake.Testing" Version="1.0.0" />
<PackageReference Include="Castle.Core" Version="4.4.1" />
<PackageReference Include="coverlet.msbuild" Version="3.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.analyzers" Version="0.10.0" />
<PackageReference Include="xunit.runner.console" Version="2.4.0">
<PackageReference Include="xunit.runner.console" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0">
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Cake.DotNetCoreEf.Migration;

namespace Cake.DotNetCoreEf.Tests.Fixtures.Migration
{
internal sealed class DotNetCoreEfMigrationListerFixture : DotNetCoreEfFixture<DotNetCoreEfMigrationListerSettings>
{
public string Project { get; set; }

public string Arguments { get; set; }

protected override void RunTool()
{
var tool = new DotNetCoreEfMigrationLister(FileSystem, Environment, ProcessRunner, Tools);
tool.Script(Project, Arguments, Settings);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
using Cake.DotNetCoreEf.Tests.Fixtures.Migration;
using Cake.Testing;
using Xunit;

namespace Cake.DotNetCoreEf.Tests.Unit.Migration
{
public sealed class DotNetCoreEfMigrationScriptListerTests
{

[Fact]
public void Should_Throw_If_Settings_Are_Null()
{
// Given
var fixture = new DotNetCoreEfMigrationListerFixture();
fixture.Project = "./src/";
fixture.Settings = null;
fixture.GivenDefaultToolDoNotExist();

// When
var result = Record.Exception(() => fixture.Run());

// Then
AssertExtensions.IsArgumentNullException(result, "settings");
}

[Fact]
public void Should_Throw_If_Process_Was_Not_Started()
{
// Given
var fixture = new DotNetCoreEfMigrationListerFixture();
fixture.Project = "./src/";
fixture.GivenProcessCannotStart();

// When
var result = Record.Exception(() => fixture.Run());

// Then
AssertExtensions.IsCakeException(result, ".NET Core CLI: Process was not started.");
}

// Removed. Process returns json
//[Fact]
//public void Should_Throw_If_Process_Has_A_Non_Zero_Exit_Code()
//{
// // Given
// var fixture = new DotNetCoreEfMigrationScriptListerFixture();
// fixture.Project = "./src/";
// fixture.GivenProcessExitsWithCode(1);

// // When
// var result = Record.Exception(() => fixture.Run());

// // Then
// AssertExtensions.IsCakeException(result, ".NET Core CLI: Process returned an error (exit code 1).");
//}

[Fact]
public void Should_Add_Mandatory_Arguments()
{
// Given
var fixture = new DotNetCoreEfMigrationListerFixture();

// When
var result = fixture.Run();

// Then
Assert.Equal("ef migrations list --no-build --json", result.Args);
}

[Fact]
public void Should_Add_Path_Arguments()
{
// Given
var fixture = new DotNetCoreEfMigrationListerFixture();
fixture.Project = "./tools/tool/";
fixture.Arguments = "--args=\"value\"";
// When
var result = fixture.Run();

// Then
Assert.Equal("ef migrations list --no-build --json --args=\"value\"", result.Args);
Assert.Equal("/Working/tools/tool", result.Process.WorkingDirectory.FullPath);
}

[Fact]
public void Should_Add_Additional_Settings()
{
// Given
var fixture = new DotNetCoreEfMigrationListerFixture();
fixture.Settings.StartupProject = "./src/MyMvcProject";
fixture.Settings.Project = "./src/MyDataProject";
fixture.Settings.Configuration = "release";
fixture.Settings.PrefixOutput = true;
fixture.Settings.NoBuild = true;
// When
var result = fixture.Run();

// Then
Assert.Equal("ef migrations list --project \"./src/MyDataProject\" --startup-project \"./src/MyMvcProject\" --prefix-output --no-build --json", result.Args);
}
}
}
82 changes: 41 additions & 41 deletions src/Cake.DotNetCoreEf.sln
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2041
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.DotNetCoreEf", "Cake.DotNetCoreEf\Cake.DotNetCoreEf.csproj", "{EF4D86EB-7401-4E38-A02B-AB4884DCB168}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{77CAC347-B714-4AD6-9932-328C59DC9B2B}"
ProjectSection(SolutionItems) = preProject
..\.appveyor.yml = ..\.appveyor.yml
..\build.ps1 = ..\build.ps1
..\nuspec\Cake.DotNetCoreEf.nuspec = ..\nuspec\Cake.DotNetCoreEf.nuspec
..\LICENSE = ..\LICENSE
..\README.md = ..\README.md
..\recipe.cake = ..\recipe.cake
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.DotNetCoreEf.UnitTests", "Cake.DotNetCoreEf.UnitTests\Cake.DotNetCoreEf.UnitTests.csproj", "{8C502FAA-A13C-4051-9716-1C41A4596BED}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Release|Any CPU.Build.0 = Release|Any CPU
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {732C4874-8EF7-42F1-82E0-DFF23CD78A46}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2041
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cake.DotNetCoreEf", "Cake.DotNetCoreEf\Cake.DotNetCoreEf.csproj", "{EF4D86EB-7401-4E38-A02B-AB4884DCB168}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "meta", "meta", "{77CAC347-B714-4AD6-9932-328C59DC9B2B}"
ProjectSection(SolutionItems) = preProject
..\.appveyor.yml = ..\.appveyor.yml
..\build.ps1 = ..\build.ps1
..\nuspec\Cake.DotNetCoreEf.nuspec = ..\nuspec\Cake.DotNetCoreEf.nuspec
..\LICENSE = ..\LICENSE
..\README.md = ..\README.md
..\recipe.cake = ..\recipe.cake
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.DotNetCoreEf.UnitTests", "Cake.DotNetCoreEf.UnitTests\Cake.DotNetCoreEf.UnitTests.csproj", "{8C502FAA-A13C-4051-9716-1C41A4596BED}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF4D86EB-7401-4E38-A02B-AB4884DCB168}.Release|Any CPU.Build.0 = Release|Any CPU
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C502FAA-A13C-4051-9716-1C41A4596BED}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {732C4874-8EF7-42F1-82E0-DFF23CD78A46}
EndGlobalSection
EndGlobal
12 changes: 6 additions & 6 deletions src/Cake.DotNetCoreEf/Cake.DotNetCoreEf.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net5.0;net461</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<OutputType>Library</OutputType>
<DebugType>pdbonly</DebugType>
Expand All @@ -11,22 +11,22 @@
<PackageId>Cake.DotNetCoreEf</PackageId>
<Title>Cake.DotNetCoreEf</Title>
<Summary>.NET Core EntityFrameworkCore addin for cake build.</Summary>
<Description>Cake addin for executing commands with the dotnet ef command line interface (CLI). </Description>
<Description>Cake addin for executing commands with the dotnet ef command line interface (CLI).</Description>
<Authors>mvput</Authors>
<Owners>mvput,cake-contrib</Owners>
<PackageProjectUrl>https://github.com/cake-contrib/Cake.DotNetCoreEf</PackageProjectUrl>
<PackageIconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/cake-contrib-medium.png</PackageIconUrl>
<PackageIconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/addin/cake-contrib-addin-medium.png</PackageIconUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/cake-contrib/Cake.DotNetCoreEf.git</RepositoryUrl>
<tags>cake script cli netcore efcore</tags>
<tags>cake script cli netcore efcore cake-addin</tags>
<Copyright>Copyright (c) Cake Contributions 2016 - Present</Copyright>
<Company>Cake Contributions</Company>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.33.0" PrivateAssets="All" />
<PackageReference Include="Cake.Common" Version="0.33.0" PrivateAssets="All" />
<PackageReference Include="Cake.Core" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Common" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

</Project>
Loading

0 comments on commit 2e3c306

Please sign in to comment.