Skip to content

Commit 6287ea4

Browse files
committed
Update build script to handle xproj projects
1 parent 58804c9 commit 6287ea4

File tree

23 files changed

+66
-139
lines changed

23 files changed

+66
-139
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ build:
66
project: build.proj
77
verbosity: normal
88
test_script:
9-
- nunit3-console.exe bin\ReleaseTests\React.Tests\React.Tests.dll
9+
- dotnet test --configuration Release --no-build tests/React.Tests
1010
artifacts:
1111
- path: output\*.nupkg

build.proj

Lines changed: 23 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ 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>2</Major>
13-
<Minor>5</Minor>
13+
<Minor>6</Minor>
1414
<Build>0</Build>
1515
<Revision>0</Revision>
1616
<DevNuGetServer>http://reactjs.net/packages/</DevNuGetServer>
@@ -21,30 +21,28 @@ of patent rights can be found in the PATENTS file in the same directory.
2121
<SolutionFile>src\React.sln</SolutionFile>
2222
</PropertyGroup>
2323
<ItemGroup>
24+
<PackageAssemblies Include="Cassette.React" />
25+
<PackageAssemblies Include="React.AspNet" />
2426
<PackageAssemblies Include="React.Core" />
27+
<PackageAssemblies Include="React.MSBuild" />
28+
<PackageAssemblies Include="React.Owin" />
2529
<PackageAssemblies Include="React.Web" />
2630
<PackageAssemblies Include="React.Web.Mvc4" />
2731
<PackageAssemblies Include="System.Web.Optimization.React" />
28-
<PackageAssemblies Include="Cassette.React" />
29-
<PackageAssemblies Include="React.MSBuild" />
30-
<PackageAssemblies Include="React.Owin" />
31-
<PackageAssembliesAspNetCore Include="React.AspNet" />
32-
<AspNetCoreProjectJson Include="src/wrap/**/project.json" />
33-
<AspNetCoreProjectJson Include="src/React.AspNet/project.json" />
34-
<AspNetCoreProjectJson Include="src/React.Sample.Mvc6/project.json" />
3532
</ItemGroup>
3633

3734
<Import Project="src/React.tasks.proj" />
3835

