From 29d4b120c0ff9515bc4c99f40fe714d19200700e Mon Sep 17 00:00:00 2001 From: Tomas Matousek Date: Thu, 16 Feb 2017 18:58:25 -0800 Subject: [PATCH] Move toolset to a package --- Directory.Build.props | 17 +++ NuGet.Config | 20 +++ build/{Toolset => }/NuGet.props | 4 - build/{Targets => }/SignToolData.json | 0 build/Targets/NuGet.props | 14 --- build/Targets/Version.props | 7 -- build/{Targets => }/Toolset.proj | 4 +- build/Toolset/35MSSharedLib1024.snk | Bin 160 -> 0 bytes build/Toolset/Build.proj | 58 --------- build/Toolset/Compiler.props | 23 ---- .../GenerateInternalsVisibleTo.targets | 55 -------- build/Toolset/GenerateNuspecProperties.csx | 11 -- .../Toolset/GenerateNuspecProperties.targets | 39 ------ build/Toolset/GitHash.props | 35 ------ build/Toolset/Imports.targets | 18 --- build/Toolset/ProjectDefaults.props | 63 ---------- build/Toolset/ProjectLayout.props | 16 --- build/Toolset/RepoLayout.props | 22 ---- build/Toolset/Settings.props | 10 -- build/Toolset/Sign.proj | 19 --- build/Toolset/StrongName.targets | 46 ------- build/Toolset/Test.StdOutToXml.csx | 118 ------------------ build/Toolset/Test.props | 22 ---- build/Toolset/Test.targets | 52 -------- build/Toolset/Version.props | 47 ------- .../Dependencies.props => Versions.props} | 5 + build/build.proj | 6 +- build/build.ps1 | 2 +- .../Directory.Build.props | 12 +- .../Directory.Build.targets | 4 +- ...ft.DiaSymReader.Converter.UnitTests.csproj | 11 +- .../Microsoft.DiaSymReader.Converter.csproj | 4 +- src/Pdb2Pdb/Pdb2Pdb.csproj | 4 +- 33 files changed, 65 insertions(+), 703 deletions(-) create mode 100644 Directory.Build.props create mode 100644 NuGet.Config rename build/{Toolset => }/NuGet.props (85%) rename build/{Targets => }/SignToolData.json (100%) delete mode 100644 build/Targets/NuGet.props delete mode 100644 build/Targets/Version.props rename build/{Targets => }/Toolset.proj (84%) delete mode 100644 build/Toolset/35MSSharedLib1024.snk delete mode 100644 build/Toolset/Build.proj delete mode 100644 build/Toolset/Compiler.props delete mode 100644 build/Toolset/GenerateInternalsVisibleTo.targets delete mode 100644 build/Toolset/GenerateNuspecProperties.csx delete mode 100644 build/Toolset/GenerateNuspecProperties.targets delete mode 100644 build/Toolset/GitHash.props delete mode 100644 build/Toolset/Imports.targets delete mode 100644 build/Toolset/ProjectDefaults.props delete mode 100644 build/Toolset/ProjectLayout.props delete mode 100644 build/Toolset/RepoLayout.props delete mode 100644 build/Toolset/Settings.props delete mode 100644 build/Toolset/Sign.proj delete mode 100644 build/Toolset/StrongName.targets delete mode 100644 build/Toolset/Test.StdOutToXml.csx delete mode 100644 build/Toolset/Test.props delete mode 100644 build/Toolset/Test.targets delete mode 100644 build/Toolset/Version.props rename build/{Targets/Dependencies.props => Versions.props} (91%) rename build/Targets/Settings.props => src/Directory.Build.props (66%) rename build/Targets/Imports.targets => src/Directory.Build.targets (71%) diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..aa8b66f --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,17 @@ + + + + + + + Debug + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\')) + $(RepoRoot)build\SignToolData.json + $(RepoRoot)build\Versions.props + $(NuGetPackageRoot)RoslynTools.Microsoft.RepoToolset\$(RoslynToolsMicrosoftRepoToolsetVersion)\tools\ + + https://github.com/dotnet/symreader-converter + $(RepositoryUrl) + + \ No newline at end of file diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..fe2b915 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/Toolset/NuGet.props b/build/NuGet.props similarity index 85% rename from build/Toolset/NuGet.props rename to build/NuGet.props index 6cdbfa3..128dea0 100644 --- a/build/Toolset/NuGet.props +++ b/build/NuGet.props @@ -1,9 +1,5 @@ - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - $(NUGET_PACKAGES) diff --git a/build/Targets/SignToolData.json b/build/SignToolData.json similarity index 100% rename from build/Targets/SignToolData.json rename to build/SignToolData.json diff --git a/build/Targets/NuGet.props b/build/Targets/NuGet.props deleted file mode 100644 index 6cdbfa3..0000000 --- a/build/Targets/NuGet.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - $(NUGET_PACKAGES) - $(UserProfile)\.nuget\packages\ - $([System.Environment]::GetFolderPath(SpecialFolder.Personal))\.nuget\packages\ - $(NuGetPackageRoot)\ - - \ No newline at end of file diff --git a/build/Targets/Version.props b/build/Targets/Version.props deleted file mode 100644 index 1faeb10..0000000 --- a/build/Targets/Version.props +++ /dev/null @@ -1,7 +0,0 @@ - - - 1.0.0 - beta1 - - - \ No newline at end of file diff --git a/build/Targets/Toolset.proj b/build/Toolset.proj similarity index 84% rename from build/Targets/Toolset.proj rename to build/Toolset.proj index 9693712..ba05988 100644 --- a/build/Targets/Toolset.proj +++ b/build/Toolset.proj @@ -1,13 +1,13 @@  - net461 - $(MSBuildThisProjectDirectory)..\..\Artifacts\Toolset + $(MSBuildThisProjectDirectory)..\..\artifacts\Toolset + diff --git a/build/Toolset/35MSSharedLib1024.snk b/build/Toolset/35MSSharedLib1024.snk deleted file mode 100644 index 695f1b38774e839e5b90059bfb7f32df1dff4223..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 160 zcmV;R0AK$ABme*efB*oL000060ssI2Bme+XQ$aBR1ONa50098C{E+7Ye`kjtcRG*W zi8#m|)B?I?xgZ^2Sw5D;l4TxtPwG;3)3^j?qDHjEteSTF{rM+4WI`v zCD?tsZ^;k+S&r1&HRMb=j738S=;J$tCKNrc$@P|lZ - - - - - - - Debug - - Configuration=$(Configuration);OfficialBuild=$(OfficialBuild) - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build/Toolset/Compiler.props b/build/Toolset/Compiler.props deleted file mode 100644 index e17ab86..0000000 --- a/build/Toolset/Compiler.props +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - $(NuGetPackageRoot)Microsoft.Net.Compilers\$(ToolsetCompilerPackageVersion)\ - $(ToolsetCompilerPackageDir)build\Microsoft.Net.Compilers.props - - - - - - - - \ No newline at end of file diff --git a/build/Toolset/GenerateInternalsVisibleTo.targets b/build/Toolset/GenerateInternalsVisibleTo.targets deleted file mode 100644 index 2630c8b..0000000 --- a/build/Toolset/GenerateInternalsVisibleTo.targets +++ /dev/null @@ -1,55 +0,0 @@ - - - - $(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension) - - - - - false - - - - - , PublicKey=$(PublicKey) - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build/Toolset/GenerateNuspecProperties.csx b/build/Toolset/GenerateNuspecProperties.csx deleted file mode 100644 index e9863b1..0000000 --- a/build/Toolset/GenerateNuspecProperties.csx +++ /dev/null @@ -1,11 +0,0 @@ -#r "System.Xml.Linq" -using System.Xml.Linq; - -// Args: -// - Path to Dependencies.props -// - Output file path - -File.WriteAllLines(Args[1], - from e in XDocument.Load(Args[0]).Root.Descendants() - where e.Name.LocalName.EndsWith("Version") - select $"{e.Name.LocalName}={e.Value}"); diff --git a/build/Toolset/GenerateNuspecProperties.targets b/build/Toolset/GenerateNuspecProperties.targets deleted file mode 100644 index 2b67124..0000000 --- a/build/Toolset/GenerateNuspecProperties.targets +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - GenerateNuspecProperties;$(PackDependsOn) - - - - - <_NuspecPropertiesTempFile>$(IntermediateOutputPath)NuspecProps.txt - - - - - - - - - - $([System.IO.Path]::GetFullPath('$(OutDir)')) - version=$(Version);@(_PropsForDependencies, ';') - - - \ No newline at end of file diff --git a/build/Toolset/GitHash.props b/build/Toolset/GitHash.props deleted file mode 100644 index d6c4a43..0000000 --- a/build/Toolset/GitHash.props +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - $(BUILD_SOURCEVERSION) - - - - - $(GIT_COMMIT) - - - - - Not found - <_DotGitDir>$(RepoRoot)\.git - <_HeadFileContent Condition="Exists('$(_DotGitDir)/HEAD')">$([System.IO.File]::ReadAllText('$(_DotGitDir)/HEAD').Trim()) - <_RefPath Condition="$(_HeadFileContent.StartsWith('ref: '))">$(_DotGitDir)/$(_HeadFileContent.Substring(5)) - $([System.IO.File]::ReadAllText('$(_RefPath)').Trim()) - $(_HeadFileContent) - - - - \ No newline at end of file diff --git a/build/Toolset/Imports.targets b/build/Toolset/Imports.targets deleted file mode 100644 index 428c722..0000000 --- a/build/Toolset/Imports.targets +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - true - - - \ No newline at end of file diff --git a/build/Toolset/ProjectDefaults.props b/build/Toolset/ProjectDefaults.props deleted file mode 100644 index 7d9004a..0000000 --- a/build/Toolset/ProjectDefaults.props +++ /dev/null @@ -1,63 +0,0 @@ - - - - true - true - Microsoft Corporation - © Microsoft Corporation. All rights reserved. - Microsoft - true - true - http://go.microsoft.com/fwlink/?LinkId=529443 - - - false - - - - - - - true - $(NoWarn);1591 - - - - true - full - DEBUG;TRACE - - - - full - TRACE - true - - - - - - - Empty - Binary - On - On - On - Embed - true - - - - - true - true - true - - - - true - true - - - - \ No newline at end of file diff --git a/build/Toolset/ProjectLayout.props b/build/Toolset/ProjectLayout.props deleted file mode 100644 index ab3d374..0000000 --- a/build/Toolset/ProjectLayout.props +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - $([System.IO.Path]::GetFileName('$(MSBuildProjectDirectory)')) - $(ArtifactsBinDir)$(OutDirName)\ - $(BaseOutputPath) - $(ArtifactsObjDir)$(OutDirName)\ - $(BaseIntermediateOutputPath) - - \ No newline at end of file diff --git a/build/Toolset/RepoLayout.props b/build/Toolset/RepoLayout.props deleted file mode 100644 index a2f62af..0000000 --- a/build/Toolset/RepoLayout.props +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Debug - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\')) - $(RepoRoot).dotnet\ - $(DotNetRoot)dotnet.exe - $(RepoRoot)artifacts\ - $(ArtifactsDir)$(Configuration)\bin\ - $(ArtifactsDir)$(Configuration)\obj\ - $(ArtifactsDir)$(Configuration)\TestResults\ - $(ArtifactsDir)$(Configuration)\packages\ - - $(RepoRoot)build\Targets\SignToolData.json - $(RepoRoot)build\Targets\Dependencies.props - $(RepoRoot)build\Targets\Version.props - - \ No newline at end of file diff --git a/build/Toolset/Settings.props b/build/Toolset/Settings.props deleted file mode 100644 index be1d26c..0000000 --- a/build/Toolset/Settings.props +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/build/Toolset/Sign.proj b/build/Toolset/Sign.proj deleted file mode 100644 index a95d1d9..0000000 --- a/build/Toolset/Sign.proj +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/build/Toolset/StrongName.targets b/build/Toolset/StrongName.targets deleted file mode 100644 index a0b4093..0000000 --- a/build/Toolset/StrongName.targets +++ /dev/null @@ -1,46 +0,0 @@ - - - - - true - - - - - - - - - true - false - - - - - - - false - true - - - - - - - $(MSBuildThisFileDirectory)\35MSSharedLib1024.snk - 0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9 - 31BF3856AD364E35 - - - - - - - $(PrepareForBuildDependsOn);VerifyBuildFlags - - - - - - \ No newline at end of file diff --git a/build/Toolset/Test.StdOutToXml.csx b/build/Toolset/Test.StdOutToXml.csx deleted file mode 100644 index ddb7171..0000000 --- a/build/Toolset/Test.StdOutToXml.csx +++ /dev/null @@ -1,118 +0,0 @@ -#r "System.Xml.Linq" -using System.IO; -using System.Xml.Linq; -using System.Text.RegularExpressions; - -if (Args.Count != 2) -{ - WriteLine("Usage: ConvertTestOutputToXml.csx "); - return 1; -} - -int passed = 0; -int failed = 0; -int skipped = 0; - -var lines = File.ReadAllLines(Args[0]); - -if (lines.Length == 0) -{ - WriteLine("No results found"); - return 2; -} - -string firstLine = lines[0]; -if (!firstLine.StartsWith("Test run for ")) -{ - WriteLine("Unexpected data"); - return 3; -} - -var collectionXml = new XElement("collection"); - -int i = 1; -while (i < lines.Length) -{ - string line = lines[i]; - - XElement failureXml; - string testName; - if (line.StartsWith("Passed")) - { - testName = line.Substring("Passed".Length).Trim(); - failureXml = null; - passed++; - i++; - } - else if (line.StartsWith("Skipped")) - { - testName = line.Substring("Skipped".Length).Trim(); - failureXml = null; - skipped++; - i++; - } - else if(line.StartsWith("Failed")) - { - testName = line.Substring("Failed".Length).Trim(); - failed++; - i++; - - var message = new StringBuilder(); - while (i < lines.Length && !lines[i].StartsWith("Passed") && !lines[i].StartsWith("Failed") && !lines[i].StartsWith("Stack Trace:")) - { - message.AppendLine(lines[i]); - i++; - } - - var stackTrace = new StringBuilder(); - while (i < lines.Length && !lines[i].StartsWith("Passed") && !lines[i].StartsWith("Failed")) - { - stackTrace.AppendLine(lines[i]); - i++; - } - - failureXml = new XElement("failure"); - var messageXml = new XElement("message"); - messageXml.SetValue(message.ToString()); - var stackTraceXml = new XElement("stack-trace"); - stackTraceXml.SetValue(stackTrace.ToString()); - failureXml.Add(messageXml); - failureXml.Add(stackTraceXml); - - } - else - { - i++; - continue; - } - - var testXml = new XElement("test"); - testXml.SetAttributeValue("name", testName); - testXml.SetAttributeValue("result", failureXml != null ? "Fail" : "Pass"); - if (failureXml != null) - { - testXml.Add(failureXml); - } - - collectionXml.Add(testXml); -} - -collectionXml.SetAttributeValue("total", (passed + failed + skipped).ToString()); -collectionXml.SetAttributeValue("passed", passed.ToString()); -collectionXml.SetAttributeValue("failed", failed.ToString()); -collectionXml.SetAttributeValue("skipped", skipped.ToString()); -collectionXml.SetAttributeValue("name", "all tests"); - -var xml = new XDocument(); -var assembliesXml = new XElement("assemblies"); -var assemblyXml = new XElement("assembly"); - -var parts = firstLine.Substring("Test run for ".Length).Split(new[] { '(', ')' }); -assemblyXml.SetAttributeValue("name", parts[0]); -assemblyXml.SetAttributeValue("environment", parts[1]); -assemblyXml.Add(collectionXml); - -assembliesXml.Add(assemblyXml); -xml.Add(assembliesXml); -xml.Save(Args[1]); - diff --git a/build/Toolset/Test.props b/build/Toolset/Test.props deleted file mode 100644 index bf1d495..0000000 --- a/build/Toolset/Test.props +++ /dev/null @@ -1,22 +0,0 @@ - - - - true - - - - - - - - - - - - - - - PreserveNewest - - - \ No newline at end of file diff --git a/build/Toolset/Test.targets b/build/Toolset/Test.targets deleted file mode 100644 index b0ecb68..0000000 --- a/build/Toolset/Test.targets +++ /dev/null @@ -1,52 +0,0 @@ - - - - x64 - true - <_TestTargetName Condition="'$(TargetFrameworks)' == ''">InnerTest - <_TestTargetName Condition="'$(TargetFrameworks)' != ''">OuterTest - - - - - - - <_TestArchitectureItems Include="$(TestArchitectures)" /> - - - - <_TestOutPathNoExt>$(ArtifactsTestResultsDir)$(MSBuildProjectName)_$(TargetFramework)_%(_TestArchitectureItems.Identity) - <_TestStdOutPath>$(_TestOutPathNoExt).txt - <_TestLogPath>$(_TestOutPathNoExt).xml - - - - - - - - - - - - - - - - - - - - - - - InnerTest - - - \ No newline at end of file diff --git a/build/Toolset/Version.props b/build/Toolset/Version.props deleted file mode 100644 index 3bb37b1..0000000 --- a/build/Toolset/Version.props +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - $(VersionBase).0 - - - - - - $(VersionBase)-dev - $(VersionBase).0 - $(VersionBase).9000000 - $(FileVersion) - - - - - - <_BuildNumberFiveDigitDateStamp>$([MSBuild]::Subtract($(BUILD_BUILDNUMBER.Split('.')[0].Substring(3).Trim()), 8800)) - <_BuildNumberBuildOfTheDayPadded>$(BUILD_BUILDNUMBER.Split('.')[1].PadLeft(2,'0')) - $(VersionBase) - $(Version)-$(PreReleaseVersionLabel)-$(_BuildNumberFiveDigitDateStamp)-$(_BuildNumberBuildOfTheDayPadded) - $(VersionBase).$(_BuildNumberFiveDigitDateStamp) - $(VersionBase).$(_BuildNumberFiveDigitDateStamp)$(_BuildNumberBuildOfTheDayPadded) - $(Version). Commit Hash: $(GitHeadSha) - - - - diff --git a/build/Targets/Dependencies.props b/build/Versions.props similarity index 91% rename from build/Targets/Dependencies.props rename to build/Versions.props index 1d2b393..4c67df4 100644 --- a/build/Targets/Dependencies.props +++ b/build/Versions.props @@ -1,7 +1,12 @@  + + 1.0.0 + beta1 + + 1.0.0-alpha 1.0.0-rc4-004777 0.2.0 1.0.101 diff --git a/build/build.proj b/build/build.proj index b3a414c..dd709a4 100644 --- a/build/build.proj +++ b/build/build.proj @@ -12,11 +12,13 @@ $(MSBuildThisFileDirectory)..\SymReaderConverter.sln + + - + - \ No newline at end of file diff --git a/build/build.ps1 b/build/build.ps1 index 6723d0c..4978c78 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -19,7 +19,7 @@ $RepoRoot = Join-Path $PSScriptRoot "..\" $DotNetRoot = Join-Path $RepoRoot ".dotnet" $DotNetExe = Join-Path $DotNetRoot "dotnet.exe" $BuildProj = Join-Path $PSScriptRoot "build.proj" -$DependenciesProps = Join-Path $PSScriptRoot "Targets\Dependencies.props" +$DependenciesProps = Join-Path $PSScriptRoot "Versions.props" $ArtifactsDir = Join-Path $RepoRoot "artifacts" $LogDir = Join-Path $ArtifactsDir "log" $TempDir = Join-Path (Join-Path $ArtifactsDir $configuration) "tmp" diff --git a/build/Targets/Settings.props b/src/Directory.Build.props similarity index 66% rename from build/Targets/Settings.props rename to src/Directory.Build.props index 6ec3f67..9548990 100644 --- a/build/Targets/Settings.props +++ b/src/Directory.Build.props @@ -1,14 +1,10 @@ - - - + + + + - - https://github.com/dotnet/symreader-converter - $(RepositoryUrl) - - true diff --git a/build/Targets/Imports.targets b/src/Directory.Build.targets similarity index 71% rename from build/Targets/Imports.targets rename to src/Directory.Build.targets index e581aa3..c6aa41c 100644 --- a/build/Targets/Imports.targets +++ b/src/Directory.Build.targets @@ -1,7 +1,7 @@ - + - + \ No newline at end of file diff --git a/src/Microsoft.DiaSymReader.Converter.Tests/Microsoft.DiaSymReader.Converter.UnitTests.csproj b/src/Microsoft.DiaSymReader.Converter.Tests/Microsoft.DiaSymReader.Converter.UnitTests.csproj index 47f84ff..927c715 100644 --- a/src/Microsoft.DiaSymReader.Converter.Tests/Microsoft.DiaSymReader.Converter.UnitTests.csproj +++ b/src/Microsoft.DiaSymReader.Converter.Tests/Microsoft.DiaSymReader.Converter.UnitTests.csproj @@ -1,10 +1,13 @@  - - + + + + netcoreapp1.0;net46 true + @@ -12,5 +15,7 @@ - + + + \ No newline at end of file diff --git a/src/Microsoft.DiaSymReader.Converter/Microsoft.DiaSymReader.Converter.csproj b/src/Microsoft.DiaSymReader.Converter/Microsoft.DiaSymReader.Converter.csproj index 8641ce8..ff69d45 100644 --- a/src/Microsoft.DiaSymReader.Converter/Microsoft.DiaSymReader.Converter.csproj +++ b/src/Microsoft.DiaSymReader.Converter/Microsoft.DiaSymReader.Converter.csproj @@ -1,6 +1,5 @@  - - + netstandard1.3 true @@ -23,5 +22,4 @@ - \ No newline at end of file diff --git a/src/Pdb2Pdb/Pdb2Pdb.csproj b/src/Pdb2Pdb/Pdb2Pdb.csproj index f92de28..a836015 100644 --- a/src/Pdb2Pdb/Pdb2Pdb.csproj +++ b/src/Pdb2Pdb/Pdb2Pdb.csproj @@ -1,6 +1,5 @@  - - + net46 Microsoft.DiaSymReader.Tools @@ -14,5 +13,4 @@ Microsoft.DiaSymReader.Converter - \ No newline at end of file