forked from alphaleonis/AlphaFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuildRelease.proj
112 lines (94 loc) · 5.27 KB
/
BuildRelease.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
<?xml version="1.0" encoding="utf-8"?>
<!-- This project file is used for building a release of AlphaFS. It will create a nuget package and a zip-file after building all
configurations in release mode. These will be placed under the Dist\ directory. -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Rebuild" ToolsVersion="4.0">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
<DistDir>$(MSBuildThisFileDirectory)Dist</DistDir>
</PropertyGroup>
<UsingTask
TaskName="GetFileVersion"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<AssemblyPath ParameterType="System.String" Required="true" />
<Version ParameterType="System.String" Output="true" />
</ParameterGroup>
<Task>
<Using Namespace="System.Diagnostics" />
<Code Type="Fragment" Language="cs">
<![CDATA[
Log.LogMessage("Getting version details of assembly at: " + this.AssemblyPath, MessageImportance.High);
this.Version = FileVersionInfo.GetVersionInfo(this.AssemblyPath).FileVersion;
]]>
</Code>
</Task>
</UsingTask>
<ItemGroup>
<TargetList Condition=" '@(TargetList)' == '' " Include="Rebuild" />
</ItemGroup>
<ItemGroup>
<ProjectsToBuild Include="$(MSBuildProjectDirectory)\AlphaFS\AlphaFS.csproj">
<Configuration>Net35</Configuration>
<CopyOutputs>True</CopyOutputs>
</ProjectsToBuild>
<ProjectsToBuild Include="$(MSBuildProjectDirectory)\AlphaFS\AlphaFS.csproj">
<Configuration>Net40</Configuration>
<CopyOutputs>True</CopyOutputs>
</ProjectsToBuild>
<ProjectsToBuild Include="$(MSBuildProjectDirectory)\AlphaFS\AlphaFS.csproj">
<Configuration>Net45</Configuration>
<CopyOutputs>True</CopyOutputs>
</ProjectsToBuild>
<ProjectsToBuild Include="$(MSBuildProjectDirectory)\AlphaFS\AlphaFS.csproj">
<Configuration>Net451</Configuration>
<CopyOutputs>True</CopyOutputs>
</ProjectsToBuild>
<ProjectsToBuild Include="$(MSBuildProjectDirectory)\AlphaFS\AlphaFS.csproj">
<Configuration>Net452</Configuration>
<CopyOutputs>True</CopyOutputs>
</ProjectsToBuild>
<ProjectsToBuild Include="$(MSBuildProjectDirectory)\AlphaFS.Doc\AlphaFS.Doc.shfbproj">
<Configuration>Release</Configuration>
</ProjectsToBuild>
</ItemGroup>
<Target Name="Rebuild" Outputs="%(PlatformList.Identity)">
<MSBuild Projects="%(ProjectsToBuild.Identity)"
Properties="Configuration=%(ProjectsToBuild.Configuration);Platform=$(Platform);"
Targets="@(TargetList)"
SkipNonexistentProjects="true" />
<GetFileVersion AssemblyPath="$(MSBuildProjectDirectory)\Bin\$(Configuration)\Net451\AlphaFS.dll">
<Output TaskParameter="Version" PropertyName="AlphaFSFileVersion" />
</GetFileVersion>
<ItemGroup>
<FilesToClean Include="$(DistDir)\**\*"/>
</ItemGroup>
<Delete Files="@(FilesToClean)" ContinueOnError="false"/>
<RemoveDir Directories="$(DistDir)" />
<MakeDir Directories="$(DistDir)" />
<Exec Command=""$(MSBuildThisFileDirectory)packages\NuGet.CommandLine.3.4.4-rtm-final\tools\NuGet.exe" pack "$(ProjectDir)AlphaFS.nuspec" -NoPackageAnalysis -Version $(AlphaFSFileVersion) -OutputDirectory $(DistDir)" WorkingDirectory="$(TargetDir)" LogStandardErrorAsError="true" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec" />
</Exec>
<ItemGroup>
<BinFiles Include="@(ProjectsToBuild->'$(MSBuildThisFileDirectory)\Bin\Release\%(Configuration)\AlphaFS.dll')" Condition="%(ProjectsToBuild.CopyOutputs) == 'True'">
<Configuration>%(ProjectsToBuild.Configuration)</Configuration>
</BinFiles>
<BinFiles Include="@(ProjectsToBuild->'$(MSBuildThisFileDirectory)\Bin\Release\%(Configuration)\AlphaFS.pdb')" Condition="%(ProjectsToBuild.CopyOutputs) == 'True'">
<Configuration>%(ProjectsToBuild.Configuration)</Configuration>
</BinFiles>
<BinFiles Include="@(ProjectsToBuild->'$(MSBuildThisFileDirectory)\Bin\Release\%(Configuration)\AlphaFS.xml')" Condition="%(ProjectsToBuild.CopyOutputs) == 'True'">
<Configuration>%(ProjectsToBuild.Configuration)</Configuration>
</BinFiles>
</ItemGroup>
<ItemGroup>
<StaticFiles Include="$(MSBuildThisFileDirectory)\CHANGELOG.md" />
<StaticFiles Include="$(MSBuildThisFileDirectory)\LICENSE.md" />
<StaticFiles Include="$(MSBuildThisFileDirectory)\README.md" />
</ItemGroup>
<Move SourceFiles="$(MSBuildThisFileDirectory)\Bin\Documentation\AlphaFS.chm" DestinationFiles="$(DistDir)\Zip\AlphaFS.$(AlphaFSFileVersion).chm" />
<Copy SourceFiles="@(BinFiles)" DestinationFiles="@(BinFiles->'$(DistDir)\Zip\Lib\%(Configuration)\%(Filename)%(Extension)')" />
<Copy SourceFiles="@(StaticFiles)" DestinationFolder="$(DistDir)\Zip" />
<Exec Command="PowerShell -command Compress-Archive "$(DistDir)\Zip\*" $(DistDir)\AlphaFS.$(AlphaFSFileVersion).zip" />
</Target>
</Project>