forked from JakeGinnivan/VSTOContrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VSTO Contrib Office Application.proj
92 lines (77 loc) · 4.89 KB
/
VSTO Contrib Office Application.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
<Project DefaultTargets="Package" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets"/>
<UsingTask
AssemblyFile="$(Root)lib\xunit.net\xunit.runner.msbuild.dll"
TaskName="Xunit.Runner.MSBuild.xunit"/>
<Target Name="Clean">
<ItemGroup>
<OldDirectories Include="@(ProjectFiles->'%(RootDir)%(Directory)bin')" />
<OldDirectories Include="@(ProjectFiles->'%(RootDir)%(Directory)obj')" />
</ItemGroup>
<RemoveDir Directories="@(OldDirectories)" ContinueOnError="true" />
</Target>
<Target Name="Compile">
<Error Condition="$(OfficeApplication) == ''" Text="You must specify a Office Application to build for" />
<Error Condition="$(MSBuildCommunityTasksPath) == ''" Text="MSBuildCommunityTasksPath variable must be defined" />
<Error Condition="$(Root) == ''" Text="Root variable must be defined" />
<Error Condition="$(ProgramFiles32) == ''" Text="ProgramFiles32 variable must be defined" />
<!--Compile-->
<ItemGroup>
<ProjectToBuild Include="
$(Root)src\VSTOContrib.Core\VSTOContrib.Core.csproj;
$(Root)src\VSTOContrib.$(OfficeApplication)\VSTOContrib.$(OfficeApplication).csproj;
$(Root)src\TestProjects\VSTOContrib.Core.Tests\VSTOContrib.Core.Tests.csproj;
$(Root)src\TestProjects\VSTOContrib.$(OfficeApplication).Tests\VSTOContrib.$(OfficeApplication).Tests.csproj" />
</ItemGroup>
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=$(Configuration);Platform=AnyCPU;" />
</Target>
<Target Name="Test" DependsOnTargets="Compile">
<xunit Assembly="$(Root)src\TestProjects\VSTOContrib.Core.Tests\bin\$(Configuration)\VSTOContrib.Core.Tests.dll" />
<xunit Assembly="$(Root)src\TestProjects\VSTOContrib.$(OfficeApplication).Tests\bin\$(Configuration)\VSTOContrib.$(OfficeApplication).Tests.dll" />
</Target>
<Target Name="NuGet" DependsOnTargets="Test">
<PropertyGroup>
<ApplicationNuGetFolderName>$(Root)build\Artifacts\NuGet\$(OfficeApplication)\</ApplicationNuGetFolderName>
<NuGetManifest>$(Root)build\Artifacts\VSTOContrib.$(OfficeApplication).nuspec</NuGetManifest>
<NuGet>$(Root)src\.nuget\NuGet.exe</NuGet>
</PropertyGroup>
<Copy SourceFiles="$(Root)src\VSTOContrib.$(OfficeApplication)\bin\$(Configuration)\VSTOContrib.Core.dll"
DestinationFiles="$(ApplicationNuGetFolderName)lib\net40\VSTOContrib.Core.dll"/>
<Copy SourceFiles="$(Root)src\VSTOContrib.$(OfficeApplication)\bin\$(Configuration)\VSTOContrib.Core.pdb"
DestinationFiles="$(ApplicationNuGetFolderName)lib\net40\VSTOContrib.Core.pdb"/>
<Copy SourceFiles="$(Root)src\VSTOContrib.$(OfficeApplication)\bin\$(Configuration)\VSTOContrib.$(OfficeApplication).dll"
DestinationFiles="$(ApplicationNuGetFolderName)lib\net40\VSTOContrib.$(OfficeApplication).dll"/>
<Copy SourceFiles="$(Root)src\VSTOContrib.$(OfficeApplication)\bin\$(Configuration)\VSTOContrib.$(OfficeApplication).pdb"
DestinationFiles="$(ApplicationNuGetFolderName)lib\net40\VSTOContrib.$(OfficeApplication).pdb"/>
<Copy SourceFiles="$(Root)build\VSTOContrib.nuspec"
DestinationFiles="$(NuGetManifest)"/>
<Copy SourceFiles="$(Root)build\Readme.txt"
DestinationFiles="$(ApplicationNuGetFolderName)Readme.txt"/>
<FileUpdate Files="$(ApplicationNuGetFolderName)Readme.txt"
Regex="{{Application}}"
ReplacementText="$(OfficeApplication)"/>
<FileUpdate Files="$(NuGetManifest)"
Regex="{{Application}}"
ReplacementText="$(OfficeApplication)"/>
<Exec Command='$(NuGet) pack "$(NuGetManifest)" -BasePath "$(ApplicationNuGetFolderName)\" -OutputDirectory "$(Root)build\Artifacts" -Version $(GitVersion_NugetVersion)' />
<PropertyGroup>
<QuickStartRoot>$(Root)src\Quickstart\$(OfficeApplication)Quickstart\</QuickStartRoot>
<QuickStartSpec>$(QuickStartRoot)$(OfficeApplication)QuickStart.nuspec</QuickStartSpec>
</PropertyGroup>
<Exec Command='$(NuGet) pack "$(QuickStartSpec)" -BasePath "$(QuickStartRoot)\" -OutputDirectory "$(Root)build\Artifacts" -version $(GitVersion_NugetVersion)'
Condition="Exists('$(QuickStartSpec)')"/>
</Target>
<Target Name="Package" DependsOnTargets="NuGet">
<ItemGroup>
<ZipFiles Include="$(Root)src\VSTOContrib.$(OfficeApplication)\bin\Build\*.*"
Exclude="$(Root)src\VSTOContrib.$(OfficeApplication)\bin\Build\*vshost*" />
</ItemGroup>
<ItemGroup>
<OldZipFiles Include="$(Root)*.zip" />
</ItemGroup>
<Delete Files="@(OldZipFiles)" />
<Zip Files="@(ZipFiles)"
WorkingDirectory="$(Root)src\VSTOContrib.$(OfficeApplication)\bin\Build\"
ZipFileName="$(Root)build\Artifacts\VSTOContrib.$(OfficeApplication) v$(GitVersion_NugetVersion).zip" />
</Target>
</Project>