1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
- <Project ToolsVersion =" 4.0" DefaultTargets =" Clean;CreatePackage;GenerateHelpFile;GenerateSourceZip " xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
2
+ <Project ToolsVersion =" 4.0" DefaultTargets =" Clean;CreatePackage;GenerateHelpFile" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
3
3
<PropertyGroup >
4
4
<Configuration Condition =" '$(Configuration)' == ''" >Release</Configuration >
5
5
<BuildRoot >$(MSBuildThisFileDirectory)</BuildRoot >
6
- <NuGetExe >$(BuildRoot)nuget\nuget.exe</NuGetExe >
7
- <MSBuildCommunityTasksPath >$(MSBuildThisFileDirectory)msbuild</MSBuildCommunityTasksPath >
6
+ <NuGetExe >$(BuildRoot)target\nuget\nuget.exe</NuGetExe >
8
7
</PropertyGroup >
8
+ <ItemGroup >
9
+ <VisualStudioVersion Include =" 2012" >
10
+ <SolutionFile >$(MSBuildThisFileDirectory)..\src\Renci.SshNet.VS2012.sln</SolutionFile >
11
+ </VisualStudioVersion >
12
+ <VisualStudioVersion Include =" 2015" >
13
+ <SolutionFile >$(MSBuildThisFileDirectory)..\src\Renci.SshNet.VS2015.sln</SolutionFile >
14
+ </VisualStudioVersion >
15
+ </ItemGroup >
9
16
<ItemGroup >
10
17
<TargetFramework Include =" .NET Framework 3.5" >
11
- <Project >Renci.SshNet.NET35</ Project >
18
+ <OutputDirectory >Renci.SshNet.NET35\bin\$(Configuration)</ OutputDirectory >
12
19
<Moniker >net35</Moniker >
13
20
</TargetFramework >
14
21
<TargetFramework Include =" .NET Framework 4.0" >
15
- <Project >Renci.SshNet</ Project >
22
+ <OutputDirectory >Renci.SshNet\bin\$(Configuration)</ OutputDirectory >
16
23
<Moniker >net40</Moniker >
17
24
</TargetFramework >
18
- <TargetFramework Include =" Windows Phone 7.1" >
19
- <Project >Renci.SshNet.WindowsPhone</ Project >
20
- <Moniker >sl4-windowsphone71 </Moniker >
25
+ <TargetFramework Include =" Windows Phone Silverlight 7.1" >
26
+ <OutputDirectory >Renci.SshNet.WindowsPhone\bin\$(Configuration)</ OutputDirectory >
27
+ <Moniker >wp71 </Moniker >
21
28
</TargetFramework >
22
- <TargetFramework Include =" Windows Phone 8.0" >
23
- <Project >Renci.SshNet.WindowsPhone8</ Project >
24
- <Moniker >windowsphone8 </Moniker >
29
+ <TargetFramework Include =" Windows Phone Silverlight 8.0" >
30
+ <OutputDirectory >Renci.SshNet.WindowsPhone8\bin\$(Configuration)</ OutputDirectory >
31
+ <Moniker >wp8 </Moniker >
25
32
</TargetFramework >
26
33
<TargetFramework Include =" Silverlight 4" >
27
- <Project >Renci.SshNet.Silverlight</ Project >
34
+ <OutputDirectory >Renci.SshNet.Silverlight\bin\$(Configuration)</ OutputDirectory >
28
35
<Moniker >sl4</Moniker >
29
36
</TargetFramework >
30
37
<TargetFramework Include =" Silverlight 5" >
31
- <Project >Renci.SshNet.Silverlight5</ Project >
38
+ <OutputDirectory >Renci.SshNet.Silverlight5\bin\$(Configuration)</ OutputDirectory >
32
39
<Moniker >sl5</Moniker >
33
40
</TargetFramework >
41
+ <TargetFramework Include =" Universal Windows Platform 10" >
42
+ <OutputDirectory >Renci.SshNet.UAP10\bin\$(Configuration)</OutputDirectory >
43
+ <Moniker >uap10</Moniker >
44
+ </TargetFramework >
34
45
</ItemGroup >
35
- <Import Project =" $(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />
36
46
<Target Name =" Clean" >
37
47
<RemoveDir Directories =" $(MSBuildThisFileDirectory)target" />
48
+ <ItemGroup >
49
+ <ProjectToBuild Remove =" @(ProjectToBuild)" />
50
+ <ProjectToBuild Include =" %(VisualStudioVersion.SolutionFile)" >
51
+ <Properties >Configuration=Release</Properties >
52
+ </ProjectToBuild >
53
+ </ItemGroup >
54
+ <MSBuild Projects =" @(ProjectToBuild)" Targets =" Clean" />
38
55
</Target >
39
-
40
- <Target Name =" Build" >
56
+ <Target Name =" DownloadNuGet" >
57
+ <MakeDir Directories =" $(MSBuildThisFileDirectory)target\nuget" />
58
+ <DownloadFile
59
+ Address=" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
60
+ FileName=" $(MSBuildThisFileDirectory)target\nuget\nuget.exe" />
61
+ </Target >
62
+ <Target Name =" RestoreNuGetPackages" DependsOnTargets =" DownloadNuGet" Outputs =" %(VisualStudioVersion.Identity)" >
63
+ <Message Text =" Restoring nuget packages for '%(VisualStudioVersion.SolutionFile)'..." Importance =" High" />
64
+ <Exec Command =" $(NuGetExe) restore " %(VisualStudioVersion.SolutionFile)" " />
65
+ </Target >
66
+ <Target Name =" Build" DependsOnTargets =" RestoreNuGetPackages" Outputs =" %(VisualStudioVersion.Identity)" >
41
67
<ItemGroup >
42
- <ProjectToBuild Include =" $(MSBuildThisFileDirectory)..\src\Renci.SshNet.VS2012.sln" >
68
+ <ProjectToBuild Remove =" @(ProjectToBuild)" />
69
+ <ProjectToBuild Include =" %(VisualStudioVersion.SolutionFile)" >
43
70
<Properties >Configuration=Release</Properties >
44
71
</ProjectToBuild >
45
72
</ItemGroup >
46
73
<MSBuild Projects =" @(ProjectToBuild)" Targets =" Rebuild" />
47
74
</Target >
48
-
49
75
<Target Name =" CreatePackage" DependsOnTargets =" CopyBuildOutputToPackage" >
50
76
<Exec Command =" $(NuGetExe) pack $(MSBuildThisFileDirectory)nuget\SSH.NET.nuspec -OutputDirectory " $(MSBuildThisFileDirectory)target" -BasePath " $(MSBuildThisFileDirectory)target\package" -NonInteractive" />
51
77
</Target >
52
78
<Target Name =" CopyBuildOutputToPackage" DependsOnTargets =" Build" Outputs =" %(TargetFramework.Identity)" >
53
79
<ItemGroup >
54
80
<BuildOutput Remove =" @(BuildOutput)" />
55
- <BuildOutput Include =" $(MSBuildThisFileDirectory)..\src\%(TargetFramework.Project)\bin\$(Configuration )\Renci.SshNet.dll" />
56
- <BuildOutput Include =" $(MSBuildThisFileDirectory)..\src\%(TargetFramework.Project)\bin\$(Configuration )\Renci.SshNet.xml" />
81
+ <BuildOutput Include =" $(MSBuildThisFileDirectory)..\src\%(TargetFramework.OutputDirectory )\Renci.SshNet.dll" />
82
+ <BuildOutput Include =" $(MSBuildThisFileDirectory)..\src\%(TargetFramework.OutputDirectory )\Renci.SshNet.xml" />
57
83
</ItemGroup >
58
84
<Copy SourceFiles =" @(BuildOutput)" DestinationFolder =" $(MSBuildThisFileDirectory)target\package\lib\%(TargetFramework.Moniker)" />
59
85
</Target >
60
86
<Target Name =" GenerateHelpFile" DependsOnTargets =" Build" >
87
+ <Error Text =" Please install Sandcastle, and ensure the SHFBFolder environment variable is set." Condition =" '$(SHFBFolder)'==''" />
61
88
<MSBuild Projects =" $(MSBuildThisFileDirectory)sandcastle\SSH.NET.shfbproj" />
62
89
</Target >
63
90
64
- <Target Name =" GenerateSourceZip" >
65
- <ItemGroup >
66
- <SourceFiles Include =" $(MSBuildThisFileDirectory)..\src\Renci.SshNet\**" Exclude =" $(MSBuildThisFileDirectory)..\src\Renci.SshNet\bin\**;$(MSBuildThisFileDirectory)..\src\Renci.SshNet\obj\**" />
67
- <SourceFiles Include =" $(MSBuildThisFileDirectory)..\src\Renci.SshNet.snk" />
68
- </ItemGroup >
69
- <Zip
70
- Files=" @(SourceFiles)"
71
- WorkingDirectory=" $(MSBuildThisFileDirectory).."
72
- ZipFileName=" $(MSBuildThisFileDirectory)target\Renci.SshNet.zip"
73
- ZipLevel=" 9" />
74
- </Target >
91
+ <UsingTask TaskName =" DownloadFile" TaskFactory =" CodeTaskFactory" AssemblyFile =" $(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
92
+ <ParameterGroup >
93
+ <Address ParameterType =" System.String" Required =" true" />
94
+ <FileName ParameterType =" System.String" Required =" true" />
95
+ </ParameterGroup >
96
+ <Task >
97
+ <Reference Include =" System" />
98
+ <Code Type =" Fragment" Language =" cs" >
99
+ <![CDATA[
100
+ new System.Net.WebClient().DownloadFile(Address, FileName);
101
+ ]]>
102
+ </Code >
103
+ </Task >
104
+ </UsingTask >
75
105
</Project >
0 commit comments