-
Notifications
You must be signed in to change notification settings - Fork 36
/
build.msbuild
102 lines (87 loc) · 6.71 KB
/
build.msbuild
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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Import Project="Build.config" />
<Import Project="version.props" />
<UsingTask TaskName="xunit" AssemblyFile="$(XUnitPath)\xunit.runner.msbuild.net452.dll" />
<ItemGroup>
<Versions Include="$(SupportedSitecoreVersions)" />
<References Include="packages\Lucene.Net.3.0.3\lib\NET40\Lucene.Net.dll" />
<References Include="packages\Sitecore.Buckets.$(Version)\lib\$(TargetFrameworkFolder)\Sitecore.Buckets.dll" />
<References Include="packages\Sitecore.ContentSearch.$(Version)\lib\$(TargetFrameworkFolder)\Sitecore.ContentSearch.dll" />
<References Include="packages\Sitecore.ContentSearch.Data.$(Version)\lib\$(TargetFrameworkFolder)\Sitecore.ContentSearch.Data.dll" />
<References Include="packages\Sitecore.ContentSearch.Linq.$(Version)\lib\$(TargetFrameworkFolder)\Sitecore.ContentSearch.Linq.dll" />
<References Include="packages\Sitecore.Kernel.$(Version)\lib\$(TargetFrameworkFolder)\Sitecore.Kernel.dll" />
<References Include="packages\Sitecore.Logging.$(Version)\lib\$(TargetFrameworkFolder)\Sitecore.Logging.dll" />
<References Include="packages\Sitecore.Nexus.$(Version)\lib\$(TargetFrameworkFolder)\Sitecore.Nexus.dll" />
<CleanUp Include="lib\*.dll" />
<CleanUp Include="test\**\Sitecore.FakeDb.Tests.config" />
</ItemGroup>
<Target Name="Clean">
<MSBuild Projects="$(ProjectToBuild)" Targets="Clean" />
<RemoveDir Directories="$(OutputDirectory)" />
</Target>
<Target Name="Compile" DependsOnTargets="Clean">
<Exec Command="$(NuGet) restore" />
<Exec Command="$(NuGet) install Lucene.Net -Version 3.0.3 -OutputDirectory packages" />
<Exec Command="$(NuGet) install Sitecore.Buckets -Version $(Version) -OutputDirectory packages" />
<Exec Command="$(NuGet) install Sitecore.ContentSearch -Version $(Version) -OutputDirectory packages" />
<Exec Command="$(NuGet) install Sitecore.ContentSearch.Linq -Version $(Version) -OutputDirectory packages" />
<Exec Command="$(NuGet) install Sitecore.Kernel -Version $(Version) -OutputDirectory packages" />
<Exec Command="$(NuGet) install Sitecore.Logging -Version $(Version) -OutputDirectory packages" />
<Exec Command="$(NuGet) install Sitecore.Nexus -Version $(Version) -OutputDirectory packages" />
<Delete Files="@(CleanUp)" />
<Copy SourceFiles="@(References)" DestinationFolder="lib" />
<Message Text=" " />
<Message Text="=== BUILDING FOR $(Version) ===" Importance="high" />
<PropertyGroup>
<ShortScVersion>SC$(Version.Replace(".",""))</ShortScVersion>
</PropertyGroup>
<MSBuild Projects="$(ProjectToBuild)" Properties="DefineConstants=$(ShortScVersion);TRACE" />
</Target>
<ItemGroup>
<TestAssemblies Include="$(FakeDbTestsOutDir)\Sitecore.FakeDb.Tests.dll" />
<TestAssemblies Include="$(AutoFixtureTestsOutDir)\Sitecore.FakeDb.AutoFixture.Tests.dll" />
<TestAssemblies Include="$(NSubstituteTestsOutDir)\Sitecore.FakeDb.NSubstitute.Tests.dll" />
<TestAssemblies Include="$(SerializationTestsOutDir)\Sitecore.FakeDb.Serialization.Tests.dll" />
<TestAssemblies Include="$(FakeDbTestsOutDir)\Sitecore.FakeDb.Tests.dll">
<ConfigFile>$(AutoFixtureTestsOutDir)\Sitecore.FakeDb.AutoFixture.Tests.dll.config</ConfigFile>
</TestAssemblies>
<TestAssemblies Include="$(FakeDbTestsOutDir)\Sitecore.FakeDb.Tests.dll">
<ConfigFile>$(NSubstituteTestsOutDir)\Sitecore.FakeDb.NSubstitute.Tests.dll.config</ConfigFile>
</TestAssemblies>
<TestAssemblies Include="$(FakeDbTestsOutDir)\Sitecore.FakeDb.Tests.dll">
<ConfigFile>$(SerializationTestsOutDir)\Sitecore.FakeDb.Serialization.Tests.dll.config</ConfigFile>
</TestAssemblies>
</ItemGroup>
<Target Name="Tests" DependsOnTargets="Compile">
<Message Text="=== RUNNING TESTS FOR $(Version) ===" Importance="high" />
<xunit Assemblies="@(TestAssemblies)" ParallelizeTestCollections="false" Xml="TestResult_$(Version).xml" />
<Exec Command="Sitecore.FakeDb.NUnitLite.Tests.exe" WorkingDirectory="test\Sitecore.FakeDb.NUnitLite.Tests\bin\Release" />
</Target>
<Target Name="Packages" DependsOnTargets="Tests">
<MakeDir Directories="$(OutputDirectory)" />
<XslTransformation XslInputPath="$(NuGetXslt)" XmlInputPaths="$(FakeDbTestsDir)\App.config" OutputPaths="$(FakeDbDir)\App.config" />
<XslTransformation XslInputPath="$(NuGetXslt)" XmlInputPaths="$(AutoFixtureTestsDir)\App.config" OutputPaths="$(AutoFixtureTestsDir)\App.config.transform" />
<XslTransformation XslInputPath="$(NuGetXslt)" XmlInputPaths="$(NSubstituteTestsDir)\App.config" OutputPaths="$(NSubstituteTestsDir)\App.config.transform" />
<XslTransformation XslInputPath="$(NuGetXslt)" XmlInputPaths="$(SerializationTestsDir)\App.config" OutputPaths="$(SerializationTestsDir)\App.config.transform" />
<Exec Command="$(NuGet) pack src/Sitecore.FakeDb/Sitecore.FakeDb.csproj -Properties Configuration=Release -OutputDirectory $(OutputDirectory) -Build -Symbols" />
<Exec Command="$(NuGet) pack src/Sitecore.FakeDb.AutoFixture/Sitecore.FakeDb.AutoFixture.csproj -Properties Configuration=Release -OutputDirectory $(OutputDirectory) -Build -Symbols" />
<Exec Command="$(NuGet) pack src/Sitecore.FakeDb.NSubstitute/Sitecore.FakeDb.NSubstitute.csproj -Properties Configuration=Release -OutputDirectory $(OutputDirectory) -Build -Symbols" />
<Exec Command="$(NuGet) pack src/Sitecore.FakeDb.Serialization/Sitecore.FakeDb.Serialization.csproj -Properties Configuration=Release -OutputDirectory $(OutputDirectory) -Build -Symbols" />
<Delete Files="$(FakeDbDir)\App.config" />
<RemoveDir Directories="$(FakeDbDir)\App_Config\" />
<Delete Files="$(FakeDbTestsDir)\App.config.transform" />
<Delete Files="$(AutoFixtureTestsDir)\App.config.transform" />
<Delete Files="$(NSubstituteTestsDir)\App.config.transform" />
<Delete Files="$(SerializationTestsDir)\App.config.transform" />
</Target>
<Target Name="Versions">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Packages" Properties="Version=%(Versions.Identity);TargetFrameworkFolder=NET471" />
</Target>
<Target Name="Deploy" DependsOnTargets="Versions">
<Exec Command="$(NuGet) push $(OutputDirectory)\Sitecore.FakeDb.?.*.?.nupkg -Source https://www.nuget.org/api/v2/package" />
<Exec Command="$(NuGet) push $(OutputDirectory)\Sitecore.FakeDb.AutoFixture.?.*.?.nupkg -Source https://www.nuget.org/api/v2/package" />
<Exec Command="$(NuGet) push $(OutputDirectory)\Sitecore.FakeDb.NSubstitute.?.*.?.nupkg -Source https://www.nuget.org/api/v2/package" />
<Exec Command="$(NuGet) push $(OutputDirectory)\Sitecore.FakeDb.Serialization.?.*.?.nupkg -Source https://www.nuget.org/api/v2/package" />
</Target>
</Project>