forked from loresoft/DataGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaster.proj
110 lines (83 loc) · 4.44 KB
/
Master.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildFolder>$(MSBuildProjectDirectory)\Build</BuildFolder>
<ToolFolder>$(MSBuildProjectDirectory)\Tools</ToolFolder>
<SourceFolder>$(MSBuildProjectDirectory)\src</SourceFolder>
<TestFolder>$(MSBuildProjectDirectory)\test</TestFolder>
<CoverallsPath>$(ToolFolder)\coveralls.net\tools</CoverallsPath>
<MSBuildCommunityTasksPath>$(ToolFolder)\MSBuildTasks\tools</MSBuildCommunityTasksPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.targets"/>
<!-- Version Number -->
<PropertyGroup>
<BuildNumber Condition=" '$(APPVEYOR_BUILD_NUMBER)' != '' ">$(APPVEYOR_BUILD_NUMBER)</BuildNumber>
<BuildNumber Condition=" '$(BUILD_NUMBER)' != '' ">$(BUILD_NUMBER)</BuildNumber>
<BuildNumber Condition=" '$(BuildNumber)' == '' ">0</BuildNumber>
<BuildConfiguration Condition=" '$(BuildConfiguration)' == '' ">Release</BuildConfiguration>
<Major Condition=" '$(Major)' == '' ">4</Major>
<Minor Condition=" '$(Minor)' == '' ">0</Minor>
<Revision Condition=" '$(Revision)' == '' ">0</Revision>
<AssemblyVersion>$(Major).$(Minor).0.0</AssemblyVersion>
<AssemblyFileVersion>$(Major).$(Minor).$(Revision).$(BuildNumber)</AssemblyFileVersion>
<AssemblyInformationalVersion>$(Major).$(Minor).$(Revision).$(BuildNumber)</AssemblyInformationalVersion>
<PackageVersion>$(Major).$(Minor).$(Revision).$(BuildNumber)</PackageVersion>
</PropertyGroup>
<ItemGroup>
<SolutionFiles Include="*.sln"/>
</ItemGroup>
<Target Name="Clean">
<DeleteTree Directories="**\obj\**;**\bin\**" />
<DeleteTree Directories="$(BuildFolder)" ContinueOnError="true" />
</Target>
<Target Name="Version">
<Time>
<Output TaskParameter="Year" PropertyName="Year" />
</Time>
<Message Text="Version: $(AssemblyInformationalVersion)"/>
<AssemblyInfo CodeLanguage="CS"
OutputFile="$(SourceFolder)\GlobalAssemblyInfo.cs"
GenerateClass="true"
AssemblyProduct="DataGenerator"
AssemblyDescription="Generate intelligent and realistic test data for an object."
AssemblyCompany="LoreSoft"
AssemblyCopyright="Copyright © $(Year) LoreSoft"
AssemblyConfiguration="$(BuildConfiguration)"
AssemblyVersion="$(AssemblyVersion)"
AssemblyFileVersion="$(AssemblyFileVersion)"
AssemblyInformationalVersion="$(AssemblyInformationalVersion)"
AssemblyTrademark=""/>
<exec Command="dotnet restore "%(SolutionFiles.Identity)""
WorkingDirectory="$(MSBuildProjectDirectory)"/>
</Target>
<Target Name="Compile" DependsOnTargets="Clean;Version">
<MSBuild Projects="%(SolutionFiles.Identity)"
Properties="Configuration=$(BuildConfiguration)"/>
</Target>
<Target Name="Test" DependsOnTargets="Compile">
<ItemGroup>
<TestAssemblies Include="$(TestFolder)\**\*.Tests.csproj"/>
</ItemGroup>
<exec Command="dotnet test "%(TestAssemblies.Identity)" --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"
WorkingDirectory="$(TestFolder)\%(TestAssemblies.RecursiveDir)"/>
</Target>
<Target Name="Coverage" DependsOnTargets="Test">
<ItemGroup>
<CoverageFiles Include="$(TestFolder)\**\coverage.xml"/>
</ItemGroup>
<Message Text="Coverage File: %(CoverageFiles.Identity)"/>
<exec Command="$(CoverallsPath)\csmacnz.coveralls.exe --opencover --input "%(CoverageFiles.Identity)" --jobId $(APPVEYOR_JOB_ID)"
WorkingDirectory="$(TestFolder)\%(CoverageFiles.RecursiveDir)"
Condition=" '$(APPVEYOR)' == 'True' "/>
</Target>
<Target Name="Package" DependsOnTargets="Coverage">
<MakeDir Directories="$(BuildFolder)" Condition="!EXISTS($(BuildFolder))" />
<ItemGroup>
<ProjectFiles Include="$(SourceFolder)\**\*.csproj"/>
</ItemGroup>
<exec Command="dotnet pack "%(ProjectFiles.Identity)" --output "$(BuildFolder)" --include-symbols --include-source --configuration $(BuildConfiguration) -p:Version=$(PackageVersion)"
WorkingDirectory="$(SourceFolder)\%(ProjectFiles.RecursiveDir)"/>
</Target>
<Target Name="Build" DependsOnTargets="Package">
</Target>
</Project>