@@ -10,13 +10,18 @@ of patent rights can be found in the PATENTS file in the same directory.
10
10
<Project ToolsVersion =" 4.0" DefaultTargets =" Build;Test;Package" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
11
11
<PropertyGroup >
12
12
<Major >1</Major >
13
- <Minor >3 </Minor >
14
- <Build >1 </Build >
13
+ <Minor >4 </Minor >
14
+ <Build >0 </Build >
15
15
<Revision >0</Revision >
16
16
<DevNuGetServer >http://reactjs.net/packages/</DevNuGetServer >
17
17
<MSBuildCommunityTasksPath >$(MSBuildProjectDirectory)\tools\MSBuildTasks</MSBuildCommunityTasksPath >
18
- <SolutionFile >src\React.sln</SolutionFile >
19
18
<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 >
20
25
</PropertyGroup >
21
26
<ItemGroup >
22
27
<PackageAssemblies Include =" React" />
@@ -28,14 +33,12 @@ of patent rights can be found in the PATENTS file in the same directory.
28
33
<PackageAssemblies Include =" React.MSBuild" />
29
34
<PackageAssemblies Include =" React.JavaScriptEngine.VroomJs" />
30
35
<PackageAssemblies Include =" React.JavaScriptEngine.ClearScriptV8" />
36
+ <PackageAssembliesAspNet5 Include =" React.AspNet5" />
37
+ <AspNet5ProjectJson Include =" src/**/project.json" />
31
38
</ItemGroup >
32
39
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
+
39
42
<Target Name =" RestorePackages" >
40
43
<Exec
41
44
WorkingDirectory=" $(MSBuildProjectDirectory)"
@@ -47,27 +50,64 @@ of patent rights can be found in the PATENTS file in the same directory.
47
50
<GitVersion LocalPath =" $(MSBuildProjectDirectory)" >
48
51
<Output TaskParameter =" CommitHash" PropertyName =" Revision" />
49
52
</GitVersion >
50
- <!-- TODO: Only do this if a dev build -->
51
53
<Time Format =" yyyyMMdd-HHmm" >
52
54
<Output TaskParameter =" FormattedTime" PropertyName =" Date" />
53
55
</Time >
54
56
<!-- Prepend date to build version if a dev build-->
57
+ <PropertyGroup Condition =" $(BuildType) == 'Release'" >
58
+ <FullBuild >$(Build)</FullBuild >
59
+ </PropertyGroup >
55
60
<PropertyGroup Condition =" $(BuildType) != 'Release'" >
56
- <Build >$(Build)-dev-$(Date)</Build >
61
+ <FullBuild >$(Build)-dev-$(Date)</FullBuild >
57
62
</PropertyGroup >
63
+ <!-- Set version for .csproj projects -->
58
64
<AssemblyInfo
59
65
CodeLanguage=" CS"
60
66
OutputFile=" src\SharedAssemblyVersionInfo.cs"
61
67
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)" />
65
97
</Target >
66
98
67
99
<Target Name =" Build" DependsOnTargets =" RestorePackages;UpdateVersion" >
68
100
<MSBuild Projects =" $(SolutionFile)" Targets =" Rebuild" Properties =" Configuration=Release;Platform=Any CPU;NoWarn=1607" />
69
101
</Target >
70
102
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
+
71
111
<Target Name =" Test" DependsOnTargets =" Build" >
72
112
<ItemGroup >
73
113
<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.
98
138
/>
99
139
</Target >
100
140
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
+
101
149
<Target Name =" Push" >
102
150
<CallTarget Targets =" PushDev" Condition =" $(BuildType) != 'Release'" />
103
151
<CallTarget Targets =" PushRelease" Condition =" $(BuildType) == 'Release'" />
0 commit comments