3936
<Target Name="RestorePackages" DependsOnTargets="Clean">
37+
<!-- NuGet packages for .xproj projects -->
4038
<Exec
4139
WorkingDirectory="$(MSBuildProjectDirectory)"
42-
Command="tools\NuGet\nuget.exe restore $(SolutionFile)"
40+
Command="dotnet restore"
4341
/>
44-
<!-- NuGet packages for ASP.NET Core projects -->
42+
<!-- NuGet packages for "legacy" projects (eg. React.Samples.Mvc4) -->
4543
<Exec
4644
WorkingDirectory="$(MSBuildProjectDirectory)"
47-
Command="dotnet restore src\React.AspNet src\React.Sample.Mvc6"
45+
Command="tools\NuGet\nuget.exe restore $(SolutionFile)"
4846
/>
4947
<!-- npm packages -->
5048
<Exec
@@ -66,32 +64,23 @@ of patent rights can be found in the PATENTS file in the same directory.
6664
</Time>
6765
<!-- Prepend date to build version if a dev build-->
6866
<PropertyGroup Condition="$(BuildType) == 'Release'">
69-
<FullBuild>$(Build)</FullBuild>
67+
<BuildSuffix></BuildSuffix>
7068
</PropertyGroup>
7169
<PropertyGroup Condition="$(BuildType) != 'Release'">
72-
<FullBuild>$(Build)-dev-$(Date)</FullBuild>
70+
<BuildSuffix>dev-$(Date)</BuildSuffix>
7371
</PropertyGroup>
74-
<!-- Set version for .csproj projects -->
72+
<!-- Set version for assemblies -->
7573
<AssemblyInfo
7674
CodeLanguage="CS"
7775
OutputFile="src\SharedAssemblyVersionInfo.cs"
7876
AssemblyVersion="$(Major).$(Minor)"
79-
AssemblyFileVersion="$(Major).$(Minor).$(FullBuild).$(Revision)"
80-
AssemblyInformationalVersion="$(Major).$(Minor).$(FullBuild)"
77+
AssemblyFileVersion="$(Major).$(Minor).$(Build)$(BuildSuffix).$(Revision)"
78+
AssemblyInformationalVersion="$(Major).$(Minor).$(Build)$(BuildSuffix)"
8179
/>
82-
<!--
83-
Set version for ASP.NET Core projects. In theory K_BUILD_VERSION should work but it doesn't seem
84-
to be functional yet :(. We work around this by physically writing the build number to the
85-
project.json files. For development builds we write the full version number (including
86-
build date) and reset it later so the dev build number isn't commited to the repo.
87-
-->
88-
<!--SetEnvironmentVariable
89-
Name="K_BUILD_VERSION"
90-
Value="$(Build)"
91-
/-->
80+
<!-- Ensure version numbers in project.json files are in sync -->
9281
<UpdateAspNetProjectVersion
93-
Files="@(AspNetCoreProjectJson)"
94-
Version="$(Major).$(Minor).$(FullBuild)"
82+
Files="src/%(PackageAssemblies.Identity)/project.json"
83+
Version="$(Major).$(Minor).$(Build)-*"
9584
/>
9685
</Target>
9786

@@ -101,7 +90,7 @@ of patent rights can be found in the PATENTS file in the same directory.
10190
do it here. See https://github.com/aspnet/XRE/issues/1301
10291
-->
10392
<DeleteTree Directories="src/artifacts" />
104-
<DeleteTree Directories="bin/%(PackageAssembliesAspNetCore.Identity)/Release" />
93+
<DeleteTree Directories="src/%(PackageAssemblies.Identity)/bin" />
10594
</Target>
10695

10796
<Target Name="Build" DependsOnTargets="RestorePackages;UpdateVersion">
@@ -110,48 +99,22 @@ of patent rights can be found in the PATENTS file in the same directory.
11099
<Exec WorkingDirectory="src/React.Sample.Webpack" Command="node_modules/.bin/webpack" />
111100
</Target>
112101

113-
<Target Name="ResetAspNetVersion" AfterTargets="AspNetPackages">
114-
<!-- Resets the version number in ASP.NET Core project.json files so we don't commit -dev- version numbers -->
115-
<UpdateAspNetProjectVersion
116-
Files="@(AspNetCoreProjectJson)"
117-
Version="$(Major).$(Minor).$(Build)-*"
118-
/>
119-
</Target>
120-
121102
<Target Name="Test" DependsOnTargets="Build">
122-
<ItemGroup>
123-
<TestAssemblies Include="bin/ReleaseTests/**/React.Tests*.dll" />
124-
</ItemGroup>
125-
<NUnit
126-
ToolPath="src\packages\NUnit.Runners.2.6.3\tools"
127-
Assemblies="@(TestAssemblies)"
128-
/>
129-
</Target>
130-
131-
<Target Name="GenerateNuSpecs">
132-
<TransformXml
133-
Source="src/template.nuspec"
134-
Transform="src/%(PackageAssemblies.Identity)/%(PackageAssemblies.Identity).nutrans"
135-
Destination="src/%(PackageAssemblies.Identity)/%(PackageAssemblies.Identity).nuspec"
103+
<Exec
104+
WorkingDirectory="$(MSBuildProjectDirectory)"
105+
Command="dotnet test --configuration Release --no-build tests/React.Tests"
136106
/>
137107
</Target>
138108

139-
<Target Name="Package" DependsOnTargets="Build;GenerateNuSpecs">
109+
<Target Name="Package" DependsOnTargets="Build">
140110
<!-- Delete old packages -->
141111
<RemoveDir Directories="$(PackageOutputDir)" />
142112

143113
<!-- Create new packages -->
144114
<MakeDir Directories="$(PackageOutputDir)" />
145115
<Exec
146116
WorkingDirectory="$(MSBuildProjectDirectory)"
147-
Command="tools\NuGet\nuget.exe pack src/%(PackageAssemblies.Identity)/%(PackageAssemblies.Identity).csproj -IncludeReferencedProjects -Symbols -Prop Configuration=Release -OutputDirectory output"
148-
/>
149-
</Target>
150-
151-
<Target Name="AspNetPackages" AfterTargets="Package">
152-
<Exec
153-
WorkingDirectory="$(MSBuildProjectDirectory)"
154-
Command="dotnet pack --output $(PackageOutputDir) --build-base-path bin/ --configuration Release --no-build src/%(PackageAssembliesAspNetCore.Identity)/project.json"
117+
Command="dotnet pack --output $(PackageOutputDir) --configuration Release --version-suffix $(BuildSuffix) --no-build src/%(PackageAssemblies.Identity)"
155118
/>
156119
</Target>
157120

dev-build-push.bat

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
@echo off
2-
IF EXIST "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" (
3-
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /t:Package;Push /p:BuildType=Dev
4-
) ELSE (
5-
"%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" build.proj /t:Package;Push /p:BuildType=Dev
6-
)
2+
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /t:Package;Push /p:BuildType=Dev
73
pause

dev-build.bat

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
@echo off
2-
IF EXIST "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" (
3-
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj
4-
) ELSE (
5-
"%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" build.proj
6-
)
2+
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj
73
pause

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "1.0.0-preview2-003121"
4+
},
5+
"projects": [ "src", "test" ]
6+
}

