提交 8eb4352a 编写于 作者: J Jared Parsons

Use global xml namespace

All of the XML literals in the file use the same xmlns value. Set a
global import so we can simplify the building of the literals.
上级 5a6a1849
...@@ -268,7 +268,7 @@ function Build-InsertionItems() { ...@@ -268,7 +268,7 @@ function Build-InsertionItems() {
Push-Location $setupDir Push-Location $setupDir
try { try {
Create-PerfTests Create-PerfTests
Exec-Console (Join-Path $configDir "Exes\DevDivInsertionFiles\Roslyn.BuildDevDivInsertionFiles.exe") "$configDir $setupDir $(Get-PackagesDir)" Exec-Console (Join-Path $configDir "Exes\DevDivInsertionFiles\Roslyn.BuildDevDivInsertionFiles.exe") "$configDir $repoDir $(Get-PackagesDir)"
# In non-official builds need to supply values for a few MSBuild properties. The actual value doesn't # In non-official builds need to supply values for a few MSBuild properties. The actual value doesn't
# matter, just that it's provided some value. # matter, just that it's provided some value.
......
...@@ -7,6 +7,10 @@ Imports System.Reflection.PortableExecutable ...@@ -7,6 +7,10 @@ Imports System.Reflection.PortableExecutable
Imports System.Reflection.Metadata Imports System.Reflection.Metadata
Imports System.Runtime.InteropServices Imports System.Runtime.InteropServices
' Set the global XML namespace to be the NuSpec namespace. This will simplify
' the building of xml literals in this file
Imports <xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
Public Class BuildDevDivInsertionFiles Public Class BuildDevDivInsertionFiles
Private Const DevDivInsertionFilesDirName = "DevDivInsertionFiles" Private Const DevDivInsertionFilesDirName = "DevDivInsertionFiles"
Private Const DevDivPackagesDirName = "DevDivPackages" Private Const DevDivPackagesDirName = "DevDivPackages"
...@@ -19,11 +23,15 @@ Public Class BuildDevDivInsertionFiles ...@@ -19,11 +23,15 @@ Public Class BuildDevDivInsertionFiles
Private ReadOnly _outputPackageDirectory As String Private ReadOnly _outputPackageDirectory As String
Private ReadOnly _setupDirectory As String Private ReadOnly _setupDirectory As String
Private ReadOnly _nugetPackageRoot As String Private ReadOnly _nugetPackageRoot As String
Private ReadOnly _nuspecDirectory As String
Private ReadOnly _pathMap As Dictionary(Of String, String) Private ReadOnly _pathMap As Dictionary(Of String, String)
Private Sub New(args As String()) Private Sub New(args As String())
_binDirectory = Path.GetFullPath(args(0)) _binDirectory = Path.GetFullPath(args(0))
_setupDirectory = Path.GetFullPath(args(1))
Dim repoDirectory = Path.GetFullPath(args(1))
_setupDirectory = Path.Combine(repoDirectory, "src\Setup")
_nuspecDirectory = Path.Combine(repoDirectory, "src\Nuget")
_nugetPackageRoot = Path.GetFullPath(args(2)) _nugetPackageRoot = Path.GetFullPath(args(2))
_outputDirectory = Path.Combine(_binDirectory, DevDivInsertionFilesDirName) _outputDirectory = Path.Combine(_binDirectory, DevDivInsertionFilesDirName)
_outputPackageDirectory = Path.Combine(_binDirectory, DevDivPackagesDirName) _outputPackageDirectory = Path.Combine(_binDirectory, DevDivPackagesDirName)
...@@ -1033,7 +1041,7 @@ Public Class BuildDevDivInsertionFiles ...@@ -1033,7 +1041,7 @@ Public Class BuildDevDivInsertionFiles
Next Next
Dim xml = <?xml version="1.0" encoding="utf-8"?> Dim xml = <?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package>
<metadata> <metadata>
<id><%= PackageName %></id> <id><%= PackageName %></id>
<summary>Roslyn binaries for the VS build.</summary> <summary>Roslyn binaries for the VS build.</summary>
...@@ -1045,7 +1053,7 @@ Public Class BuildDevDivInsertionFiles ...@@ -1045,7 +1053,7 @@ Public Class BuildDevDivInsertionFiles
<%= filesToInsert. <%= filesToInsert.
OrderBy(Function(f) f.Path). OrderBy(Function(f) f.Path).
Distinct(). Distinct().
Select(Function(f) <file src=<%= f.Path %> target=<%= f.Target %> xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"/>) %> Select(Function(f) <file src=<%= f.Path %> target=<%= f.Target %>/>) %>
</files> </files>
</package> </package>
...@@ -1094,7 +1102,7 @@ set DEVPATH=%RoslynToolsRoot%;%DEVPATH%" ...@@ -1094,7 +1102,7 @@ set DEVPATH=%RoslynToolsRoot%;%DEVPATH%"
Next Next
Dim xml = <?xml version="1.0" encoding="utf-8"?> Dim xml = <?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package>
<metadata> <metadata>
<id><%= PackageName %></id> <id><%= PackageName %></id>
<summary>Roslyn compiler binaries used to build VS</summary> <summary>Roslyn compiler binaries used to build VS</summary>
...@@ -1106,7 +1114,7 @@ set DEVPATH=%RoslynToolsRoot%;%DEVPATH%" ...@@ -1106,7 +1114,7 @@ set DEVPATH=%RoslynToolsRoot%;%DEVPATH%"
<file src="Init.cmd"/> <file src="Init.cmd"/>
<%= filesToInsert. <%= filesToInsert.
OrderBy(Function(f) f). OrderBy(Function(f) f).
Select(Function(f) <file src=<%= f %> xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"/>) %> Select(Function(f) <file src=<%= f %>/>) %>
</files> </files>
</package> </package>
......
...@@ -47,4 +47,4 @@ ...@@ -47,4 +47,4 @@
<Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\AssemblyInfo.vb" />
</ItemGroup> </ItemGroup>
<Import Project="..\..\..\build\Targets\Imports.targets" /> <Import Project="..\..\..\build\Targets\Imports.targets" />
</Project> </Project>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册