Skip to content

Commit a2e8479

Browse files
committed
Remove duplication in NuSpec files. Generate NuSpecs via XML transforms
1 parent 5770265 commit a2e8479

14 files changed

+108
-115
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
_old/
22
src/SharedAssemblyVersionInfo.cs
33
*.nupkg
4+
src/**/*.nuspec
45

56
## Ignore Visual Studio temporary files, build results, and
67
## files generated by popular Visual Studio add-ons.

build.proj

+13-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ of patent rights can be found in the PATENTS file in the same directory.
3131
AssemblyFile="src\packages\xunit.1.9.2\lib\net20\xunit.runner.msbuild.dll"
3232
TaskName="Xunit.Runner.MSBuild.xunit"
3333
/>
34+
<UsingTask
35+
AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.Tasks.dll"
36+
TaskName="TransformXml"
37+
/>
3438

3539
<Target Name="RestorePackages">
3640
<Exec
@@ -70,7 +74,15 @@ of patent rights can be found in the PATENTS file in the same directory.
7074
<xunit Assemblies="@(TestAssemblies)" />
7175
</Target>
7276

73-
<Target Name="Package" DependsOnTargets="Build">
77+
<Target Name="GenerateNuSpecs">
78+
<TransformXml
79+
Source="src/template.nuspec"
80+
Transform="src/%(PackageAssemblies.Identity)/%(PackageAssemblies.Identity).nutrans"
81+
Destination="src/%(PackageAssemblies.Identity)/%(PackageAssemblies.Identity).nuspec"
82+
/>
83+
</Target>
84+
85+
<Target Name="Package" DependsOnTargets="Build;GenerateNuSpecs">
7486
<!-- Delete old packages -->
7587
<RemoveDir Directories="$(PackageOutputDir)" />
7688

src/React.Web.Mvc4/React.Web.Mvc4.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<ItemGroup>
9393
<None Include="Content\Views\web.config.transform" />
9494
<None Include="packages.config" />
95-
<None Include="React.Web.Mvc4.nuspec" />
95+
<None Include="React.Web.Mvc4.nutrans" />
9696
</ItemGroup>
9797
<ItemGroup>
9898
<ProjectReference Include="..\React.Web\React.Web.csproj">

src/React.Web.Mvc4/React.Web.Mvc4.nuspec

-28
This file was deleted.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Copyright (c) 2014, Facebook, Inc.
4+
All rights reserved.
5+
6+
This source code is licensed under the BSD-style license found in the
7+
LICENSE file in the root directory of this source tree. An additional grant
8+
of patent rights can be found in the PATENTS file in the same directory.
9+
-->
10+
<package
11+
xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"
12+
xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
13+
<metadata>
14+
<title xdt:Transform="Insert">ReactJS.NET (MVC 4 and 5)</title>
15+
<description xdt:Transform="Insert">
16+
ReactJS tools for ASP.NET MVC 4 and 5. Please refer to project site (http://reactjs.net/)
17+
for more details, usage examples and sample code.
18+
</description>
19+
</metadata>
20+
<files xdt:Transform="Insert">
21+
<file src="Content\Views\web.config.transform" target="Content\Views" />
22+
</files>
23+
</package>

src/React.Web/React.Web.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<None Include="content\App_Start\ReactConfig.cs.pp" />
8181
<None Include="content\web.config.transform" />
8282
<None Include="packages.config" />
83-
<None Include="React.Web.nuspec" />
83+
<None Include="React.Web.nutrans" />
8484
</ItemGroup>
8585
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
8686
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

src/React.Web/React.Web.nuspec

-29
This file was deleted.

src/React.Web/React.Web.nutrans

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Copyright (c) 2014, Facebook, Inc.
4+
All rights reserved.
5+
6+
This source code is licensed under the BSD-style license found in the
7+
LICENSE file in the root directory of this source tree. An additional grant
8+
of patent rights can be found in the PATENTS file in the same directory.
9+
-->
10+
<package
11+
xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"
12+
xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
13+
<metadata>
14+
<title xdt:Transform="Insert">ReactJS.NET for ASP.NET</title>
15+
<description xdt:Transform="Insert">
16+
ReactJS tools for ASP.NET. If using ASP.NET MVC, also install React.Web.Mvc4. Please refer
17+
to project site (http://reactjs.net/) for more details, usage examples and sample code.
18+
</description>
19+
</metadata>
20+
<files xdt:Transform="Insert">
21+
<file src="Content\web.config.transform" target="Content" />
22+
<file src="Content\App_Start\ReactConfig.cs.pp" target="Content\App_Start" />
23+
</files>
24+
</package>

src/React.WebOptimization/React.WebOptimization.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
</ItemGroup>
7575
<ItemGroup>
7676
<None Include="packages.config" />
77-
<None Include="React.WebOptimization.nuspec" />
77+
<None Include="React.WebOptimization.nutrans" />
7878
</ItemGroup>
7979
<ItemGroup>
8080
<ProjectReference Include="..\React.Web\React.Web.csproj">

src/React.WebOptimization/React.WebOptimization.nuspec

-28
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Copyright (c) 2014, Facebook, Inc.
4+
All rights reserved.
5+
6+
This source code is licensed under the BSD-style license found in the
7+
LICENSE file in the root directory of this source tree. An additional grant
8+
of patent rights can be found in the PATENTS file in the same directory.
9+
-->
10+
<package
11+
xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"
12+
xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
13+
<metadata>
14+
<title xdt:Transform="Insert">ReactJS.NET - JSX for ASP.NET Web Optimization Framework</title>
15+
<description xdt:Transform="Insert">
16+
Allows you to compile JSX to JavaScript in the ASP.NET Web Optimization Framework.
17+
</description>
18+
</metadata>
19+
<files xdt:Transform="Insert">
20+
<file src="readme.txt" target="" />
21+
</files>
22+
</package>

src/React/React.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
</ItemGroup>
102102
<ItemGroup>
103103
<None Include="packages.config" />
104-
<None Include="React.nuspec" />
104+
<None Include="React.nutrans" />
105105
</ItemGroup>
106106
<ItemGroup>
107107
<EmbeddedResource Include="Resources\react-with-addons.js" />

src/React/React.nuspec

-25
This file was deleted.

src/React/React.nutrans

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Copyright (c) 2014, Facebook, Inc.
4+
All rights reserved.
5+
6+
This source code is licensed under the BSD-style license found in the
7+
LICENSE file in the root directory of this source tree. An additional grant
8+
of patent rights can be found in the PATENTS file in the same directory.
9+
-->
10+
<package
11+
xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"
12+
xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
13+
<metadata>
14+
<title xdt:Transform="Insert">ReactJS.NET Core</title>
15+
<description xdt:Transform="Insert">
16+
ReactJS tools for .NET. Important: This package does not do much on its own; you probably
17+
want an integration package (like React.Web.Mvc4) as well. Please refer to project site
18+
(http://reactjs.net/) for more details, usage examples and sample code.
19+
</description>
20+
</metadata>
21+
</package>

0 commit comments

Comments
 (0)