forked from andrewdavey/cassette
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
116 lines (100 loc) · 6.73 KB
/
build.xml
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
<?xml version="1.0"?>
<Project DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Import Project="Cassette.targets" />
<PropertyGroup>
<Configuration>Release</Configuration>
<FX35Suffix>-FX35</FX35Suffix>
</PropertyGroup>
<Target Name="Default" DependsOnTargets="Test;NugetPack"></Target>
<Target Name="Build">
<ItemGroup>
<Tests Include="src\Cassette.UnitTests\Cassette.UnitTests.csproj"/>
<Tests Include="src\Cassette.IntegrationTests\Cassette.IntegrationTests.csproj"/>
</ItemGroup>
<PropertyGroup>
<OutputPath>..\..\build\bin</OutputPath>
</PropertyGroup>
<!-- Only need to build test projects as dependent projects will be automatically built. -->
<MSBuild Projects="@(Tests)" Targets="Clean;Build"
Properties="Configuration=$(Configuration)$(FX35Suffix);OutputPath=$(OutputPath)\lib35"/>
<MSBuild Projects="@(Tests)" Targets="Clean;Build"
Properties="Configuration=$(Configuration);OutputPath=$(OutputPath)\lib40"/>
</Target>
<Target Name="Test" DependsOnTargets="Build">
<!-- Run tests against 4.0 and 3.5 assemblies; must use CLR4 and 2.0 XUnit otherwise some 3.5 tests will fail -->
<Exec Command="tools\xunit.console.clr4.x86.exe build\bin\lib40\Cassette.UnitTests.dll" />
<Exec Command="tools\xunit.console.clr4.x86.exe build\bin\lib40\Cassette.IntegrationTests.dll" />
<Exec Command="tools\xunit.console.x86.exe build\bin\lib35\Cassette.UnitTests.dll" />
<Exec Command="tools\xunit.console.x86.exe build\bin\lib35\Cassette.IntegrationTests.dll" />
</Target>
<Target Name="NugetPack" DependsOnTargets="Build">
<ItemGroup>
<ExistingPackageFiles Include="build\nuget\*"/>
<MainNuspec Include="src\Cassette\Cassette.nuspec"/>
<MainNuspec Include="src\Cassette.Less\Cassette.Less.nuspec"/>
<MainNuspec Include="src\Cassette.Sass\Cassette.Sass.nuspec"/>
<MainNuspec Include="src\Cassette.CoffeeScript\Cassette.CoffeeScript.nuspec"/>
<MainNuspec Include="src\Cassette.Hogan\Cassette.Hogan.nuspec"/>
<MainNuspec Include="src\Cassette.JQueryTmpl\Cassette.JQueryTmpl.nuspec"/>
<MainNuspec Include="src\Cassette.KnockoutJQueryTmpl\Cassette.KnockoutJQueryTmpl.nuspec"/>
<MainNuspec Include="src\Cassette.Views\Cassette.Views.nuspec"/>
<MainNuspec Include="src\Cassette.Web\Cassette.Web.nuspec"/>
<MainNuspec Include="src\Cassette.Web.Jasmine\Cassette.Web.Jasmine.nuspec"/>
<SymbolsNuspec Include="src\Cassette\Cassette.symbols.nuspec"/>
<SymbolsNuspec Include="src\Cassette.Less\Cassette.Less.symbols.nuspec"/>
<SymbolsNuspec Include="src\Cassette.Sass\Cassette.Sass.symbols.nuspec"/>
<SymbolsNuspec Include="src\Cassette.CoffeeScript\Cassette.CoffeeScript.symbols.nuspec"/>
<SymbolsNuspec Include="src\Cassette.Hogan\Cassette.Hogan.symbols.nuspec"/>
<SymbolsNuspec Include="src\Cassette.JQueryTmpl\Cassette.JQueryTmpl.symbols.nuspec"/>
<SymbolsNuspec Include="src\Cassette.KnockoutJQueryTmpl\Cassette.KnockoutJQueryTmpl.symbols.nuspec"/>
<SymbolsNuspec Include="src\Cassette.Views\Cassette.Views.symbols.nuspec"/>
<SymbolsNuspec Include="src\Cassette.Web\Cassette.Web.symbols.nuspec"/>
<SymbolsNuspec Include="src\Cassette.Web.Jasmine\Cassette.Web.Jasmine.symbols.nuspec"/>
<Transforms Include="src\**\*.nutrans" />
</ItemGroup>
<PropertyGroup>
<OutputDir>build\nuget</OutputDir>
</PropertyGroup>
<!-- Get shared assembly version -->
<GetAssemblyInformationalVersion Assembly="build\bin\lib40\Cassette.dll">
<Output PropertyName="Version" TaskParameter="Version" />
</GetAssemblyInformationalVersion>
<Message Text="Building Nuget packages for v$(Version)" />
<Delete Files="@(ExistingPackageFiles)"/>
<!-- Transform Nuspecs -->
<TransformXmlHierarchy
Source="%(Transforms.Identity)"
Destination="src\%(Transforms.RecursiveDir)%(Transforms.Filename).nuspec"
TaskDirectory="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\" />
<MakeDir Directories="$(OutputDir)"/>
<Exec Command="nuget pack %(MainNuspec.Identity) -Version $(Version) -OutputDirectory $(OutputDir)"/>
<Exec Command="nuget pack %(SymbolsNuspec.Identity) -Version $(Version) -Symbols -OutputDirectory $(OutputDir)"/>
<!-- The Cassette.MSBuild package is slightly different (-Tool, no symbols and -NoPackageAnalysis to avoid warning about DLLs in the Tools directory). -->
<!-- TODO: This is packaged as a 4.0 package, as it includes the 4.0 DLLs of its dependencies in the Tools folder.
If it is an issue for 3.5-based projects, can maybe figure out a clean way to package tools for 3.5 and 4.0.
See: src\Cassette.MSBuild\Cassette.MSBuild.nuspec -->
<Exec Command="nuget pack src\Cassette.MSBuild\Cassette.MSBuild.nuspec -Version $(Version) -Tool -OutputDirectory $(OutputDir) -NoPackageAnalysis"/>
<!-- TODO: Until we can multi-target within Nuget easily, we are packaging Fx35 as a zip file for release -->
<ItemGroup>
<Binary Include="build\bin\lib35\Cassette.dll" />
<Binary Include="build\bin\lib35\Cassette.Views.dll" />
<Binary Include="build\bin\lib35\Cassette.Web.dll" />
<Binary Include="build\bin\lib35\Iesi.Collections.dll" />
<Binary Include="build\bin\lib35\Pandora.dll" />
<Content Include="src\Cassette.Web\CassetteConfiguration.cs.pp" />
<Content Include="src\Cassette.Web\web.config.transform" />
<Content Include="src\Cassette.Views\web.config.mvc2.transform" />
<Root Include="license.txt" />
<Root Include="readme_fx35.md" />
</ItemGroup>
<Copy SourceFiles="%(Binary.Identity)" DestinationFolder="build\Cassette.Fx35-$(Version)\lib35" />
<Copy SourceFiles="%(Content.Identity)" DestinationFolder="build\Cassette.Fx35-$(Version)\content" />
<Copy SourceFiles="%(Root.Identity)" DestinationFolder="build\Cassette.Fx35-$(Version)" />
</Target>
<Target Name="NugetPush" DependsOnTargets="NugetPack">
<ItemGroup>
<Packages Include="build\nuget\*.nupkg" Exclude="build\nuget\*.symbols.nupkg"/>
</ItemGroup>
<Exec Command="nuget push %(Packages.Identity)" />
</Target>
</Project>