release-build-push.bat

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
@echo off
2-
IF EXIST "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" (
3-
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /t:Package;Push /p:BuildType=Release
4-
) ELSE (
5-
"%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" build.proj /t:Package;Push /p:BuildType=Release
6-
)
2+
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /t:Package;Push /p:BuildType=Release
73
pause

release-build.bat

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
@echo off
2-
IF EXIST "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" (
3-
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /p:BuildType=Release
4-
) ELSE (
5-
"%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" build.proj /p:BuildType=Release
6-
)
7-
pause
2+
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" build.proj /p:BuildType=Release
83
pause

src/Cassette.React/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"version": "2.6.0-*",
33
"title": "ReactJS.NET - Babel for Cassette",
44
"authors": [ "Daniel Lo Nigro" ],

src/React.AspNet/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.5.0-*",
2+
"version": "2.6.0-*",
33
"authors": [ "Daniel Lo Nigro" ],
44
"copyright": "Copyright 2014-Present Facebook, Inc",
55
"title": "ReactJS.NET (ASP.NET Core MVC)",

src/React.Core/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"version": "2.6.0-*",
33
"title": "ReactJS.NET Core",
44
"authors": [ "Daniel Lo Nigro" ],

src/React.MSBuild/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"version": "2.6.0-*",
33
"title": "ReactJS.NET - Babel for MSBuild",
44
"authors": [ "Daniel Lo Nigro" ],

src/React.Owin/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"version": "2.6.0-*",
33
"title": "ReactJS.NET - Babel for OWIN",
44
"authors": [ "Daniel Lo Nigro" ],

src/React.Sample.Cassette/Cassette.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
77
<UsingTask AssemblyFile="$(OutputPath)\Cassette.MSBuild.dll" TaskName="CreateBundles"/>
88
<Target Name="Bundle">
9-
<CreateBundles />
9+
<!--CreateBundles /-->
1010
<!--
1111
CreateBundles has the following optional properties:
1212
Source: The root directory of the web application.
@@ -19,4 +19,4 @@
1919
<cassette cacheDirectory="cassette-cache" />
2020
-->
2121
</Target>
22-
</Project>
22+
</Project>

