From a5c6d503da467fb7c9816828719b6a036636da1b Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 29 Jan 2018 10:22:00 -0800 Subject: [PATCH] Moving to repo-toolset --- .gitattributes | 74 +++++ CommandLine-netcore.sln | 52 --- .../CommandLine.Tests-netcore.csproj | 24 -- CommandLine.Tests/CommandLine.Tests.csproj | 135 -------- CommandLine.Tests/Properties/AssemblyInfo.cs | 15 - CommandLine.Tests/packages.config | 11 - CommandLine.sln | 59 ++-- CommandLine/CommandLine-netcore.csproj | 11 - CommandLine/CommandLine.csproj | 80 ----- CommandLine/Properties/AssemblyInfo.cs | 15 - CommandLine/packages.config | 3 - Directory.Build.props | 33 +- LICENSE => LICENSE.TXT | 0 NuGet.config | 11 - RestoreSources.props | 9 - .../CommandLine.SampleParsers-netcore.csproj | 20 -- .../CommandLine.SampleParsers.csproj | 129 -------- SampleParsers/Properties/AssemblyInfo.cs | 15 - SampleParsers/packages.config | 11 - build.cmd | 8 +- build.proj | 52 --- build.ps1 | 29 -- build.sh | 44 +-- build/NuGet.props | 17 + build/SignToolData.json | 18 ++ build/Toolset.proj | 14 + build/Versions.props | 35 ++ build/build.ps1 | 262 +++++++++++++++ build/build.sh | 303 ++++++++++++++++++ build/cibuild.cmd | 3 + build/cibuild.sh | 11 + dotnet/Properties/AssemblyInfo.cs | 15 - dotnet/dotnet-netcore.csproj | 19 -- dotnet/dotnet.csproj | 80 ----- dotnet/packages.config | 5 - netci.groovy | 69 ++-- restore.cmd | 3 + restore.sh | 11 + src/Directory.Build.props | 29 ++ src/Directory.Build.targets | 7 + .../source/CommandLine}/Accept.cs | 0 .../source/CommandLine}/AppliedOption.cs | 0 .../CommandLine}/AppliedOptionExtensions.cs | 0 .../source/CommandLine}/AppliedOptionSet.cs | 0 .../source/CommandLine}/ArgumentsRule.cs | 0 .../CommandLine}/ArgumentsRuleExtensions.cs | 0 .../source/CommandLine}/Command.cs | 0 .../CommandLine}/CommandExecutionResult.cs | 0 .../source/CommandLine}/Create.cs | 0 .../CommandLine}/DefaultHelpViewText.cs | 0 .../CommandLine}/DefaultValidationMessages.cs | 0 .../CommandLine}/EnumerableExtensions.cs | 0 .../source/CommandLine}/HelpViewExtensions.cs | 0 .../CommandLine}/IValidationMessages.cs | 0 .../Microsoft.DotNet.Cli.CommandLine.csproj | 18 ++ .../source/CommandLine}/Option.cs | 0 .../source/CommandLine}/OptionError.cs | 0 .../source/CommandLine}/OptionExtensions.cs | 0 .../source/CommandLine}/OptionSet.cs | 0 .../source/CommandLine}/OptionSet{T}.cs | 0 .../source/CommandLine}/ParseException.cs | 0 .../source/CommandLine}/ParseResult.cs | 0 .../CommandLine}/ParseResultExtensions.cs | 0 .../source/CommandLine}/Parser.cs | 0 .../CommandLine}/ParserConfiguration.cs | 0 .../source/CommandLine}/ParserExtensions.cs | 0 .../Register-ArgumentCompleter.ps1 | 0 .../source/CommandLine}/StringExtensions.cs | 0 .../source/CommandLine}/Suggest.cs | 0 .../source/CommandLine}/Token.cs | 0 .../source/CommandLine}/TokenType.cs | 0 .../source/CommandLine}/ValidationMessages.cs | 0 .../CommandLine.Tests}/AppliedOptionTests.cs | 0 .../ArgumentsRuleCompositionTests.cs | 0 .../CommandExecutionTests.cs | 0 .../tests/CommandLine.Tests}/CommandTests.cs | 0 .../tests/CommandLine.Tests}/HelpViewTests.cs | 0 .../CommandLine.Tests}/MaterializerTests.cs | 0 ...rosoft.DotNet.Cli.CommandLine.Tests.csproj | 27 ++ .../tests/CommandLine.Tests}/OptionTests.cs | 0 .../CommandLine.Tests}/ParseDiagramTests.cs | 0 .../tests/CommandLine.Tests}/ParserTests.cs | 0 .../ParsingValidationTests.cs | 3 +- .../CommandLine.Tests}/SuggestionTests.cs | 0 .../tests/CommandLine.Tests}/TokenizeTests.cs | 0 .../ValidationMessageLocalizationTests.cs | 0 .../CommandLine.SampleParsers.csproj | 32 ++ .../Dotnet/AssertionExtensions.cs | 0 .../SampleParsers}/Dotnet/DotNetParser.cs | 0 .../Dotnet/DotnetParserHelpViewTests.cs | 0 .../Dotnet/DotnetParserTests.cs | 0 .../SampleParsers}/Dotnet/SuggestionTests.cs | 0 {dotnet => src/xamples/dotnet}/App.config | 0 {dotnet => src/xamples/dotnet}/Program.cs | 0 src/xamples/dotnet/dotnet.csproj | 27 ++ .../xamples/dotnet}/register-completions.bash | 0 .../xamples/dotnet}/register-completions.ps1 | 0 .../xamples/dotnet}/register-completions.zsh | 0 test.cmd | 3 + test.sh | 11 + tools/BuildTools.csproj | 16 - tools/Key.snk | Bin 596 -> 0 bytes tools/PushToBlobFeed.targets | 29 -- 103 files changed, 1007 insertions(+), 900 deletions(-) create mode 100644 .gitattributes delete mode 100644 CommandLine-netcore.sln delete mode 100644 CommandLine.Tests/CommandLine.Tests-netcore.csproj delete mode 100644 CommandLine.Tests/CommandLine.Tests.csproj delete mode 100644 CommandLine.Tests/Properties/AssemblyInfo.cs delete mode 100644 CommandLine.Tests/packages.config delete mode 100644 CommandLine/CommandLine-netcore.csproj delete mode 100644 CommandLine/CommandLine.csproj delete mode 100644 CommandLine/Properties/AssemblyInfo.cs delete mode 100644 CommandLine/packages.config rename LICENSE => LICENSE.TXT (100%) delete mode 100644 NuGet.config delete mode 100644 RestoreSources.props delete mode 100644 SampleParsers/CommandLine.SampleParsers-netcore.csproj delete mode 100644 SampleParsers/CommandLine.SampleParsers.csproj delete mode 100644 SampleParsers/Properties/AssemblyInfo.cs delete mode 100644 SampleParsers/packages.config delete mode 100644 build.proj delete mode 100644 build.ps1 create mode 100644 build/NuGet.props create mode 100644 build/SignToolData.json create mode 100644 build/Toolset.proj create mode 100644 build/Versions.props create mode 100644 build/build.ps1 create mode 100644 build/build.sh create mode 100644 build/cibuild.cmd create mode 100755 build/cibuild.sh delete mode 100644 dotnet/Properties/AssemblyInfo.cs delete mode 100644 dotnet/dotnet-netcore.csproj delete mode 100644 dotnet/dotnet.csproj delete mode 100644 dotnet/packages.config create mode 100644 restore.cmd create mode 100755 restore.sh create mode 100644 src/Directory.Build.props create mode 100644 src/Directory.Build.targets rename {CommandLine => src/source/CommandLine}/Accept.cs (100%) rename {CommandLine => src/source/CommandLine}/AppliedOption.cs (100%) rename {CommandLine => src/source/CommandLine}/AppliedOptionExtensions.cs (100%) rename {CommandLine => src/source/CommandLine}/AppliedOptionSet.cs (100%) rename {CommandLine => src/source/CommandLine}/ArgumentsRule.cs (100%) rename {CommandLine => src/source/CommandLine}/ArgumentsRuleExtensions.cs (100%) rename {CommandLine => src/source/CommandLine}/Command.cs (100%) rename {CommandLine => src/source/CommandLine}/CommandExecutionResult.cs (100%) rename {CommandLine => src/source/CommandLine}/Create.cs (100%) rename {CommandLine => src/source/CommandLine}/DefaultHelpViewText.cs (100%) rename {CommandLine => src/source/CommandLine}/DefaultValidationMessages.cs (100%) rename {CommandLine => src/source/CommandLine}/EnumerableExtensions.cs (100%) rename {CommandLine => src/source/CommandLine}/HelpViewExtensions.cs (100%) rename {CommandLine => src/source/CommandLine}/IValidationMessages.cs (100%) create mode 100644 src/source/CommandLine/Microsoft.DotNet.Cli.CommandLine.csproj rename {CommandLine => src/source/CommandLine}/Option.cs (100%) rename {CommandLine => src/source/CommandLine}/OptionError.cs (100%) rename {CommandLine => src/source/CommandLine}/OptionExtensions.cs (100%) rename {CommandLine => src/source/CommandLine}/OptionSet.cs (100%) rename {CommandLine => src/source/CommandLine}/OptionSet{T}.cs (100%) rename {CommandLine => src/source/CommandLine}/ParseException.cs (100%) rename {CommandLine => src/source/CommandLine}/ParseResult.cs (100%) rename {CommandLine => src/source/CommandLine}/ParseResultExtensions.cs (100%) rename {CommandLine => src/source/CommandLine}/Parser.cs (100%) rename {CommandLine => src/source/CommandLine}/ParserConfiguration.cs (100%) rename {CommandLine => src/source/CommandLine}/ParserExtensions.cs (100%) rename {CommandLine => src/source/CommandLine}/Register-ArgumentCompleter.ps1 (100%) rename {CommandLine => src/source/CommandLine}/StringExtensions.cs (100%) rename {CommandLine => src/source/CommandLine}/Suggest.cs (100%) rename {CommandLine => src/source/CommandLine}/Token.cs (100%) rename {CommandLine => src/source/CommandLine}/TokenType.cs (100%) rename {CommandLine => src/source/CommandLine}/ValidationMessages.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/AppliedOptionTests.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/ArgumentsRuleCompositionTests.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/CommandExecutionTests.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/CommandTests.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/HelpViewTests.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/MaterializerTests.cs (100%) create mode 100644 src/tests/CommandLine.Tests/Microsoft.DotNet.Cli.CommandLine.Tests.csproj rename {CommandLine.Tests => src/tests/CommandLine.Tests}/OptionTests.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/ParseDiagramTests.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/ParserTests.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/ParsingValidationTests.cs (97%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/SuggestionTests.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/TokenizeTests.cs (100%) rename {CommandLine.Tests => src/tests/CommandLine.Tests}/ValidationMessageLocalizationTests.cs (100%) create mode 100644 src/xamples/SampleParsers/CommandLine.SampleParsers.csproj rename {SampleParsers => src/xamples/SampleParsers}/Dotnet/AssertionExtensions.cs (100%) rename {SampleParsers => src/xamples/SampleParsers}/Dotnet/DotNetParser.cs (100%) rename {SampleParsers => src/xamples/SampleParsers}/Dotnet/DotnetParserHelpViewTests.cs (100%) rename {SampleParsers => src/xamples/SampleParsers}/Dotnet/DotnetParserTests.cs (100%) rename {SampleParsers => src/xamples/SampleParsers}/Dotnet/SuggestionTests.cs (100%) rename {dotnet => src/xamples/dotnet}/App.config (100%) rename {dotnet => src/xamples/dotnet}/Program.cs (100%) create mode 100644 src/xamples/dotnet/dotnet.csproj rename {dotnet => src/xamples/dotnet}/register-completions.bash (100%) rename {dotnet => src/xamples/dotnet}/register-completions.ps1 (100%) rename {dotnet => src/xamples/dotnet}/register-completions.zsh (100%) create mode 100644 test.cmd create mode 100755 test.sh delete mode 100644 tools/BuildTools.csproj delete mode 100644 tools/Key.snk delete mode 100644 tools/PushToBlobFeed.targets diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6b9302f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,74 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto encoding=UTF-8 + +# csc/vbc are shell scripts and should always have unix line endings +# These shell scripts are included in the toolset packages. Normally, the shell +# scripts in our repo are only run by cloning onto a Linux/Mac machine, and git +# automatically chooses LF as the line ending. +# +# However, right now the toolset packages must be built on Windows, and so the +# files must be hard-coded to be cloned with LF +src/Compilers/CSharp/CscCore/csc text eol=lf +src/Compilers/VisualBasic/VbcCore/vbc text eol=lf + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +*.cs diff=csharp text +*.vb text + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain \ No newline at end of file diff --git a/CommandLine-netcore.sln b/CommandLine-netcore.sln deleted file mode 100644 index 845365c..0000000 --- a/CommandLine-netcore.sln +++ /dev/null @@ -1,52 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26221.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandLine-netcore", "CommandLine\CommandLine-netcore.csproj", "{439FFDED-361C-4371-B9D0-01D81DCE2C62}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandLine.Tests-netcore", "CommandLine.Tests\CommandLine.Tests-netcore.csproj", "{A9A083E1-6875-4D66-9D4A-42E029DFFC84}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "source", "source", "{4E7D048B-8032-4AF3-96C9-1A27558B6874}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{81E64B6B-5335-468F-AFEB-2070A0C68B11}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "xamples", "xamples", "{E2A871E2-85EC-4187-BFBF-49C5C3E34422}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-netcore", "dotnet\dotnet-netcore.csproj", "{DE905655-C679-4604-BC0E-F986E66A115A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandLine.SampleParsers-netcore", "SampleParsers\CommandLine.SampleParsers-netcore.csproj", "{24A483A7-C3CE-4FF2-8185-78D4B0754A7C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {439FFDED-361C-4371-B9D0-01D81DCE2C62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {439FFDED-361C-4371-B9D0-01D81DCE2C62}.Debug|Any CPU.Build.0 = Debug|Any CPU - {439FFDED-361C-4371-B9D0-01D81DCE2C62}.Release|Any CPU.ActiveCfg = Release|Any CPU - {439FFDED-361C-4371-B9D0-01D81DCE2C62}.Release|Any CPU.Build.0 = Release|Any CPU - {A9A083E1-6875-4D66-9D4A-42E029DFFC84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A9A083E1-6875-4D66-9D4A-42E029DFFC84}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A9A083E1-6875-4D66-9D4A-42E029DFFC84}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A9A083E1-6875-4D66-9D4A-42E029DFFC84}.Release|Any CPU.Build.0 = Release|Any CPU - {DE905655-C679-4604-BC0E-F986E66A115A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DE905655-C679-4604-BC0E-F986E66A115A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DE905655-C679-4604-BC0E-F986E66A115A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DE905655-C679-4604-BC0E-F986E66A115A}.Release|Any CPU.Build.0 = Release|Any CPU - {24A483A7-C3CE-4FF2-8185-78D4B0754A7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {24A483A7-C3CE-4FF2-8185-78D4B0754A7C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {24A483A7-C3CE-4FF2-8185-78D4B0754A7C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {24A483A7-C3CE-4FF2-8185-78D4B0754A7C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {439FFDED-361C-4371-B9D0-01D81DCE2C62} = {4E7D048B-8032-4AF3-96C9-1A27558B6874} - {A9A083E1-6875-4D66-9D4A-42E029DFFC84} = {81E64B6B-5335-468F-AFEB-2070A0C68B11} - {DE905655-C679-4604-BC0E-F986E66A115A} = {E2A871E2-85EC-4187-BFBF-49C5C3E34422} - {24A483A7-C3CE-4FF2-8185-78D4B0754A7C} = {E2A871E2-85EC-4187-BFBF-49C5C3E34422} - EndGlobalSection -EndGlobal diff --git a/CommandLine.Tests/CommandLine.Tests-netcore.csproj b/CommandLine.Tests/CommandLine.Tests-netcore.csproj deleted file mode 100644 index 615e6fa..0000000 --- a/CommandLine.Tests/CommandLine.Tests-netcore.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - netcoreapp1.0 - Microsoft.DotNet.Cli.CommandLine.Tests - Microsoft.DotNet.Cli.CommandLine.Tests - - - - - - - - - - - - - - - - - - diff --git a/CommandLine.Tests/CommandLine.Tests.csproj b/CommandLine.Tests/CommandLine.Tests.csproj deleted file mode 100644 index 29387a1..0000000 --- a/CommandLine.Tests/CommandLine.Tests.csproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - AnyCPU - {DCF608E3-40B5-453B-B55F-B2D99C98FCD4} - Library - Properties - Microsoft.DotNet.Cli.CommandLine.Tests - Microsoft.DotNet.Cli.CommandLine.Tests - v4.6.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\FluentAssertions.4.19.0\lib\net45\FluentAssertions.dll - True - - - ..\packages\FluentAssertions.4.19.0\lib\net45\FluentAssertions.Core.dll - True - - - - - - ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - ..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True - - - ..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True - - - ..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {4CF1AE89-BC8D-4C26-B232-1F99E091C802} - CommandLine - - - - - - - False - - - False - - - False - - - False - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/CommandLine.Tests/Properties/AssemblyInfo.cs b/CommandLine.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index e48b78a..0000000 --- a/CommandLine.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyCopyright("Copyright © Microsoft 2017")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("dcf608e3-40b5-453b-b55f-b2d99c98fcd4")] diff --git a/CommandLine.Tests/packages.config b/CommandLine.Tests/packages.config deleted file mode 100644 index 93f209a..0000000 --- a/CommandLine.Tests/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/CommandLine.sln b/CommandLine.sln index 7150c2e..c3daba4 100644 --- a/CommandLine.sln +++ b/CommandLine.sln @@ -1,21 +1,21 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2026 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine.Tests", "CommandLine.Tests\CommandLine.Tests.csproj", "{DCF608E3-40B5-453B-B55F-B2D99C98FCD4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine", "CommandLine\CommandLine.csproj", "{4CF1AE89-BC8D-4C26-B232-1F99E091C802}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "source", "source", "{865D4F45-B1AF-4C87-AE1A-AA5ADF6D386D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{68E3F6FF-C6EF-4B0D-A9F5-2BE6930C55C0}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "xamples", "xamples", "{C375C10F-04DD-4F64-A8BE-11BDBD0B0546}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine.SampleParsers", "SampleParsers\CommandLine.SampleParsers.csproj", "{6C5B3671-FFF3-4F7C-AFE2-76CDC938E4B5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandLine", "src\source\CommandLine\Microsoft.DotNet.Cli.CommandLine.csproj", "{7F320A3C-A74A-4EDD-92EC-A8A906047A21}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnet", "dotnet\dotnet.csproj", "{051AD708-BEE6-40D8-BA4D-C9FE2CA8052B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandLine.Tests", "src\tests\CommandLine.Tests\Microsoft.DotNet.Cli.CommandLine.Tests.csproj", "{2614A1E7-E8CC-4A22-96A9-ACED9A18E2C3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet", "src\xamples\dotnet\dotnet.csproj", "{C93310CF-0A00-4A62-BDA2-596FAAE2B1DB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandLine.SampleParsers", "src\xamples\SampleParsers\CommandLine.SampleParsers.csproj", "{CD03109D-3909-4B66-9E59-1125F8197193}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,30 +23,33 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DCF608E3-40B5-453B-B55F-B2D99C98FCD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCF608E3-40B5-453B-B55F-B2D99C98FCD4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DCF608E3-40B5-453B-B55F-B2D99C98FCD4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DCF608E3-40B5-453B-B55F-B2D99C98FCD4}.Release|Any CPU.Build.0 = Release|Any CPU - {4CF1AE89-BC8D-4C26-B232-1F99E091C802}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4CF1AE89-BC8D-4C26-B232-1F99E091C802}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4CF1AE89-BC8D-4C26-B232-1F99E091C802}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4CF1AE89-BC8D-4C26-B232-1F99E091C802}.Release|Any CPU.Build.0 = Release|Any CPU - {6C5B3671-FFF3-4F7C-AFE2-76CDC938E4B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C5B3671-FFF3-4F7C-AFE2-76CDC938E4B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C5B3671-FFF3-4F7C-AFE2-76CDC938E4B5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6C5B3671-FFF3-4F7C-AFE2-76CDC938E4B5}.Release|Any CPU.Build.0 = Release|Any CPU - {051AD708-BEE6-40D8-BA4D-C9FE2CA8052B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {051AD708-BEE6-40D8-BA4D-C9FE2CA8052B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {051AD708-BEE6-40D8-BA4D-C9FE2CA8052B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {051AD708-BEE6-40D8-BA4D-C9FE2CA8052B}.Release|Any CPU.Build.0 = Release|Any CPU + {7F320A3C-A74A-4EDD-92EC-A8A906047A21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7F320A3C-A74A-4EDD-92EC-A8A906047A21}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7F320A3C-A74A-4EDD-92EC-A8A906047A21}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7F320A3C-A74A-4EDD-92EC-A8A906047A21}.Release|Any CPU.Build.0 = Release|Any CPU + {2614A1E7-E8CC-4A22-96A9-ACED9A18E2C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2614A1E7-E8CC-4A22-96A9-ACED9A18E2C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2614A1E7-E8CC-4A22-96A9-ACED9A18E2C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2614A1E7-E8CC-4A22-96A9-ACED9A18E2C3}.Release|Any CPU.Build.0 = Release|Any CPU + {C93310CF-0A00-4A62-BDA2-596FAAE2B1DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C93310CF-0A00-4A62-BDA2-596FAAE2B1DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C93310CF-0A00-4A62-BDA2-596FAAE2B1DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C93310CF-0A00-4A62-BDA2-596FAAE2B1DB}.Release|Any CPU.Build.0 = Release|Any CPU + {CD03109D-3909-4B66-9E59-1125F8197193}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD03109D-3909-4B66-9E59-1125F8197193}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD03109D-3909-4B66-9E59-1125F8197193}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD03109D-3909-4B66-9E59-1125F8197193}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {DCF608E3-40B5-453B-B55F-B2D99C98FCD4} = {68E3F6FF-C6EF-4B0D-A9F5-2BE6930C55C0} - {4CF1AE89-BC8D-4C26-B232-1F99E091C802} = {865D4F45-B1AF-4C87-AE1A-AA5ADF6D386D} - {6C5B3671-FFF3-4F7C-AFE2-76CDC938E4B5} = {C375C10F-04DD-4F64-A8BE-11BDBD0B0546} - {051AD708-BEE6-40D8-BA4D-C9FE2CA8052B} = {C375C10F-04DD-4F64-A8BE-11BDBD0B0546} + {7F320A3C-A74A-4EDD-92EC-A8A906047A21} = {865D4F45-B1AF-4C87-AE1A-AA5ADF6D386D} + {2614A1E7-E8CC-4A22-96A9-ACED9A18E2C3} = {68E3F6FF-C6EF-4B0D-A9F5-2BE6930C55C0} + {C93310CF-0A00-4A62-BDA2-596FAAE2B1DB} = {C375C10F-04DD-4F64-A8BE-11BDBD0B0546} + {CD03109D-3909-4B66-9E59-1125F8197193} = {C375C10F-04DD-4F64-A8BE-11BDBD0B0546} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E30B46C8-E7A1-4648-B6E5-416E8DD93857} EndGlobalSection EndGlobal diff --git a/CommandLine/CommandLine-netcore.csproj b/CommandLine/CommandLine-netcore.csproj deleted file mode 100644 index a5b3ce1..0000000 --- a/CommandLine/CommandLine-netcore.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - netstandard1.5 - Microsoft.DotNet.Cli.CommandLine - Microsoft.DotNet.Cli.CommandLine - ../tools/Key.snk - true - true - 0.1.1-alpha-$(CommitCount) - - diff --git a/CommandLine/CommandLine.csproj b/CommandLine/CommandLine.csproj deleted file mode 100644 index 3bef2df..0000000 --- a/CommandLine/CommandLine.csproj +++ /dev/null @@ -1,80 +0,0 @@ - - - - - Debug - AnyCPU - {4CF1AE89-BC8D-4C26-B232-1F99E091C802} - Library - Properties - Microsoft.DotNet.Cli.CommandLine - Microsoft.DotNet.Cli.CommandLine - v4.6.2 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CommandLine/Properties/AssemblyInfo.cs b/CommandLine/Properties/AssemblyInfo.cs deleted file mode 100644 index abb23bc..0000000 --- a/CommandLine/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyCopyright("Copyright © Microsoft 2017")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4cf1ae89-bc8d-4c26-b232-1f99e091c802")] diff --git a/CommandLine/packages.config b/CommandLine/packages.config deleted file mode 100644 index 6b8deb9..0000000 --- a/CommandLine/packages.config +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index d64b545..03f0340 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,27 @@ - - - - - 0 - + + + + + + Debug + + + + + + + $(MSBuildThisFileDirectory) + $(NuGetPackageRoot)roslyntools.repotoolset\$(RoslynToolsRepoToolsetVersion)\tools\ + https://dotnetfeed.blob.core.windows.net/dotnet-core/packages/index.json + + + + $(RepoRoot)artifacts\.dotnet\$(DotNetCliVersion)\ + + + + https://github.com/dotnet/CliCommandLineParser + $(RepositoryUrl) + + diff --git a/LICENSE b/LICENSE.TXT similarity index 100% rename from LICENSE rename to LICENSE.TXT diff --git a/NuGet.config b/NuGet.config deleted file mode 100644 index 0cad9aa..0000000 --- a/NuGet.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/RestoreSources.props b/RestoreSources.props deleted file mode 100644 index 127443b..0000000 --- a/RestoreSources.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - $(ExternalRestoreSources); - https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json; - https://api.nuget.org/v3/index.json; - - - diff --git a/SampleParsers/CommandLine.SampleParsers-netcore.csproj b/SampleParsers/CommandLine.SampleParsers-netcore.csproj deleted file mode 100644 index b7a1a67..0000000 --- a/SampleParsers/CommandLine.SampleParsers-netcore.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - netcoreapp1.0 - - - - - - - - - - - - - - - - diff --git a/SampleParsers/CommandLine.SampleParsers.csproj b/SampleParsers/CommandLine.SampleParsers.csproj deleted file mode 100644 index 54939d3..0000000 --- a/SampleParsers/CommandLine.SampleParsers.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - {6C5B3671-FFF3-4F7C-AFE2-76CDC938E4B5} - Library - Properties - Microsoft.DotNet.Cli.CommandLine.SampleParsers - Microsoft.DotNet.Cli.CommandLine.SampleParsers - v4.6.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\FluentAssertions.4.19.0\lib\net45\FluentAssertions.dll - True - - - ..\packages\FluentAssertions.4.19.0\lib\net45\FluentAssertions.Core.dll - True - - - ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll - True - - - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - - - ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - ..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True - - - ..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True - - - ..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True - - - - - - - - - - - - - - - - - - - - - {4CF1AE89-BC8D-4C26-B232-1F99E091C802} - CommandLine - - - - - - - - - - - False - - - False - - - False - - - False - - - - - - - - \ No newline at end of file diff --git a/SampleParsers/Properties/AssemblyInfo.cs b/SampleParsers/Properties/AssemblyInfo.cs deleted file mode 100644 index 6f6fc94..0000000 --- a/SampleParsers/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyCopyright("Copyright © Microsoft 2017")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6c5b3671-fff3-4f7c-afe2-76cdc938e4b5")] diff --git a/SampleParsers/packages.config b/SampleParsers/packages.config deleted file mode 100644 index 15123ba..0000000 --- a/SampleParsers/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/build.cmd b/build.cmd index 97a0d52..13413e6 100644 --- a/build.cmd +++ b/build.cmd @@ -1,7 +1,3 @@ @echo off - -REM Copyright (c) .NET Foundation and contributors. All rights reserved. -REM Licensed under the MIT license. See LICENSE file in the project root for full license information. - -powershell -ExecutionPolicy Bypass -NoProfile -NoLogo -Command "& \"%~dp0build.ps1\" %*; exit $LastExitCode;" -if %errorlevel% neq 0 exit /b %errorlevel% +powershell -NoLogo -NoProfile -ExecutionPolicy ByPass %~dp0build\build.ps1 -build %* +exit /b %ErrorLevel% diff --git a/build.proj b/build.proj deleted file mode 100644 index 920365d..0000000 --- a/build.proj +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Debug - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<Project ToolsVersion="15.0"> - <PropertyGroup> - <CommitCount>$(CommitCount)</CommitCount> - </PropertyGroup> -</Project> - - - - - - diff --git a/build.ps1 b/build.ps1 deleted file mode 100644 index 6a9d4f0..0000000 --- a/build.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -[cmdletbinding()] -param( - [Parameter(Position=0, ValueFromRemainingArguments=$true)] - $ExtraParameters -) -$ErrorActionPreference="Stop" -$ProgressPreference="SilentlyContinue" - -$RepoRoot = "$PSScriptRoot" -$DOTNET_INSTALL_DIR="$REPOROOT/.dotnet" - -$env:REPOROOT="$RepoRoot" -$env:XDG_DATA_HOME="$REPOROOT/.nuget/packages" -$env:NUGET_PACKAGES="$REPOROOT/.nuget/packages" -$env:NUGET_HTTP_CACHE_PATH="$REPOROOT/.nuget/packages" -$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 - -if (-Not (Test-Path $DOTNET_INSTALL_DIR)) -{ - New-Item -Type "directory" -Path $DOTNET_INSTALL_DIR -} - -Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "$DOTNET_INSTALL_DIR/dotnet-install.ps1" -& $DOTNET_INSTALL_DIR/dotnet-install.ps1 -InstallDir "$DOTNET_INSTALL_DIR" -Version 1.1.4 - -$env:PATH="$DOTNET_INSTALL_DIR;$env:PATH" - -& dotnet msbuild build.proj /t:MakeVersionProps -& dotnet msbuild build.proj /v:n /fl /flp:v=n $ExtraParameters diff --git a/build.sh b/build.sh index 0717ea1..e733309 100755 --- a/build.sh +++ b/build.sh @@ -1,45 +1,11 @@ -set -e +#!/bin/bash SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ $SOURCE != /* ]] && SOURCE="$ScriptRoot/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done +ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -REPOROOT="$DIR" - -# Some things depend on HOME and it may not be set. We should fix those things, but until then, we just patch a value in -if [ -z "$HOME" ]; then - export HOME="$DIR/.home" - - [ ! -d "$HOME" ] || rm -Rf $HOME - mkdir -p $HOME -fi - -# $args array may have empty elements in it. -# The easiest way to remove them is to cast to string and back to array. -# This will actually break quoted arguments, arguments like -# -test "hello world" will be broken into three arguments instead of two, as it should. -args=( "$@" ) -temp="${args[@]}" -args=($temp) - -export REPOROOT="$REPOROOT" -export XDG_DATA_HOME="$REPOROOT/.nuget/packages" -export NUGET_PACKAGES="$REPOROOT/.nuget/packages" -export NUGET_HTTP_CACHE_PATH="$REPOROOT/.nuget/packages" -export DOTNET_INSTALL_DIR="$REPOROOT/.dotnet" -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 - -if [ ! -d "$DOTNET_INSTALL_DIR" ]; then - mkdir $DOTNET_INSTALL_DIR -fi - -curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --install-dir $DOTNET_INSTALL_DIR --version 1.1.4 - -PATH="$DOTNET_INSTALL_DIR:$PATH" - -dotnet msbuild build.proj /t:MakeVersionProps -dotnet msbuild build.proj /v:n /fl /flp:v=n "${args[@]}" +. "$ScriptRoot/build/build.sh" --build $@ diff --git a/build/NuGet.props b/build/NuGet.props new file mode 100644 index 0000000..336d6a4 --- /dev/null +++ b/build/NuGet.props @@ -0,0 +1,17 @@ + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + $(NUGET_PACKAGES) + $(UserProfile)\.nuget\packages\ + $(HOME)\.nuget\packages\ + $(NuGetPackageRoot)\ + + + diff --git a/build/SignToolData.json b/build/SignToolData.json new file mode 100644 index 0000000..bfcda17 --- /dev/null +++ b/build/SignToolData.json @@ -0,0 +1,18 @@ +{ + "sign": [ + { + "certificate": "Microsoft402", + "strongName": null, + "values": [ + "bin/Microsoft.DotNet.Cli.CommandLine/*/Microsoft.DotNet.Cli.CommandLine.dll" + ] + }, + { + "certificate": null, + "strongName": null, + "values": [ + "packages/*.nupkg" + ] + } + ] +} diff --git a/build/Toolset.proj b/build/Toolset.proj new file mode 100644 index 0000000..e8395c3 --- /dev/null +++ b/build/Toolset.proj @@ -0,0 +1,14 @@ + + + + + + net462 + https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json + + + + + + + diff --git a/build/Versions.props b/build/Versions.props new file mode 100644 index 0000000..89172a5 --- /dev/null +++ b/build/Versions.props @@ -0,0 +1,35 @@ + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + 0.1.1 + alpha + + + + + false + + + + + 1.1.4 + 1.0.0-preview2-1-003177 + 1.0.0-beta-62522-01 + 2.2.7 + + + + + 4.18.0 + 9.0.1 + 4.3.1 + + + diff --git a/build/build.ps1 b/build/build.ps1 new file mode 100644 index 0000000..a5f852c --- /dev/null +++ b/build/build.ps1 @@ -0,0 +1,262 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [switch] $build, + [switch] $ci, + [string] $configuration = "Debug", + [switch] $deploy, + [switch] $fullMSBuild, + [switch] $help, + [switch] $log, + [switch] $pack, + [switch] $prepareMachine, + [switch] $rebuild, + [switch] $restore, + [switch] $sign, + [string] $solution = "", + [switch] $test, + [string] $verbosity = "minimal", + [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties +) + +Set-StrictMode -Version 2.0 +$ErrorActionPreference = "Stop" + +function Print-Usage() { + Write-Host "Common settings:" + Write-Host " -configuration Build configuration Debug, Release" + Write-Host " -verbosity Msbuild verbosity (q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic])" + Write-Host " -help Print help and exit" + Write-Host "" + Write-Host "Actions:" + Write-Host " -restore Restore dependencies" + Write-Host " -build Build solution" + Write-Host " -rebuild Rebuild solution" + Write-Host " -deploy Deploy built VSIXes" + Write-Host " -test Run all unit tests in the solution" + Write-Host " -sign Sign build outputs" + Write-Host " -pack Package build outputs into NuGet packages and Willow components" + Write-Host "" + Write-Host "Advanced settings:" + Write-Host " -solution Path to solution to build" + Write-Host " -ci Set when running on CI server" + Write-Host " -log Enable logging (by default on CI)" + Write-Host " -prepareMachine Prepare machine for CI run" + Write-Host " -fullMSBuild Test against the desktop version of MSBuild" + Write-Host "" + Write-Host "Command line arguments not listed above are passed through to MSBuild." + Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)." +} + +function Create-Directory([string[]] $Path) { + if (!(Test-Path -Path $Path)) { + New-Item -Path $Path -Force -ItemType "Directory" | Out-Null + } +} + +function GetVersionsPropsVersion([string[]] $Name) { + [xml]$Xml = Get-Content $VersionsProps + + foreach ($PropertyGroup in $Xml.Project.PropertyGroup) { + if (Get-Member -InputObject $PropertyGroup -name $Name) { + return $PropertyGroup.$Name + } + } + + throw "Failed to locate the $Name property" +} + +function InstallDotNetCli { + $DotNetCliVersion = GetVersionsPropsVersion -Name "DotNetCliVersion" + $DotNetInstallVerbosity = "" + + if (!$env:DOTNET_INSTALL_DIR) { + $env:DOTNET_INSTALL_DIR = Join-Path $RepoRoot "artifacts\.dotnet\$DotNetCliVersion" + } + + $DotNetRoot = $env:DOTNET_INSTALL_DIR + $DotNetInstallScript = Join-Path $DotNetRoot "dotnet-install.ps1" + + if (!(Test-Path $DotNetInstallScript)) { + Create-Directory $DotNetRoot + Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -UseBasicParsing -OutFile $DotNetInstallScript + } + + if ($verbosity -eq "diagnostic") { + $DotNetInstallVerbosity = "-Verbose" + } + + # Install a stage 0 + $SdkInstallDir = Join-Path $DotNetRoot "sdk\$DotNetCliVersion" + + if (!(Test-Path $SdkInstallDir)) { + # Use Invoke-Expression so that $DotNetInstallVerbosity is not positionally bound when empty + Invoke-Expression -Command "$DotNetInstallScript -Version $DotNetCliVersion $DotNetInstallVerbosity" + + if($LASTEXITCODE -ne 0) { + throw "Failed to install stage0" + } + } + + # Install 1.0 shared framework + $NetCoreApp10Version = "1.0.5" + $NetCoreApp10Dir = Join-Path $DotNetRoot "shared\Microsoft.NETCore.App\$NetCoreApp10Version" + + if (!(Test-Path $NetCoreApp10Dir)) { + # Use Invoke-Expression so that $DotNetInstallVerbosity is not positionally bound when empty + Invoke-Expression -Command "$DotNetInstallScript -Channel `"Preview`" -Version $NetCoreApp10Version -SharedRuntime $DotNetInstallVerbosity" + + if($LASTEXITCODE -ne 0) { + throw "Failed to install 1.0 shared framework" + } + } + + # Put the stage 0 on the path + $env:PATH = "$DotNetRoot;$env:PATH" + + # Disable first run since we want to control all package sources + $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + + # Don't resolve runtime, shared framework, or SDK from other locations + $env:DOTNET_MULTILEVEL_LOOKUP=0 +} + +function InstallNuGet { + $NugetInstallDir = Join-Path $RepoRoot "artifacts\.nuget" + $NugetExe = Join-Path $NugetInstallDir "nuget.exe" + + if (!(Test-Path -Path $NugetExe)) { + Create-Directory $NugetInstallDir + Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -UseBasicParsing -OutFile $NugetExe + } +} + +function InstallRepoToolset { + $RepoToolsetVersion = GetVersionsPropsVersion -Name "RoslynToolsRepoToolsetVersion" + $RepoToolsetDir = Join-Path $NuGetPackageRoot "roslyntools.repotoolset\$RepoToolsetVersion\tools" + $RepoToolsetBuildProj = Join-Path $RepoToolsetDir "Build.proj" + + if ($ci -or $log) { + Create-Directory $LogDir + $logCmd = "/bl:" + (Join-Path $LogDir "Toolset.binlog") + } else { + $logCmd = "" + } + + if (!(Test-Path -Path $RepoToolsetBuildProj)) { + $ToolsetProj = Join-Path $PSScriptRoot "Toolset.proj" + dotnet msbuild $ToolsetProj /t:restore /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd | Write-Host + + if($LASTEXITCODE -ne 0) { + throw "Failed to build $ToolsetProj" + } + } + + return $RepoToolsetBuildProj +} + +function LocateVisualStudio { + $VSWhereVersion = GetVersionsPropsVersion -Name "VSWhereVersion" + $VSWhereDir = Join-Path $ArtifactsDir ".tools\vswhere\$VSWhereVersion" + $VSWhereExe = Join-Path $vsWhereDir "vswhere.exe" + + if (!(Test-Path $VSWhereExe)) { + Create-Directory $VSWhereDir + Invoke-WebRequest "http://github.com/Microsoft/vswhere/releases/download/$VSWhereVersion/vswhere.exe" -UseBasicParsing -OutFile $VSWhereExe + } + + $VSInstallDir = & $VSWhereExe -latest -property installationPath -requires Microsoft.Component.MSBuild -requires Microsoft.VisualStudio.Component.VSSDK -requires Microsoft.Net.Component.4.6.TargetingPack -requires Microsoft.VisualStudio.Component.Roslyn.Compiler -requires Microsoft.VisualStudio.Component.VSSDK + + if (!(Test-Path $VSInstallDir)) { + throw "Failed to locate Visual Studio (exit code '$LASTEXITCODE')." + } + + return $VSInstallDir +} + +function Build { + InstallDotNetCli + InstallNuget + $RepoToolsetBuildProj = InstallRepoToolset + + if ($prepareMachine) { + Create-Directory $NuGetPackageRoot + dotnet nuget locals all --clear + + if($LASTEXITCODE -ne 0) { + throw "Failed to clear NuGet cache" + } + } + + if ($fullMSBuild) { + if (!($env:VSInstallDir)) { + $env:VSInstallDir = LocateVisualStudio + } + + $env:DOTNET_SDK_TEST_MSBUILD_PATH = Join-Path $env:VSInstallDir "MSBuild\15.0\Bin\msbuild.exe" + } + + if ($ci -or $log) { + Create-Directory $LogDir + $logCmd = "/bl:" + (Join-Path $LogDir "Build.binlog") + } else { + $logCmd = "" + } + + if ($solution -eq "") { + $solution = Join-Path $RepoRoot "CommandLine.sln" + } + + dotnet msbuild $RepoToolsetBuildProj /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci $properties + + if($LASTEXITCODE -ne 0) { + throw "Failed to build $RepoToolsetBuildProj" + } +} + +function Stop-Processes() { + Write-Host "Killing running build processes..." + Get-Process -Name "msbuild" -ErrorAction SilentlyContinue | Stop-Process + Get-Process -Name "vbcscompiler" -ErrorAction SilentlyContinue | Stop-Process +} + +if ($help -or (($properties -ne $null) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) { + Print-Usage + exit 0 +} + +$RepoRoot = Join-Path $PSScriptRoot "..\" +$ArtifactsDir = Join-Path $RepoRoot "artifacts" +$ArtifactsConfigurationDir = Join-Path $ArtifactsDir $configuration +$LogDir = Join-Path $ArtifactsConfigurationDir "log" +$VersionsProps = Join-Path $PSScriptRoot "Versions.props" + +try { + if ($ci) { + $TempDir = Join-Path $ArtifactsConfigurationDir "tmp" + Create-Directory $TempDir + + $env:TEMP = $TempDir + $env:TMP = $TempDir + } + + if (!($env:NUGET_PACKAGES)) { + $env:NUGET_PACKAGES = Join-Path $env:UserProfile ".nuget\packages" + } + + $NuGetPackageRoot = $env:NUGET_PACKAGES + + Build + exit $lastExitCode +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + exit 1 +} +finally { + Pop-Location + if ($ci -and $prepareMachine) { + Stop-Processes + } +} diff --git a/build/build.sh b/build/build.sh new file mode 100644 index 0000000..b6417d8 --- /dev/null +++ b/build/build.sh @@ -0,0 +1,303 @@ +#!/bin/bash + +build=false +ci=false +configuration="Debug" +help=false +log=false +pack=false +prepareMachine=false +rebuild=false +restore=false +sign=false +solution="" +test=false +verbosity="minimal" +properties="" + +while [[ $# > 0 ]]; do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + --build) + build=true + shift 1 + ;; + --ci) + ci=true + shift 1 + ;; + --configuration) + configuration=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --configuration Build configuration Debug, Release" + echo " --verbosity Msbuild verbosity (q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic])" + echo " --help Print help and exit" + echo "" + echo "Actions:" + echo " --restore Restore dependencies" + echo " --build Build solution" + echo " --rebuild Rebuild solution" + echo " --test Run all unit tests in the solution" + echo " --sign Sign build outputs" + echo " --pack Package build outputs into NuGet packages and Willow components" + echo "" + echo "Advanced settings:" + echo " --solution Path to solution to build" + echo " --ci Set when running on CI server" + echo " --log Enable logging (by default on CI)" + echo " --prepareMachine Prepare machine for CI run" + echo "" + echo "Command line arguments not listed above are passed through to MSBuild." + exit 0 + ;; + --log) + log=true + shift 1 + ;; + --pack) + pack=true + shift 1 + ;; + --prepareMachine) + prepareMachine=true + shift 1 + ;; + --rebuild) + rebuild=true + shift 1 + ;; + --restore) + restore=true + shift 1 + ;; + --sign) + sign=true + shift 1 + ;; + --solution) + solution=$2 + shift 2 + ;; + --test) + test=true + shift 1 + ;; + --verbosity) + verbosity=$2 + shift 2 + ;; + *) + properties="$properties $1" + shift 1 + ;; + esac +done + +function CreateDirectory { + if [ ! -d "$1" ] + then + mkdir -p "$1" + fi +} + +function GetVersionsPropsVersion { + echo "$( awk -F'[<>]' "/<$1>/{print \$3}" "$VersionsProps" )" +} + +function InstallDotNetCli { + DotNetCliVersion="$( GetVersionsPropsVersion DotNetCliVersion )" + DotNetInstallVerbosity="" + + if [ -z "$DOTNET_INSTALL_DIR" ] + then + export DOTNET_INSTALL_DIR="$RepoRoot/artifacts/.dotnet/$DotNetCliVersion" + fi + + DotNetRoot=$DOTNET_INSTALL_DIR + DotNetInstallScript="$DotNetRoot/dotnet-install.sh" + + if [ ! -a "$DotNetInstallScript" ] + then + CreateDirectory "$DotNetRoot" + curl "https://dot.net/v1/dotnet-install.sh" -sSL -o "$DotNetInstallScript" + fi + + if [[ "$(echo $verbosity | awk '{print tolower($0)}')" == "diagnostic" ]] + then + DotNetInstallVerbosity="--verbose" + fi + + # Install a stage 0 + SdkInstallDir="$DotNetRoot/sdk/$DotNetCliVersion" + + if [ ! -d "$SdkInstallDir" ] + then + bash "$DotNetInstallScript" --version $DotNetCliVersion $DotNetInstallVerbosity + LASTEXITCODE=$? + + if [ $LASTEXITCODE != 0 ] + then + echo "Failed to install stage0" + return $LASTEXITCODE + fi + fi + + # Install 1.0 shared framework + NetCoreApp10Version="1.0.5" + NetCoreApp10Dir="$DotNetRoot/shared/Microsoft.NETCore.App/$NetCoreApp10Version" + + if [ ! -d "$NetCoreApp10Dir" ] + then + bash "$DotNetInstallScript" --channel "Preview" --version $NetCoreApp10Version --shared-runtime $DotNetInstallVerbosity + LASTEXITCODE=$? + + if [ $LASTEXITCODE != 0 ] + then + echo "Failed to install 1.0 shared framework" + return $LASTEXITCODE + fi + fi + + # Put the stage 0 on the path + export PATH="$DotNetRoot:$PATH" + + # Disable first run since we want to control all package sources + export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + + # Don't resolve runtime, shared framework, or SDK from other locations + export DOTNET_MULTILEVEL_LOOKUP=0 +} + +function InstallRepoToolset { + RepoToolsetVersion="$( GetVersionsPropsVersion RoslynToolsRepoToolsetVersion )" + RepoToolsetDir="$NuGetPackageRoot/roslyntools.repotoolset/$RepoToolsetVersion/tools" + RepoToolsetBuildProj="$RepoToolsetDir/Build.proj" + + if $ci || $log + then + CreateDirectory $LogDir + logCmd="/bl:$LogDir/Build.binlog" + else + logCmd="" + fi + + if [ ! -d "$RepoToolsetBuildProj" ] + then + ToolsetProj="$ScriptRoot/Toolset.proj" + dotnet msbuild $ToolsetProj /t:restore /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd + LASTEXITCODE=$? + + if [ $LASTEXITCODE != 0 ] + then + echo "Failed to build $ToolsetProj" + return $LASTEXITCODE + fi + fi +} + +function Build { + InstallDotNetCli + + if [ $? != 0 ] + then + return $? + fi + + InstallRepoToolset + + if [ $? != 0 ] + then + return $? + fi + + if $prepareMachine + then + CreateDirectory "$NuGetPackageRoot" + dotnet nuget locals all --clear + LASTEXITCODE=$? + + if [ $LASTEXITCODE != 0 ] + then + echo "Failed to clear NuGet cache" + return $LASTEXITCODE + fi + fi + + if $ci || $log + then + CreateDirectory $LogDir + logCmd="/bl:$LogDir/Build.binlog" + else + logCmd="" + fi + + if [ -z $solution ] + then + solution="$RepoRoot/CommandLine.sln" + fi + + dotnet msbuild $RepoToolsetBuildProj /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci $properties + LASTEXITCODE=$? + + if [ $LASTEXITCODE != 0 ] + then + echo "Failed to build $RepoToolsetBuildProj" + return $LASTEXITCODE + fi +} + +function StopProcesses { + echo "Killing running build processes..." + pkill -9 "msbuild" + pkill -9 "vbcscompiler" +} + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$ScriptRoot/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +RepoRoot="$ScriptRoot/../" +ArtifactsDir="$RepoRoot/artifacts" +ArtifactsConfigurationDir="$ArtifactsDir/$configuration" +LogDir="$ArtifactsConfigurationDir/log" +VersionsProps="$ScriptRoot/Versions.props" + +# HOME may not be defined in some scenarios, but it is required by NuGet +if [ -z $HOME ] +then + export HOME="$RepoRoot/artifacts/.home/" + CreateDirectory "$HOME" +fi + +if $ci +then + TempDir="$ArtifactsConfigurationDir/tmp" + CreateDirectory "$TempDir" + + export TEMP="$TempDir" + export TMP="$TempDir" +fi + +if [ -z $NUGET_PACKAGES ] +then + export NUGET_PACKAGES="$HOME/.nuget/packages" +fi + +NuGetPackageRoot=$NUGET_PACKAGES + +Build +LASTEXITCODE=$? + +if $ci && $prepareMachine +then + StopProcesses +fi + +exit $LASTEXITCODE diff --git a/build/cibuild.cmd b/build/cibuild.cmd new file mode 100644 index 0000000..997546a --- /dev/null +++ b/build/cibuild.cmd @@ -0,0 +1,3 @@ +@echo off +powershell -NoLogo -NoProfile -ExecutionPolicy ByPass %~dp0Build.ps1 -restore -build -test -sign -pack -ci %* +exit /b %ErrorLevel% diff --git a/build/cibuild.sh b/build/cibuild.sh new file mode 100755 index 0000000..f352408 --- /dev/null +++ b/build/cibuild.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$ScriptRoot/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +. "$ScriptRoot/build.sh" --restore --build --test --ci $@ diff --git a/dotnet/Properties/AssemblyInfo.cs b/dotnet/Properties/AssemblyInfo.cs deleted file mode 100644 index b8d8ab6..0000000 --- a/dotnet/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyCopyright("Copyright © Microsoft 2017")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("051ad708-bee6-40d8-ba4d-c9fe2ca8052b")] diff --git a/dotnet/dotnet-netcore.csproj b/dotnet/dotnet-netcore.csproj deleted file mode 100644 index f97d90c..0000000 --- a/dotnet/dotnet-netcore.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - exe - netcoreapp1.0 - dotnet - dotnet - win10-x64;osx.10.11-x64 - - - - - - - - - - - diff --git a/dotnet/dotnet.csproj b/dotnet/dotnet.csproj deleted file mode 100644 index 3a5b1af..0000000 --- a/dotnet/dotnet.csproj +++ /dev/null @@ -1,80 +0,0 @@ - - - - - Debug - AnyCPU - {051AD708-BEE6-40D8-BA4D-C9FE2CA8052B} - Exe - Properties - dotnet - dotnet - v4.6.2 - 512 - true - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll - True - - - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - - - - - - - - - - - - - - - - - {4CF1AE89-BC8D-4C26-B232-1F99E091C802} - CommandLine - - - {6c5b3671-fff3-4f7c-afe2-76cdc938e4b5} - CommandLine.SampleParsers - - - - - \ No newline at end of file diff --git a/dotnet/packages.config b/dotnet/packages.config deleted file mode 100644 index e135b40..0000000 --- a/dotnet/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/netci.groovy b/netci.groovy index 80c2dae..3be0dd2 100644 --- a/netci.groovy +++ b/netci.groovy @@ -3,52 +3,55 @@ // Import the utility functionality. +import jobs.generation.ArchivalSettings; import jobs.generation.Utilities; def project = GithubProject def branch = GithubBranchName -def isPR = true - -def platformList = ['OSX:x64:Release', 'Windows_NT:x64:Release'] def static getBuildJobName(def configuration, def os, def architecture) { return configuration.toLowerCase() + '_' + os.toLowerCase() + '_' + architecture.toLowerCase() } -platformList.each { platform -> - // Calculate names - def (os, architecture, configuration) = platform.tokenize(':') +['OSX10.12', 'Ubuntu16.04', 'Windows_NT'].each { os -> + ['x64'].each { architecture -> + ['Debug', 'Release'].each { config -> + [true, false].each { isPR -> + // Calculate job name + def jobName = getBuildJobName(config, os, architecture) + def buildCommand = ''; - // Calculate job name - def jobName = getBuildJobName(configuration, os, architecture) - def buildCommand = ''; + def osBase = os + def machineAffinity = 'latest-or-auto' - // Calculate the build command - if (os == 'Windows_NT') { - buildCommand = ".\\build.cmd" - } - else { - buildCommand = "./build.sh" - } + def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) { + // Set the label. + steps { + if (osBase == 'Windows_NT') { + // Batch + batchFile(".\\build\\cibuild.cmd -configuration $config") + } + else { + // Shell + shell("./build/cibuild.sh --configuration $config") + } + } + } - def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) { - // Set the label. - steps { - if (os == 'Windows_NT') { - // Batch - batchFile(buildCommand) - } - else { - // Shell - shell(buildCommand) + Utilities.setMachineAffinity(newJob, osBase, machineAffinity) + Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}") + + if (isPR) { + Utilities.addGithubPRTriggerForBranch(newJob, branch, "$os $architecture $config") + } + + def archiveSettings = new ArchivalSettings() + archiveSettings.addFiles("artifacts/$config/log/*") + archiveSettings.addFiles("artifacts/$config/TestResults/*") + archiveSettings.setFailIfNothingArchived() + archiveSettings.setArchiveOnFailure() + Utilities.addArchival(newJob, archiveSettings) } } } - - Utilities.setMachineAffinity(newJob, os, 'latest-or-auto') - Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}") - Utilities.addMSTestResults(newJob, '**/*.trx') - Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${architecture} ${configuration} Build") } - - diff --git a/restore.cmd b/restore.cmd new file mode 100644 index 0000000..95ae754 --- /dev/null +++ b/restore.cmd @@ -0,0 +1,3 @@ +@echo off +powershell -NoLogo -NoProfile -ExecutionPolicy ByPass %~dp0build\build.ps1 -restore %* +exit /b %ErrorLevel% diff --git a/restore.sh b/restore.sh new file mode 100755 index 0000000..fa3afcc --- /dev/null +++ b/restore.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$ScriptRoot/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +. "$ScriptRoot/build/build.sh" --restore $@ diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..0a9a00c --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,29 @@ + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props + + + + + + + MicrosoftAspNet + true + + + + true + + + + false + + + + false + + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 0000000..1692a68 --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,7 @@ + + + + + + + diff --git a/CommandLine/Accept.cs b/src/source/CommandLine/Accept.cs similarity index 100% rename from CommandLine/Accept.cs rename to src/source/CommandLine/Accept.cs diff --git a/CommandLine/AppliedOption.cs b/src/source/CommandLine/AppliedOption.cs similarity index 100% rename from CommandLine/AppliedOption.cs rename to src/source/CommandLine/AppliedOption.cs diff --git a/CommandLine/AppliedOptionExtensions.cs b/src/source/CommandLine/AppliedOptionExtensions.cs similarity index 100% rename from CommandLine/AppliedOptionExtensions.cs rename to src/source/CommandLine/AppliedOptionExtensions.cs diff --git a/CommandLine/AppliedOptionSet.cs b/src/source/CommandLine/AppliedOptionSet.cs similarity index 100% rename from CommandLine/AppliedOptionSet.cs rename to src/source/CommandLine/AppliedOptionSet.cs diff --git a/CommandLine/ArgumentsRule.cs b/src/source/CommandLine/ArgumentsRule.cs similarity index 100% rename from CommandLine/ArgumentsRule.cs rename to src/source/CommandLine/ArgumentsRule.cs diff --git a/CommandLine/ArgumentsRuleExtensions.cs b/src/source/CommandLine/ArgumentsRuleExtensions.cs similarity index 100% rename from CommandLine/ArgumentsRuleExtensions.cs rename to src/source/CommandLine/ArgumentsRuleExtensions.cs diff --git a/CommandLine/Command.cs b/src/source/CommandLine/Command.cs similarity index 100% rename from CommandLine/Command.cs rename to src/source/CommandLine/Command.cs diff --git a/CommandLine/CommandExecutionResult.cs b/src/source/CommandLine/CommandExecutionResult.cs similarity index 100% rename from CommandLine/CommandExecutionResult.cs rename to src/source/CommandLine/CommandExecutionResult.cs diff --git a/CommandLine/Create.cs b/src/source/CommandLine/Create.cs similarity index 100% rename from CommandLine/Create.cs rename to src/source/CommandLine/Create.cs diff --git a/CommandLine/DefaultHelpViewText.cs b/src/source/CommandLine/DefaultHelpViewText.cs similarity index 100% rename from CommandLine/DefaultHelpViewText.cs rename to src/source/CommandLine/DefaultHelpViewText.cs diff --git a/CommandLine/DefaultValidationMessages.cs b/src/source/CommandLine/DefaultValidationMessages.cs similarity index 100% rename from CommandLine/DefaultValidationMessages.cs rename to src/source/CommandLine/DefaultValidationMessages.cs diff --git a/CommandLine/EnumerableExtensions.cs b/src/source/CommandLine/EnumerableExtensions.cs similarity index 100% rename from CommandLine/EnumerableExtensions.cs rename to src/source/CommandLine/EnumerableExtensions.cs diff --git a/CommandLine/HelpViewExtensions.cs b/src/source/CommandLine/HelpViewExtensions.cs similarity index 100% rename from CommandLine/HelpViewExtensions.cs rename to src/source/CommandLine/HelpViewExtensions.cs diff --git a/CommandLine/IValidationMessages.cs b/src/source/CommandLine/IValidationMessages.cs similarity index 100% rename from CommandLine/IValidationMessages.cs rename to src/source/CommandLine/IValidationMessages.cs diff --git a/src/source/CommandLine/Microsoft.DotNet.Cli.CommandLine.csproj b/src/source/CommandLine/Microsoft.DotNet.Cli.CommandLine.csproj new file mode 100644 index 0000000..ad6c8e8 --- /dev/null +++ b/src/source/CommandLine/Microsoft.DotNet.Cli.CommandLine.csproj @@ -0,0 +1,18 @@ + + + + + + Library + netstandard1.5 + + + + + + true + + + + + diff --git a/CommandLine/Option.cs b/src/source/CommandLine/Option.cs similarity index 100% rename from CommandLine/Option.cs rename to src/source/CommandLine/Option.cs diff --git a/CommandLine/OptionError.cs b/src/source/CommandLine/OptionError.cs similarity index 100% rename from CommandLine/OptionError.cs rename to src/source/CommandLine/OptionError.cs diff --git a/CommandLine/OptionExtensions.cs b/src/source/CommandLine/OptionExtensions.cs similarity index 100% rename from CommandLine/OptionExtensions.cs rename to src/source/CommandLine/OptionExtensions.cs diff --git a/CommandLine/OptionSet.cs b/src/source/CommandLine/OptionSet.cs similarity index 100% rename from CommandLine/OptionSet.cs rename to src/source/CommandLine/OptionSet.cs diff --git a/CommandLine/OptionSet{T}.cs b/src/source/CommandLine/OptionSet{T}.cs similarity index 100% rename from CommandLine/OptionSet{T}.cs rename to src/source/CommandLine/OptionSet{T}.cs diff --git a/CommandLine/ParseException.cs b/src/source/CommandLine/ParseException.cs similarity index 100% rename from CommandLine/ParseException.cs rename to src/source/CommandLine/ParseException.cs diff --git a/CommandLine/ParseResult.cs b/src/source/CommandLine/ParseResult.cs similarity index 100% rename from CommandLine/ParseResult.cs rename to src/source/CommandLine/ParseResult.cs diff --git a/CommandLine/ParseResultExtensions.cs b/src/source/CommandLine/ParseResultExtensions.cs similarity index 100% rename from CommandLine/ParseResultExtensions.cs rename to src/source/CommandLine/ParseResultExtensions.cs diff --git a/CommandLine/Parser.cs b/src/source/CommandLine/Parser.cs similarity index 100% rename from CommandLine/Parser.cs rename to src/source/CommandLine/Parser.cs diff --git a/CommandLine/ParserConfiguration.cs b/src/source/CommandLine/ParserConfiguration.cs similarity index 100% rename from CommandLine/ParserConfiguration.cs rename to src/source/CommandLine/ParserConfiguration.cs diff --git a/CommandLine/ParserExtensions.cs b/src/source/CommandLine/ParserExtensions.cs similarity index 100% rename from CommandLine/ParserExtensions.cs rename to src/source/CommandLine/ParserExtensions.cs diff --git a/CommandLine/Register-ArgumentCompleter.ps1 b/src/source/CommandLine/Register-ArgumentCompleter.ps1 similarity index 100% rename from CommandLine/Register-ArgumentCompleter.ps1 rename to src/source/CommandLine/Register-ArgumentCompleter.ps1 diff --git a/CommandLine/StringExtensions.cs b/src/source/CommandLine/StringExtensions.cs similarity index 100% rename from CommandLine/StringExtensions.cs rename to src/source/CommandLine/StringExtensions.cs diff --git a/CommandLine/Suggest.cs b/src/source/CommandLine/Suggest.cs similarity index 100% rename from CommandLine/Suggest.cs rename to src/source/CommandLine/Suggest.cs diff --git a/CommandLine/Token.cs b/src/source/CommandLine/Token.cs similarity index 100% rename from CommandLine/Token.cs rename to src/source/CommandLine/Token.cs diff --git a/CommandLine/TokenType.cs b/src/source/CommandLine/TokenType.cs similarity index 100% rename from CommandLine/TokenType.cs rename to src/source/CommandLine/TokenType.cs diff --git a/CommandLine/ValidationMessages.cs b/src/source/CommandLine/ValidationMessages.cs similarity index 100% rename from CommandLine/ValidationMessages.cs rename to src/source/CommandLine/ValidationMessages.cs diff --git a/CommandLine.Tests/AppliedOptionTests.cs b/src/tests/CommandLine.Tests/AppliedOptionTests.cs similarity index 100% rename from CommandLine.Tests/AppliedOptionTests.cs rename to src/tests/CommandLine.Tests/AppliedOptionTests.cs diff --git a/CommandLine.Tests/ArgumentsRuleCompositionTests.cs b/src/tests/CommandLine.Tests/ArgumentsRuleCompositionTests.cs similarity index 100% rename from CommandLine.Tests/ArgumentsRuleCompositionTests.cs rename to src/tests/CommandLine.Tests/ArgumentsRuleCompositionTests.cs diff --git a/CommandLine.Tests/CommandExecutionTests.cs b/src/tests/CommandLine.Tests/CommandExecutionTests.cs similarity index 100% rename from CommandLine.Tests/CommandExecutionTests.cs rename to src/tests/CommandLine.Tests/CommandExecutionTests.cs diff --git a/CommandLine.Tests/CommandTests.cs b/src/tests/CommandLine.Tests/CommandTests.cs similarity index 100% rename from CommandLine.Tests/CommandTests.cs rename to src/tests/CommandLine.Tests/CommandTests.cs diff --git a/CommandLine.Tests/HelpViewTests.cs b/src/tests/CommandLine.Tests/HelpViewTests.cs similarity index 100% rename from CommandLine.Tests/HelpViewTests.cs rename to src/tests/CommandLine.Tests/HelpViewTests.cs diff --git a/CommandLine.Tests/MaterializerTests.cs b/src/tests/CommandLine.Tests/MaterializerTests.cs similarity index 100% rename from CommandLine.Tests/MaterializerTests.cs rename to src/tests/CommandLine.Tests/MaterializerTests.cs diff --git a/src/tests/CommandLine.Tests/Microsoft.DotNet.Cli.CommandLine.Tests.csproj b/src/tests/CommandLine.Tests/Microsoft.DotNet.Cli.CommandLine.Tests.csproj new file mode 100644 index 0000000..fba1f45 --- /dev/null +++ b/src/tests/CommandLine.Tests/Microsoft.DotNet.Cli.CommandLine.Tests.csproj @@ -0,0 +1,27 @@ + + + + + + Exe + netcoreapp1.0 + + + + true + Tests\$(MSBuildProjectName) + + + + + + + + + + + + + + + diff --git a/CommandLine.Tests/OptionTests.cs b/src/tests/CommandLine.Tests/OptionTests.cs similarity index 100% rename from CommandLine.Tests/OptionTests.cs rename to src/tests/CommandLine.Tests/OptionTests.cs diff --git a/CommandLine.Tests/ParseDiagramTests.cs b/src/tests/CommandLine.Tests/ParseDiagramTests.cs similarity index 100% rename from CommandLine.Tests/ParseDiagramTests.cs rename to src/tests/CommandLine.Tests/ParseDiagramTests.cs diff --git a/CommandLine.Tests/ParserTests.cs b/src/tests/CommandLine.Tests/ParserTests.cs similarity index 100% rename from CommandLine.Tests/ParserTests.cs rename to src/tests/CommandLine.Tests/ParserTests.cs diff --git a/CommandLine.Tests/ParsingValidationTests.cs b/src/tests/CommandLine.Tests/ParsingValidationTests.cs similarity index 97% rename from CommandLine.Tests/ParsingValidationTests.cs rename to src/tests/CommandLine.Tests/ParsingValidationTests.cs index fa6bb7d..bf393ec 100644 --- a/CommandLine.Tests/ParsingValidationTests.cs +++ b/src/tests/CommandLine.Tests/ParsingValidationTests.cs @@ -108,7 +108,8 @@ namespace Microsoft.DotNet.Cli.CommandLine.Tests var invalidCharacters = $"|{Path.GetInvalidPathChars().First()}|"; - output.WriteLine(string.Join("\n", Path.GetInvalidPathChars())); + // Convert to ushort so the xUnit XML writer doesn't complain about invalid characters + output.WriteLine(string.Join("\n", Path.GetInvalidPathChars().Select((c) => (ushort)(c)))); var result = command.Parse($"the-command {invalidCharacters}"); diff --git a/CommandLine.Tests/SuggestionTests.cs b/src/tests/CommandLine.Tests/SuggestionTests.cs similarity index 100% rename from CommandLine.Tests/SuggestionTests.cs rename to src/tests/CommandLine.Tests/SuggestionTests.cs diff --git a/CommandLine.Tests/TokenizeTests.cs b/src/tests/CommandLine.Tests/TokenizeTests.cs similarity index 100% rename from CommandLine.Tests/TokenizeTests.cs rename to src/tests/CommandLine.Tests/TokenizeTests.cs diff --git a/CommandLine.Tests/ValidationMessageLocalizationTests.cs b/src/tests/CommandLine.Tests/ValidationMessageLocalizationTests.cs similarity index 100% rename from CommandLine.Tests/ValidationMessageLocalizationTests.cs rename to src/tests/CommandLine.Tests/ValidationMessageLocalizationTests.cs diff --git a/src/xamples/SampleParsers/CommandLine.SampleParsers.csproj b/src/xamples/SampleParsers/CommandLine.SampleParsers.csproj new file mode 100644 index 0000000..47da017 --- /dev/null +++ b/src/xamples/SampleParsers/CommandLine.SampleParsers.csproj @@ -0,0 +1,32 @@ + + + + + + Exe + netcoreapp1.0 + + + + Samples\$(MSBuildProjectName) + false + + + + + + + + + + + + + + + + + + + + diff --git a/SampleParsers/Dotnet/AssertionExtensions.cs b/src/xamples/SampleParsers/Dotnet/AssertionExtensions.cs similarity index 100% rename from SampleParsers/Dotnet/AssertionExtensions.cs rename to src/xamples/SampleParsers/Dotnet/AssertionExtensions.cs diff --git a/SampleParsers/Dotnet/DotNetParser.cs b/src/xamples/SampleParsers/Dotnet/DotNetParser.cs similarity index 100% rename from SampleParsers/Dotnet/DotNetParser.cs rename to src/xamples/SampleParsers/Dotnet/DotNetParser.cs diff --git a/SampleParsers/Dotnet/DotnetParserHelpViewTests.cs b/src/xamples/SampleParsers/Dotnet/DotnetParserHelpViewTests.cs similarity index 100% rename from SampleParsers/Dotnet/DotnetParserHelpViewTests.cs rename to src/xamples/SampleParsers/Dotnet/DotnetParserHelpViewTests.cs diff --git a/SampleParsers/Dotnet/DotnetParserTests.cs b/src/xamples/SampleParsers/Dotnet/DotnetParserTests.cs similarity index 100% rename from SampleParsers/Dotnet/DotnetParserTests.cs rename to src/xamples/SampleParsers/Dotnet/DotnetParserTests.cs diff --git a/SampleParsers/Dotnet/SuggestionTests.cs b/src/xamples/SampleParsers/Dotnet/SuggestionTests.cs similarity index 100% rename from SampleParsers/Dotnet/SuggestionTests.cs rename to src/xamples/SampleParsers/Dotnet/SuggestionTests.cs diff --git a/dotnet/App.config b/src/xamples/dotnet/App.config similarity index 100% rename from dotnet/App.config rename to src/xamples/dotnet/App.config diff --git a/dotnet/Program.cs b/src/xamples/dotnet/Program.cs similarity index 100% rename from dotnet/Program.cs rename to src/xamples/dotnet/Program.cs diff --git a/src/xamples/dotnet/dotnet.csproj b/src/xamples/dotnet/dotnet.csproj new file mode 100644 index 0000000..b120532 --- /dev/null +++ b/src/xamples/dotnet/dotnet.csproj @@ -0,0 +1,27 @@ + + + + + + Exe + netcoreapp1.0 + + + + Samples\$(MSBuildProjectName) + false + + + + + + + + + + + + + + + diff --git a/dotnet/register-completions.bash b/src/xamples/dotnet/register-completions.bash similarity index 100% rename from dotnet/register-completions.bash rename to src/xamples/dotnet/register-completions.bash diff --git a/dotnet/register-completions.ps1 b/src/xamples/dotnet/register-completions.ps1 similarity index 100% rename from dotnet/register-completions.ps1 rename to src/xamples/dotnet/register-completions.ps1 diff --git a/dotnet/register-completions.zsh b/src/xamples/dotnet/register-completions.zsh similarity index 100% rename from dotnet/register-completions.zsh rename to src/xamples/dotnet/register-completions.zsh diff --git a/test.cmd b/test.cmd new file mode 100644 index 0000000..8887b6c --- /dev/null +++ b/test.cmd @@ -0,0 +1,3 @@ +@echo off +powershell -NoLogo -NoProfile -ExecutionPolicy ByPass %~dp0build\build.ps1 -test %* +exit /b %ErrorLevel% diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..f4a46e1 --- /dev/null +++ b/test.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$ScriptRoot/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +. "$ScriptRoot/build/build.sh" --test $@ diff --git a/tools/BuildTools.csproj b/tools/BuildTools.csproj deleted file mode 100644 index b62ef47..0000000 --- a/tools/BuildTools.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - false - false - false - false - true - true - - - - - - diff --git a/tools/Key.snk b/tools/Key.snk deleted file mode 100644 index e10e4889c125d3120cd9e81582243d70f7cbb806..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098=Iw=HCsnz~#iVhm& zj%TU(_THUee?3yHBjk$37ysB?i5#7WD$={H zV4B!OxRPrb|8)HPg~A}8P>^=#y<)56#=E&NzcjOtPK~<4n6GHt=K$ro*T(lhby_@U zEk(hLzk1H)0yXj{A_5>fk-TgNoP|q6(tP2xo8zt8i%212CWM#AeCd?`hS|4~L({h~Moo(~vy&3Z z1uI}`fd^*>o=rwbAGymj6RM^pZm(*Kfhs+Y1#`-2JPWZMK8@;ZWCk2+9bX4YP);~fj-BU*R zQPvWv$89!{Rl9wM+zR>_TSkn^voYxA?2G iKnV#iZ6Ah`K>b=@=IjYJXrxL124zR(38)nxe+&q_$QXwJ diff --git a/tools/PushToBlobFeed.targets b/tools/PushToBlobFeed.targets deleted file mode 100644 index e3b9f7f..0000000 --- a/tools/PushToBlobFeed.targets +++ /dev/null @@ -1,29 +0,0 @@ - - - - $([MSBuild=""]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Directory.Build.props')) - - - - - - - - - - - https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json - - - - - - -