@@ -10,13 +10,18 @@ of patent rights can be found in the PATENTS file in the same directory.
1010<Project ToolsVersion =" 4.0" DefaultTargets =" Build;Test;Package" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
1111 <PropertyGroup >
1212 <Major >1</Major >
13- <Minor >3 </Minor >
14- <Build >1 </Build >
13+ <Minor >4 </Minor >
14+ <Build >0 </Build >
1515 <Revision >0</Revision >
1616 <DevNuGetServer >http://reactjs.net/packages/</DevNuGetServer >
1717 <MSBuildCommunityTasksPath >$(MSBuildProjectDirectory)\tools\MSBuildTasks</MSBuildCommunityTasksPath >
18- <SolutionFile >src\React.sln</SolutionFile >
1918 <PackageOutputDir >output</PackageOutputDir >
19+
20+ <!-- Only build ASP.NET 5 projects if on MSBuild 14+ (VS2015+) -->
21+ <BuildAspNet5 >false</BuildAspNet5 >
22+ <BuildAspNet5 Condition =" $(VisualStudioVersion) == '14.0'" >true</BuildAspNet5 >
23+ <SolutionFile >src\React.VS2015.sln</SolutionFile >
24+ <SolutionFile Condition =" $(BuildAspNet5) == 'false'" >src\React.sln</SolutionFile >
2025 </PropertyGroup >
2126 <ItemGroup >
2227 <PackageAssemblies Include =" React" />
@@ -28,14 +33,12 @@ of patent rights can be found in the PATENTS file in the same directory.
2833 <PackageAssemblies Include =" React.MSBuild" />
2934 <PackageAssemblies Include =" React.JavaScriptEngine.VroomJs" />
3035 <PackageAssemblies Include =" React.JavaScriptEngine.ClearScriptV8" />
36+ <PackageAssembliesAspNet5 Include =" React.AspNet5" />
37+ <AspNet5ProjectJson Include =" src/**/project.json" />
3138 </ItemGroup >
3239
33- <Import Project =" $(MSBuildProjectDirectory)\tools\MSBuildTasks\MSBuild.Community.Tasks.Targets" />
34- <UsingTask
35- AssemblyFile=" $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll"
36- TaskName=" TransformXml"
37- />
38-
40+ <Import Project =" src/React.tasks.proj" />
41+
3942 <Target Name =" RestorePackages" >
4043 <Exec
4144 WorkingDirectory=" $(MSBuildProjectDirectory)"
@@ -47,27 +50,64 @@ of patent rights can be found in the PATENTS file in the same directory.
4750 <GitVersion LocalPath =" $(MSBuildProjectDirectory)" >
4851 <Output TaskParameter =" CommitHash" PropertyName =" Revision" />
4952 </GitVersion >
50- <!-- TODO: Only do this if a dev build -->
5153 <Time Format =" yyyyMMdd-HHmm" >
5254 <Output TaskParameter =" FormattedTime" PropertyName =" Date" />
5355 </Time >
5456 <!-- Prepend date to build version if a dev build-->
57+ <PropertyGroup Condition =" $(BuildType) == 'Release'" >
58+ <FullBuild >$(Build)</FullBuild >
59+ </PropertyGroup >
5560 <PropertyGroup Condition =" $(BuildType) != 'Release'" >
56- <Build >$(Build)-dev-$(Date)</Build >
61+ <FullBuild >$(Build)-dev-$(Date)</FullBuild >
5762 </PropertyGroup >
63+ <!-- Set version for .csproj projects -->
5864 <AssemblyInfo
5965 CodeLanguage=" CS"
6066 OutputFile=" src\SharedAssemblyVersionInfo.cs"
6167 AssemblyVersion=" $(Major).$(Minor)"
62- AssemblyFileVersion=" $(Major).$(Minor).$(Build).$(Revision)"
63- AssemblyInformationalVersion=" $(Major).$(Minor).$(Build)"
64- />
68+ AssemblyFileVersion=" $(Major).$(Minor).$(FullBuild).$(Revision)"
69+ AssemblyInformationalVersion=" $(Major).$(Minor).$(FullBuild)"
70+ />
71+ <!--
72+ Set version for ASP.NET 5 projects. In theory K_BUILD_VERSION should work but it doesn't seem
73+ to be functional yet :(. We work around this by physically writing the build number to the
74+ project.json files. For development builds we write the full version number (including
75+ build date) and reset it later so the dev build number isn't commited to the repo.
76+ -->
77+ <!-- SetEnvironmentVariable
78+ Condition="$(BuildAspNet5) == 'true'"
79+ Name="K_BUILD_VERSION"
80+ Value="$(Build)"
81+ /-->
82+ <UpdateAspNetProjectVersion
83+ Files=" @(AspNet5ProjectJson)"
84+ Version=" $(Major).$(Minor).$(FullBuild)"
85+ />
86+ </Target >
87+
88+ <Target Name =" Clean" BeforeTargets =" Build" >
89+ <!--
90+ ASP.NET 5 projects don't delete generated .nupkg files when cleaned or rebuilt, so we need to
91+ do it here. See https://github.com/aspnet/XRE/issues/1301
92+ -->
93+ <ItemGroup >
94+ <OldAspNet5Packages Include =" bin/%(PackageAssembliesAspNet5.Identity)/**/*.nupkg" />
95+ </ItemGroup >
96+ <Delete Files =" @(OldAspNet5Packages)" />
6597 </Target >
6698
6799 <Target Name =" Build" DependsOnTargets =" RestorePackages;UpdateVersion" >
68100 <MSBuild Projects =" $(SolutionFile)" Targets =" Rebuild" Properties =" Configuration=Release;Platform=Any CPU;NoWarn=1607" />
69101 </Target >
70102
103+ <Target Name =" ResetAspNetVersion" AfterTargets =" Build" >
104+ <!-- Resets the version number in ASP.NET project.json files so we don't commit -dev- version numbers -->
105+ <UpdateAspNetProjectVersion
106+ Files=" @(AspNet5ProjectJson)"
107+ Version=" $(Major).$(Minor).$(Build)-*"
108+ />
109+ </Target >
110+
71111 <Target Name =" Test" DependsOnTargets =" Build" >
72112 <ItemGroup >
73113 <TestAssemblies Include =" bin/ReleaseTests/**/React.Tests*.dll" />
@@ -98,6 +138,14 @@ of patent rights can be found in the PATENTS file in the same directory.
98138 />
99139 </Target >
100140
141+ <Target Name =" CopyAspNetPackages" AfterTargets =" Package" Condition =" $(BuildAspNet5) == 'true'" >
142+ <!-- Copy over ASP.NET 5 packages -->
143+ <ItemGroup >
144+ <AspNet5Packages Include =" bin/%(PackageAssembliesAspNet5.Identity)/Release/*.nupkg" />
145+ </ItemGroup >
146+ <Copy SourceFiles =" @(AspNet5Packages)" DestinationFolder =" output" />
147+ </Target >
148+
101149 <Target Name =" Push" >
102150 <CallTarget Targets =" PushDev" Condition =" $(BuildType) != 'Release'" />
103151 <CallTarget Targets =" PushRelease" Condition =" $(BuildType) == 'Release'" />
0 commit comments