src/React.Sample.Cassette/React.Sample.Cassette.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
</Reference>
6767
<Reference Include="Cassette.React, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
6868
<SpecificVersion>False</SpecificVersion>
69-
<HintPath>..\Cassette.React\bin\Debug\net40\Cassette.React.dll</HintPath>
69+
<HintPath>..\Cassette.React\bin\$(Configuration)\net40\Cassette.React.dll</HintPath>
7070
</Reference>
7171
<Reference Include="Cassette.Views, Version=2.4.2.13844, Culture=neutral, processorArchitecture=MSIL">
7272
<HintPath>..\packages\Cassette.Views.2.4.2\lib\net40\Cassette.Views.dll</HintPath>
@@ -79,15 +79,15 @@
7979
<Reference Include="Microsoft.CSharp" />
8080
<Reference Include="React.Core, Version=2.6.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78, processorArchitecture=MSIL">
8181
<SpecificVersion>False</SpecificVersion>
82-
<HintPath>..\React.Core\bin\Debug\net40\React.Core.dll</HintPath>
82+
<HintPath>..\React.Core\bin\$(Configuration)\net40\React.Core.dll</HintPath>
8383
</Reference>
8484
<Reference Include="React.Web, Version=2.6.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78, processorArchitecture=MSIL">
8585
<SpecificVersion>False</SpecificVersion>
86-
<HintPath>..\React.Web\bin\Debug\net40\React.Web.dll</HintPath>
86+
<HintPath>..\React.Web\bin\$(Configuration)\net40\React.Web.dll</HintPath>
8787
</Reference>
8888
<Reference Include="React.Web.Mvc4, Version=2.6.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78, processorArchitecture=MSIL">
8989
<SpecificVersion>False</SpecificVersion>
90-
<HintPath>..\React.Web.Mvc4\bin\Debug\net40\React.Web.Mvc4.dll</HintPath>
90+
<HintPath>..\React.Web.Mvc4\bin\$(Configuration)\net40\React.Web.Mvc4.dll</HintPath>
9191
</Reference>
9292
<Reference Include="System" />
9393
<Reference Include="System.Data" />
@@ -236,4 +236,4 @@
236236
</Target>
237237
<Target Name="AfterBuild">
238238
</Target> -->
239-
</Project>
239+
</Project>

src/React.Sample.Mvc4/React.Sample.Mvc4.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@
8484
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
8585
</Reference>
8686
<Reference Include="React.Core">
87-
<HintPath>..\React.Core\bin\Debug\net40\React.Core.dll</HintPath>
87+
<HintPath>..\React.Core\bin\$(Configuration)\net40\React.Core.dll</HintPath>
8888
</Reference>
8989
<Reference Include="React.Web">
90-
<HintPath>..\React.Web\bin\Debug\net40\React.Web.dll</HintPath>
90+
<HintPath>..\React.Web\bin\$(Configuration)\net40\React.Web.dll</HintPath>
9191
</Reference>
9292
<Reference Include="React.Web.Mvc4">
93-
<HintPath>..\React.Web.Mvc4\bin\Debug\net40\React.Web.Mvc4.dll</HintPath>
93+
<HintPath>..\React.Web.Mvc4\bin\$(Configuration)\net40\React.Web.Mvc4.dll</HintPath>
9494
</Reference>
9595
<Reference Include="System" />
9696
<Reference Include="System.Data" />
@@ -106,7 +106,7 @@
106106
<Reference Include="System.Web" />
107107
<Reference Include="System.Web.Abstractions" />
108108
<Reference Include="System.Web.Optimization.React">
109-
<HintPath>..\System.Web.Optimization.React\bin\Debug\net40\System.Web.Optimization.React.dll</HintPath>
109+
<HintPath>..\System.Web.Optimization.React\bin\$(Configuration)\net40\System.Web.Optimization.React.dll</HintPath>
110110
</Reference>
111111
<Reference Include="System.Web.Routing" />
112112
<Reference Include="System.Xml" />
@@ -252,4 +252,4 @@
252252
</Target>
253253
<Target Name="AfterBuild">
254254
</Target> -->
255-
</Project>
255+
</Project>

