forked from zzzprojects/EntityFramework.Extended
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Master.proj
164 lines (127 loc) · 6.83 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?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)\Source</SourceFolder>
<MSBuildCommunityTasksPath>$(ToolFolder)\MSBuildTasks\tools</MSBuildCommunityTasksPath>
<XUnitTasksPath>$(ToolFolder)\xunit.runners\tools</XUnitTasksPath>
</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)' == '' ">6</Major>
<Minor Condition=" '$(Minor)' == '' ">1</Minor>
<Revision Condition=" '$(Revision)' == '' ">0</Revision>
<AssemblyVersion>$(Major).0.0.0</AssemblyVersion>
<AssemblyFileVersion>$(Major).$(Minor).$(Revision).$(BuildNumber)</AssemblyFileVersion>
<AssemblyInformationalVersion>$(Major).$(Minor).$(Revision).$(BuildNumber)</AssemblyInformationalVersion>
<PackageVersion>$(Major).$(Minor).$(Revision).$(BuildNumber)</PackageVersion>
</PropertyGroup>
<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: $(Major).$(Minor).$(Build).$(Revision)"/>
<AssemblyInfo CodeLanguage="CS"
OutputFile="Source\GlobalAssemblyInfo.net45.cs"
AssemblyProduct="EntityFramework.Extended (.NET 4.5)"
AssemblyDescription="Entity Framework extensions library. Built for .NET 4.5"
AssemblyCompany="LoreSoft"
AssemblyCopyright="Copyright © $(Year) LoreSoft"
AssemblyVersion="$(AssemblyVersion)"
AssemblyFileVersion="$(AssemblyFileVersion)"
AssemblyInformationalVersion="$(AssemblyInformationalVersion)"
GenerateClass="true" />
<AssemblyInfo CodeLanguage="CS"
OutputFile="Source\GlobalAssemblyInfo.net40.cs"
AssemblyProduct="EntityFramework.Extended (.NET 4.0)"
AssemblyDescription="Entity Framework extensions library. Built for .NET 4.0"
AssemblyCompany="LoreSoft"
AssemblyCopyright="Copyright © $(Year) LoreSoft"
AssemblyVersion="$(AssemblyVersion)"
AssemblyFileVersion="$(AssemblyFileVersion)"
AssemblyInformationalVersion="$(AssemblyInformationalVersion)"
GenerateClass="true" />
</Target>
<Target Name="Compile" DependsOnTargets="Clean;Version">
<NuGetRestore Solution="$(SourceFolder)\EntityFramework.Extended.net45.sln" />
<MSBuild Projects="$(SourceFolder)\EntityFramework.Extended.net45.sln"
Properties="Configuration=$(BuildConfiguration)"/>
<NuGetRestore Solution="$(SourceFolder)\EntityFramework.Extended.net40.sln" />
<MSBuild Projects="$(SourceFolder)\EntityFramework.Extended.net40.sln"
Properties="Configuration=$(BuildConfiguration)"/>
</Target>
<Target Name="Zip" DependsOnTargets="Compile">
<ItemGroup>
<ZipFiles Include="$(SourceFolder)\EntityFramework.Extended\bin\$(BuildConfiguration)\**\EntityFramework.Extended.*" />
</ItemGroup>
<Zip Files="@(ZipFiles)"
WorkingDirectory="$(SourceFolder)\EntityFramework.Extended\bin\$(BuildConfiguration)"
ZipFileName="EntityFramework.Extended.v$(PackageVersion).zip" />
</Target>
<Target Name="Test" DependsOnTargets="Compile">
<ItemGroup>
<TestAssemblies Include="$(SourceFolder)\**\*.Test\bin\$(BuildConfiguration)\**\*.Test.dll"/>
</ItemGroup>
<exec Condition=" '$(APPVEYOR_BUILD_NUMBER)' != '' "
Command="$(ToolFolder)\ctt.exe s:"%(TestAssemblies.Identity).config" t:"$(SourceFolder)\%(TestAssemblies.RecursiveDir)App.AppVeyor.config" d:"%(TestAssemblies.Identity).config" pw"/>
<exec Condition=" '$(APPVEYOR_BUILD_NUMBER)' != '' "
Command="xunit.console.clr4.x86.exe "%(TestAssemblies.Identity)" /appveyor"/>
<exec Condition=" '$(APPVEYOR_BUILD_NUMBER)' == '' "
Command="$(XUnitTasksPath)\xunit.console.clr4.x86.exe "%(TestAssemblies.Identity)""/>
</Target>
<Target Name="Package" DependsOnTargets="Test">
<MakeDir Directories="$(BuildFolder)" Condition="!EXISTS($(BuildFolder))" />
<ItemGroup>
<NuGetFiles Include="$(SourceFolder)\**\*.nuspec"/>
</ItemGroup>
<NuGetPack ToolPath="$(ToolFolder)"
File="%(NuGetFiles.Identity)"
OutputDirectory="$(BuildFolder)"
Version="$(PackageVersion)"
Symbols="true" />
</Target>
<Target Name="Publish" DependsOnTargets="Package">
<!--
Requires API key to be set ...
nuget.exe setapikey <myget-key> -Source https://www.myget.org/F/loresoft/
-->
<ItemGroup>
<NuGetPackages Include="$(BuildFolder)\*.nupkg" Exclude="$(BuildFolder)\*.symbols.nupkg"/>
<NuGetSymbols Include="$(BuildFolder)\*.symbols.nupkg" />
</ItemGroup>
<!-- Push to MyGet on Build -->
<NuGetPush ToolPath="$(ToolFolder)"
File="%(NuGetPackages.Identity)"
Source="https://www.myget.org/F/loresoft/" />
<!-- Push to Symbols on Build -->
<NuGetPush ToolPath="$(ToolFolder)"
File="%(NuGetSymbols.Identity)"
Source="https://nuget.symbolsource.org/MyGet/loresoft" />
</Target>
<Target Name="Build">
<CallTarget Targets="Package" />
</Target>
<Target Name="Refresh">
<!-- Update NuGet dependencies to match package version -->
<!-- EntityFramework -->
<XmlRead XmlFileName="$(SourceFolder)\EntityFramework.Extended\packages.config"
XPath="/packages/package[@id='EntityFramework']/@version">
<Output TaskParameter="Value" ItemName="EntityFrameworkVersion" />
</XmlRead>
<Message Text="EntityFramework Version: @(EntityFrameworkVersion)"/>
<XmlUpdate XmlFileName="$(SourceFolder)\EntityFramework.Extended\EntityFramework.Extended.nuspec"
Prefix="d" Namespace="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"
XPath="/d:package/d:metadata/d:dependencies/d:dependency[@id='EntityFramework']/@version"
Value="@(EntityFrameworkVersion)" />
</Target>
</Project>