forked from weavy/weavy-sln
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.proj
56 lines (47 loc) · 2.95 KB
/
build.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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Package">
<ItemGroup>
<SolutionFile Include="$(MSBuildProjectDirectory)\*.sln"/>
</ItemGroup>
<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
</PropertyGroup>
<!-- custom tasks -->
<UsingTask TaskName="CreatePackage" AssemblyFile="$(MSBuildProjectDirectory)\tools\Weavy.Build.dll" />
<UsingTask TaskName="GetVersion" AssemblyFile="$(MSBuildProjectDirectory)\tools\Weavy.Build.dll" />
<!-- create deployment package -->
<Target Name="Package" DependsOnTargets="Precompile">
<GetVersion Path="$(MSBuildProjectDirectory)\src\Properties\BuildInfo.cs">
<Output TaskParameter="SemVer" PropertyName="SemVer"/>
</GetVersion>
<CreatePackage Name="$(Semver)" SolutionDir="$(MSBuildProjectDirectory)" />
</Target>
<!-- precompile razor views -->
<Target Name="Precompile" DependsOnTargets="Publish">
<Message Text="Precompiling views" Importance="High" />
<AspNetCompiler VirtualPath="/" PhysicalPath="$(MSBuildProjectDirectory)\dist\published" TargetPath="$(MSBuildProjectDirectory)\dist\compiled" Force="true" />
<Message Text="Merging precompiled views" Importance="High" />
<CSC OutputAssembly="$(MSBuildProjectDirectory)\src\obj\$(Configuration)\AssemblyInfo.dll" TargetType="library" NoLogo="false" Sources="$(MSBuildProjectDirectory)\src\Properties\AssemblyInfo.cs" />
<Exec Command="aspnet_merge.exe "$(MSBuildProjectDirectory)\dist\compiled" -o Weavy.Views -copyattrs "$(MSBuildProjectDirectory)\src\obj\$(Configuration)\AssemblyInfo.dll" -a -nologo" WorkingDirectory="$(MSBuildProjectDirectory)\tools" />
</Target>
<!-- publish project -->
<Target Name="Publish" DependsOnTargets="Restore">
<Message Text="Publishing project" Importance="High" />
<MSBuild Projects="@(SolutionFile)" Properties="Configuration=$(Configuration);DeployOnBuild=true;DeployDefaultTarget=WebPublish;WebPublishMethod=FileSystem;DeleteExistingFiles=true;publishUrl=$(MSBuildProjectDirectory)\dist\published" />
<!-- copy satellite assemblies -->
<ItemGroup>
<Resources Include="$(MSBuildProjectDirectory)\src\bin\**\Weavy.resources.dll" />
</ItemGroup>
<Copy SourceFiles="@(Resources)" DestinationFolder="$(MSBuildProjectDirectory)\dist\published\bin\%(Resources.RecursiveDir)" SkipUnchangedFiles="false" />
<!-- copy xml files for web api documentation -->
<ItemGroup>
<DocFiles Include="$(MSBuildProjectDirectory)\src\bin\Weavy*.xml" />
</ItemGroup>
<Copy SourceFiles="@(DocFiles)" DestinationFolder="$(MSBuildProjectDirectory)\dist\published\bin" SkipUnchangedFiles="false" />
</Target>
<!-- package restore -->
<Target Name="Restore">
<Message Text="Restoring Nuget packages" Importance="High" />
<Exec Command="tools\nuget.exe restore "%(SolutionFile.Filename).sln"" WorkingDirectory="$(MSBuildProjectDirectory)"/>
</Target>
</Project>