src/React.Sample.Webpack/React.Sample.Webpack.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@
6666
<Reference Include="Microsoft.CSharp" />
6767
<Reference Include="React.Core, Version=2.6.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78, processorArchitecture=MSIL">
6868
<SpecificVersion>False</SpecificVersion>
69-
<HintPath>..\React.Core\bin\Debug\net40\React.Core.dll</HintPath>
69+
<HintPath>..\React.Core\bin\$(Configuration)\net40\React.Core.dll</HintPath>
7070
</Reference>
7171
<Reference Include="React.Web, Version=2.6.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78, processorArchitecture=MSIL">
7272
<SpecificVersion>False</SpecificVersion>
73-
<HintPath>..\React.Web\bin\Debug\net40\React.Web.dll</HintPath>
73+
<HintPath>..\React.Web\bin\$(Configuration)\net40\React.Web.dll</HintPath>
7474
</Reference>
7575
<Reference Include="React.Web.Mvc4, Version=2.6.0.0, Culture=neutral, PublicKeyToken=9aed67b161f7db78, processorArchitecture=MSIL">
7676
<SpecificVersion>False</SpecificVersion>
77-
<HintPath>..\React.Web.Mvc4\bin\Debug\net40\React.Web.Mvc4.dll</HintPath>
77+
<HintPath>..\React.Web.Mvc4\bin\$(Configuration)\net40\React.Web.Mvc4.dll</HintPath>
7878
</Reference>
7979
<Reference Include="System" />
8080
<Reference Include="System.Data" />
@@ -215,4 +215,4 @@
215215
</Target>
216216
<Target Name="AfterBuild">
217217
</Target> -->
218-
</Project>
218+
</Project>

src/React.Web.Mvc4/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"version": "2.6.0-*",
33
"title": "ReactJS.NET (MVC 4 and 5)",
44
"authors": [ "Daniel Lo Nigro" ],

src/React.Web/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"version": "2.6.0-*",
33
"title": "ReactJS.NET for ASP.NET",
44
"authors": [ "Daniel Lo Nigro" ],

src/React.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,19 @@ EndProject
3131
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.Sample.Mvc4", "React.Sample.Mvc4\React.Sample.Mvc4.csproj", "{22796879-968A-4C26-9B4B-4C44792B36DB}"
3232
ProjectSection(ProjectDependencies) = postProject
3333
{AF531A37-B93F-4113-9C2C-4DB28064B926} = {AF531A37-B93F-4113-9C2C-4DB28064B926}
34+
{889CEF81-75D6-4BAB-8E2C-B64B7CA97C77} = {889CEF81-75D6-4BAB-8E2C-B64B7CA97C77}
3435
{662D52AC-1EE9-4372-BD74-379F9AC56451} = {662D52AC-1EE9-4372-BD74-379F9AC56451}
3536
EndProjectSection
3637
EndProject
3738
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.Sample.Cassette", "React.Sample.Cassette\React.Sample.Cassette.csproj", "{F1EB6834-80A5-411C-90FD-CECC05715A10}"
39+
ProjectSection(ProjectDependencies) = postProject
40+
{B7D39E1D-6CAA-4489-A03F-0C176402CFB2} = {B7D39E1D-6CAA-4489-A03F-0C176402CFB2}
41+
EndProjectSection
3842
EndProject
3943
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "React.Sample.Webpack", "React.Sample.Webpack\React.Sample.Webpack.csproj", "{E20376AD-80F7-4865-ACE3-1DE616991DF7}"
44+
ProjectSection(ProjectDependencies) = postProject
45+
{662D52AC-1EE9-4372-BD74-379F9AC56451} = {662D52AC-1EE9-4372-BD74-379F9AC56451}
46+
EndProjectSection
4047
EndProject
4148
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "React.Sample.Mvc6", "React.Sample.Mvc6\React.Sample.Mvc6.xproj", "{022DC77E-5E48-4CF4-AD8B-DC4B9B52E02E}"
4249
ProjectSection(ProjectDependencies) = postProject

0 commit comments

Comments
 (0)