Skip to content

Commit c33d90e

Browse files
Build com testes e publicação de cobertura e pacote nuget usando cakebuild
1 parent 4bc8e8d commit c33d90e

14 files changed

+314
-224
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,5 @@ _Pvt_Extensions
236236
.fake/
237237
/src/*.tss
238238
/WSDL
239+
/tools
240+
/result.xml

.nuget/NuGet.Config

-6
This file was deleted.

.nuget/NuGet.exe

-1.59 MB
Binary file not shown.

.nuget/NuGet.targets

-143
This file was deleted.

.nuget/packages.config

-5
This file was deleted.

Boleto2.Net.Testes/Boleto2.Net.Testes.csproj

+3-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<DebugSymbols>true</DebugSymbols>
2727
<DebugType>full</DebugType>
2828
<Optimize>false</Optimize>
29-
<OutputPath>..\bin\Debug\</OutputPath>
29+
<OutputPath>bin\Debug\</OutputPath>
3030
<DefineConstants>DEBUG;TRACE</DefineConstants>
3131
<ErrorReport>prompt</ErrorReport>
3232
<WarningLevel>4</WarningLevel>
@@ -35,7 +35,7 @@
3535
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3636
<DebugType>pdbonly</DebugType>
3737
<Optimize>true</Optimize>
38-
<OutputPath>..\bin\Release\</OutputPath>
38+
<OutputPath>bin\Release\</OutputPath>
3939
<DefineConstants>TRACE</DefineConstants>
4040
<ErrorReport>prompt</ErrorReport>
4141
<WarningLevel>4</WarningLevel>
@@ -44,7 +44,6 @@
4444
<ItemGroup>
4545
<Reference Include="NReco.PdfGenerator, Version=1.1.12.0, Culture=neutral, PublicKeyToken=231663d50a41b451, processorArchitecture=MSIL">
4646
<HintPath>..\packages\NReco.PdfGenerator.1.1.12.0\lib\net20\NReco.PdfGenerator.dll</HintPath>
47-
<Private>True</Private>
4847
</Reference>
4948
<Reference Include="nunit.framework, Version=3.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
5049
<HintPath>..\packages\NUnit.3.7.1\lib\net40\nunit.framework.dll</HintPath>
@@ -80,9 +79,7 @@
8079
</ProjectReference>
8180
</ItemGroup>
8281
<ItemGroup>
83-
<None Include="packages.config">
84-
<SubType>Designer</SubType>
85-
</None>
82+
<None Include="packages.config" />
8683
</ItemGroup>
8784
<Choose>
8885
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">

Boleto2.Net.sln

+2-18
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,26 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24720.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26430.16
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boleto2.Net", "Boleto2.Net\Boleto2.Net.csproj", "{F173E80B-E36B-48AD-B483-A27F8CA86F3C}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Boleto2.Net.Testes", "Boleto2.Net.Testes\Boleto2.Net.Testes.csproj", "{92951948-996F-4F22-AB35-74B06C45E1D4}"
99
EndProject
1010
Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12-
Debug|.NET = Debug|.NET
1312
Debug|Any CPU = Debug|Any CPU
14-
Debug|Mixed Platforms = Debug|Mixed Platforms
15-
Release|.NET = Release|.NET
1613
Release|Any CPU = Release|Any CPU
17-
Release|Mixed Platforms = Release|Mixed Platforms
1814
EndGlobalSection
1915
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20-
{F173E80B-E36B-48AD-B483-A27F8CA86F3C}.Debug|.NET.ActiveCfg = Debug|Any CPU
2116
{F173E80B-E36B-48AD-B483-A27F8CA86F3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2217
{F173E80B-E36B-48AD-B483-A27F8CA86F3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
23-
{F173E80B-E36B-48AD-B483-A27F8CA86F3C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
24-
{F173E80B-E36B-48AD-B483-A27F8CA86F3C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
25-
{F173E80B-E36B-48AD-B483-A27F8CA86F3C}.Release|.NET.ActiveCfg = Release|Any CPU
2618
{F173E80B-E36B-48AD-B483-A27F8CA86F3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
2719
{F173E80B-E36B-48AD-B483-A27F8CA86F3C}.Release|Any CPU.Build.0 = Release|Any CPU
28-
{F173E80B-E36B-48AD-B483-A27F8CA86F3C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
29-
{F173E80B-E36B-48AD-B483-A27F8CA86F3C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
30-
{92951948-996F-4F22-AB35-74B06C45E1D4}.Debug|.NET.ActiveCfg = Debug|Any CPU
3120
{92951948-996F-4F22-AB35-74B06C45E1D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3221
{92951948-996F-4F22-AB35-74B06C45E1D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
33-
{92951948-996F-4F22-AB35-74B06C45E1D4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
34-
{92951948-996F-4F22-AB35-74B06C45E1D4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
35-
{92951948-996F-4F22-AB35-74B06C45E1D4}.Release|.NET.ActiveCfg = Release|Any CPU
3622
{92951948-996F-4F22-AB35-74B06C45E1D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
3723
{92951948-996F-4F22-AB35-74B06C45E1D4}.Release|Any CPU.Build.0 = Release|Any CPU
38-
{92951948-996F-4F22-AB35-74B06C45E1D4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
39-
{92951948-996F-4F22-AB35-74B06C45E1D4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
4024
EndGlobalSection
4125
GlobalSection(SolutionProperties) = preSolution
4226
HideSolutionNode = FALSE

Boleto2.Net/Boleto2.Net.csproj

+4-13
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<DebugSymbols>true</DebugSymbols>
2929
<DebugType>full</DebugType>
3030
<Optimize>false</Optimize>
31-
<OutputPath>..\bin\Debug\</OutputPath>
31+
<OutputPath>bin\Debug\</OutputPath>
3232
<DefineConstants>DEBUG;TRACE</DefineConstants>
3333
<ErrorReport>prompt</ErrorReport>
3434
<WarningLevel>4</WarningLevel>
@@ -37,7 +37,7 @@
3737
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3838
<DebugType>pdbonly</DebugType>
3939
<Optimize>true</Optimize>
40-
<OutputPath>..\bin\Release\</OutputPath>
40+
<OutputPath>bin\Release\</OutputPath>
4141
<DefineConstants>TRACE</DefineConstants>
4242
<ErrorReport>prompt</ErrorReport>
4343
<WarningLevel>4</WarningLevel>
@@ -46,7 +46,7 @@
4646
<ItemGroup>
4747
<Reference Include="Microsoft.CSharp" />
4848
<Reference Include="Microsoft.VisualBasic" />
49-
<Reference Include="NReco.PdfGenerator, Version=1.1.12.0, Culture=neutral, PublicKeyToken=231663d50a41b451, processorArchitecture=MSIL">
49+
<Reference Include="NReco.PdfGenerator">
5050
<HintPath>..\packages\NReco.PdfGenerator.1.1.12.0\lib\net20\NReco.PdfGenerator.dll</HintPath>
5151
<Private>True</Private>
5252
</Reference>
@@ -207,22 +207,13 @@
207207
</ItemGroup>
208208
<ItemGroup>
209209
<None Include="Boleto2.Net.nuspec" />
210-
<None Include="packages.config">
211-
<SubType>Designer</SubType>
212-
</None>
210+
<None Include="packages.config" />
213211
</ItemGroup>
214212
<ItemGroup>
215213
<Content Include="Como Implementar um novo Banco ou Carteira.txt" />
216214
</ItemGroup>
217215
<ItemGroup />
218216
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
219-
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
220-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
221-
<PropertyGroup>
222-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
223-
</PropertyGroup>
224-
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
225-
</Target>
226217
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
227218
Other similar extension points exist, see Microsoft.Common.targets.
228219
<Target Name="BeforeBuild">

Boleto2.Net/Boleto2.Net.csproj.user

-9
This file was deleted.

Boleto2.Net/Boleto2.Net.nuspec

-6 Bytes
Binary file not shown.

appveyor.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ environment:
33
matrix:
44
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
55
COVERALLS_REPO_TOKEN:
6-
secure: n1GGF5LOUx3ITCBy3FhfRJOhJBej9rUa9PeR8QDNeJRKPmVQf8TOId3jEzkyuahj
6+
secure: isaQ8N2liPbtG8Oi1y4EXmS33nj/Xdy4PSonzQBN2LXLBkfBChMVJnWCqinRxJPz
77

88
configuration: Release
99

10-
before_build:
11-
- nuget restore
10+
build_script:
11+
- ps: .\build.ps1 -Target CiBuild -Experimental
1212

13-
after_build:
14-
- ps: >-
15-
. .\build.ps1 Pack-Nuget
13+
test: off
14+
1615
artifacts:
1716
- path: '**\boleto*.nupkg'
1817
name: nuget

build.cake

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#addin Cake.Coveralls
2+
#tool "nuget:?package=NUnit.ConsoleRunner"
3+
#tool "nuget:?package=OpenCover"
4+
#tool coveralls.net
5+
using System.Xml.Linq;
6+
7+
var target = Argument("target", "Default");
8+
var configuration = Argument("configuration", "Release");
9+
10+
Task("RunNugetPack").WithCriteria(string.IsNullOrWhiteSpace(EnvironmentVariable("APPVEYOR_PULL_REQUEST_NUMBER"))).Does(() =>
11+
{
12+
DeleteFiles("*.nupkg");
13+
14+
var buildNumber = EnvironmentVariable("appveyor_build_version");
15+
var nuGetPackSettings = new NuGetPackSettings {
16+
Version = $"{buildNumber}",
17+
OutputDirectory = "./"
18+
};
19+
var nuspecFilePath = File("./Boleto2.Net/Boleto2.Net.nuspec");
20+
NuGetPack(nuspecFilePath, nuGetPackSettings);
21+
var nupkg = GetFiles("*.nupkg").First();
22+
});
23+
24+
Task("RunCoverage").IsDependentOn("Build").Does(() =>
25+
{
26+
OpenCover(tool => tool.NUnit3("./**/bin/Release/*.Testes.dll"),
27+
new FilePath("./coverage.xml"),
28+
new OpenCoverSettings().WithFilter("+[*]Boleto2Net.*").WithFilter("-[*]Boleto2Net.Testes.*")
29+
);
30+
CoverallsNet("coverage.xml", CoverallsNetReportType.OpenCover);
31+
});
32+
33+
Task("RunTests").IsDependentOn("Build").Does(() =>
34+
{
35+
var testAssemblies = GetFiles("./**/bin/Release/*.Testes.dll");
36+
NUnit3(testAssemblies, new NUnit3Settings { TeamCity = true });
37+
});
38+
39+
Task("RestorePackages").Does(() =>
40+
{
41+
NuGetRestore(File("Boleto2.Net.sln"), new NuGetRestoreSettings { NoCache = true });
42+
});
43+
44+
Task("Build").IsDependentOn("RestorePackages").Does(() =>
45+
{
46+
MSBuild("Boleto2.Net.sln", config => config.SetVerbosity(Verbosity.Minimal).SetConfiguration(configuration));
47+
});
48+
49+
Task("Default").IsDependentOn("Build").Does(() => {});
50+
Task("CiBuild").IsDependentOn("RunCoverage").IsDependentOn("RunNugetPack").Does(() => {});
51+
52+
RunTarget(target);

0 commit comments

Comments
 (0)