diff --git a/.gitignore b/.gitignore index 61e62b3..c595526 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ testWorkDir/ *.nuget.props *.nuget.targets .idea/ +.dotnet/ diff --git a/DotNetTools.sln b/DotNetTools.sln index 28d6ae6..a03be63 100644 --- a/DotNetTools.sln +++ b/DotNetTools.sln @@ -1,34 +1,29 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.25807.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{66517987-2A5A-4330-B130-207039378FD4}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Watcher.Tools", "src\Microsoft.DotNet.Watcher.Tools\Microsoft.DotNet.Watcher.Tools.xproj", "{8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Watcher.Tools", "src\Microsoft.DotNet.Watcher.Tools\Microsoft.DotNet.Watcher.Tools.csproj", "{8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8321E0D1-9A47-4D2F-AED8-3AE636D44E35}" ProjectSection(SolutionItems) = preProject - global.json = global.json NuGet.Config = NuGet.Config EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F5B382BC-258F-46E1-AC3D-10E5CCD55134}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Watcher.Tools.FunctionalTests", "test\Microsoft.DotNet.Watcher.Tools.FunctionalTests\Microsoft.DotNet.Watcher.Tools.FunctionalTests.xproj", "{16BADE2F-1184-4518-8A70-B68A19D0805B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Watcher.Tools.FunctionalTests", "test\Microsoft.DotNet.Watcher.Tools.FunctionalTests\Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj", "{16BADE2F-1184-4518-8A70-B68A19D0805B}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.SecretManager.Tools", "src\Microsoft.Extensions.SecretManager.Tools\Microsoft.Extensions.SecretManager.Tools.xproj", "{8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.SecretManager.Tools", "src\Microsoft.Extensions.SecretManager.Tools\Microsoft.Extensions.SecretManager.Tools.csproj", "{8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.SecretManager.Tools.Tests", "test\Microsoft.Extensions.SecretManager.Tools.Tests\Microsoft.Extensions.SecretManager.Tools.Tests.xproj", "{7B331122-83B1-4F08-A119-DC846959844C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.SecretManager.Tools.Tests", "test\Microsoft.Extensions.SecretManager.Tools.Tests\Microsoft.Extensions.SecretManager.Tools.Tests.csproj", "{7B331122-83B1-4F08-A119-DC846959844C}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Watcher.Tools.Tests", "test\Microsoft.DotNet.Watcher.Tools.Tests\Microsoft.DotNet.Watcher.Tools.Tests.xproj", "{8A2E6961-6B12-4A8E-8215-3E7301D52EAC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Watcher.Tools.Tests", "test\Microsoft.DotNet.Watcher.Tools.Tests\Microsoft.DotNet.Watcher.Tools.Tests.csproj", "{8A2E6961-6B12-4A8E-8215-3E7301D52EAC}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.Caching.SqlConfig.Tools", "src\Microsoft.Extensions.Caching.SqlConfig.Tools\Microsoft.Extensions.Caching.SqlConfig.Tools.xproj", "{53F3B53D-303A-4DAA-9C38-4F55195FA5B9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Caching.SqlConfig.Tools", "src\Microsoft.Extensions.Caching.SqlConfig.Tools\Microsoft.Extensions.Caching.SqlConfig.Tools.csproj", "{53F3B53D-303A-4DAA-9C38-4F55195FA5B9}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{59E02BDF-98DE-4D64-B576-2D0299D5E052}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NuGetPackager", "tools\NuGetPackager\NuGetPackager.xproj", "{8B781D87-1FC3-4A34-9089-2BDF6B562B85}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.Tools.Tests", "test\Microsoft.Extensions.Tools.Tests\Microsoft.Extensions.Tools.Tests.xproj", "{A24BF1D1-4326-4455-A528-09F1E20EDC83}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Tools.Tests", "test\Microsoft.Extensions.Tools.Tests\Microsoft.Extensions.Tools.Tests.csproj", "{9295E811-FF0F-E40A-2F9A-0B2C4EBC22AD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -38,36 +33,32 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}.Release|Any CPU.Build.0 = Release|Any CPU + {8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}.Release|Any CPU.Build.0 = Debug|Any CPU {16BADE2F-1184-4518-8A70-B68A19D0805B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {16BADE2F-1184-4518-8A70-B68A19D0805B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {16BADE2F-1184-4518-8A70-B68A19D0805B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {16BADE2F-1184-4518-8A70-B68A19D0805B}.Release|Any CPU.Build.0 = Release|Any CPU + {16BADE2F-1184-4518-8A70-B68A19D0805B}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {16BADE2F-1184-4518-8A70-B68A19D0805B}.Release|Any CPU.Build.0 = Debug|Any CPU {8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}.Release|Any CPU.Build.0 = Release|Any CPU + {8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}.Release|Any CPU.Build.0 = Debug|Any CPU + {9295E811-FF0F-E40A-2F9A-0B2C4EBC22AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9295E811-FF0F-E40A-2F9A-0B2C4EBC22AD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9295E811-FF0F-E40A-2F9A-0B2C4EBC22AD}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {9295E811-FF0F-E40A-2F9A-0B2C4EBC22AD}.Release|Any CPU.Build.0 = Debug|Any CPU {7B331122-83B1-4F08-A119-DC846959844C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7B331122-83B1-4F08-A119-DC846959844C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B331122-83B1-4F08-A119-DC846959844C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7B331122-83B1-4F08-A119-DC846959844C}.Release|Any CPU.Build.0 = Release|Any CPU + {7B331122-83B1-4F08-A119-DC846959844C}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {7B331122-83B1-4F08-A119-DC846959844C}.Release|Any CPU.Build.0 = Debug|Any CPU {8A2E6961-6B12-4A8E-8215-3E7301D52EAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8A2E6961-6B12-4A8E-8215-3E7301D52EAC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A2E6961-6B12-4A8E-8215-3E7301D52EAC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A2E6961-6B12-4A8E-8215-3E7301D52EAC}.Release|Any CPU.Build.0 = Release|Any CPU + {8A2E6961-6B12-4A8E-8215-3E7301D52EAC}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {8A2E6961-6B12-4A8E-8215-3E7301D52EAC}.Release|Any CPU.Build.0 = Debug|Any CPU {53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.Release|Any CPU.Build.0 = Release|Any CPU - {8B781D87-1FC3-4A34-9089-2BDF6B562B85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B781D87-1FC3-4A34-9089-2BDF6B562B85}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B781D87-1FC3-4A34-9089-2BDF6B562B85}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B781D87-1FC3-4A34-9089-2BDF6B562B85}.Release|Any CPU.Build.0 = Release|Any CPU - {A24BF1D1-4326-4455-A528-09F1E20EDC83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A24BF1D1-4326-4455-A528-09F1E20EDC83}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A24BF1D1-4326-4455-A528-09F1E20EDC83}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A24BF1D1-4326-4455-A528-09F1E20EDC83}.Release|Any CPU.Build.0 = Release|Any CPU + {53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.Release|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -76,10 +67,9 @@ Global {8A8CEABC-AC47-43FF-A5DF-69224F7E1F46} = {66517987-2A5A-4330-B130-207039378FD4} {16BADE2F-1184-4518-8A70-B68A19D0805B} = {F5B382BC-258F-46E1-AC3D-10E5CCD55134} {8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E} = {66517987-2A5A-4330-B130-207039378FD4} + {9295E811-FF0F-E40A-2F9A-0B2C4EBC22AD} = {F5B382BC-258F-46E1-AC3D-10E5CCD55134} {7B331122-83B1-4F08-A119-DC846959844C} = {F5B382BC-258F-46E1-AC3D-10E5CCD55134} {8A2E6961-6B12-4A8E-8215-3E7301D52EAC} = {F5B382BC-258F-46E1-AC3D-10E5CCD55134} {53F3B53D-303A-4DAA-9C38-4F55195FA5B9} = {66517987-2A5A-4330-B130-207039378FD4} - {8B781D87-1FC3-4A34-9089-2BDF6B562B85} = {59E02BDF-98DE-4D64-B576-2D0299D5E052} - {A24BF1D1-4326-4455-A528-09F1E20EDC83} = {F5B382BC-258F-46E1-AC3D-10E5CCD55134} EndGlobalSection EndGlobal diff --git a/NuGet.config b/NuGet.config index 5144de9..b0b61c2 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,9 +1,6 @@ - - + - - diff --git a/build.ps1 b/build.ps1 index f780c43..b0daeaa 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/namc/feature/msbuild.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index 0a1463b..da97d96 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/namc/feature/msbuild.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi diff --git a/tools/Key.snk b/build/Key.snk similarity index 100% rename from tools/Key.snk rename to build/Key.snk diff --git a/build/common.props b/build/common.props new file mode 100644 index 0000000..d4553da --- /dev/null +++ b/build/common.props @@ -0,0 +1,42 @@ + + + + en-US + Microsoft Corporation. + Microsoft .NET + + + <_SecondBasedTimeStamp>$([System.DateTime]::UtcNow.Subtract($([System.DateTime]::Parse("2015-01-01"))).TotalSeconds.ToString()) + <_SecondBasedTimeStamp>t$([System.Int64]::Parse($(_SecondBasedTimeStamp.Substring(0, $(_SecondBasedTimeStamp.IndexOf("."))))).ToString("x9")) + + + false + $(_SecondBasedTimeStamp) + $(VersionSuffix)-$(BuildNumber) + $(BuildNumber) + + $(MSBuildProjectName) + Microsoft + © Microsoft Corporation. All rights reserved. + https://github.com/aspnet/DotNetTools + git + https://asp.net + true + + + true + $(MSBuildThisFileDirectory)Key.snk + true + true + + + + $(VersionPrefix) + $(PackageVersion)-$(VersionSuffix)-final + + + + + true + + \ No newline at end of file diff --git a/dir.props b/dir.props new file mode 100644 index 0000000..72afbf2 --- /dev/null +++ b/dir.props @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/global.json b/global.json deleted file mode 100644 index 1920b5a..0000000 --- a/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ "src", "test"] -} diff --git a/makefile.shade b/makefile.shade deleted file mode 100644 index c41f9d3..0000000 --- a/makefile.shade +++ /dev/null @@ -1,32 +0,0 @@ -use namespace="System.IO" - -default BASE_DIR_LOCAL='${Directory.GetCurrentDirectory()}' -default BUILD_DIR_LOCAL='${Path.Combine(BASE_DIR_LOCAL, "artifacts", "build")}' - -var VERSION='0.1' -var FULL_VERSION='0.1' -var AUTHORS='Microsoft Open Technologies, Inc.' --BuildQuality = "msbuild3"; - -use-standard-lifecycle -k-standard-goals - -#xunit-test .xunit-test-msbuild - -#build-pack .build-compile target='compile' - @{ - if (Directory.Exists("src") && !IsLinux) - { - Directory.CreateDirectory(BUILD_DIR_LOCAL); - Dotnet("run -p tools/NuGetPackager -- -c " + E("Configuration") + - " -o artifacts/build/ "+ - "-n src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.nuspec " + - "-n src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.nuspec " + - "-n src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.nuspec "); - - foreach (var nupkg in Files.Include(Path.Combine(BUILD_DIR_LOCAL, "*/" + E("Configuration") + "/*.nupkg"))) - { - File.Copy(nupkg, Path.Combine(BUILD_DIR_LOCAL, Path.GetFileName(nupkg)), true); - } - } - } \ No newline at end of file diff --git a/src/Shared/ArgumentEscaper.cs b/shared/ArgumentEscaper.cs similarity index 100% rename from src/Shared/ArgumentEscaper.cs rename to shared/ArgumentEscaper.cs diff --git a/src/Shared/CliContext.cs b/shared/CliContext.cs similarity index 100% rename from src/Shared/CliContext.cs rename to shared/CliContext.cs diff --git a/src/Shared/CommandLine/AnsiConsole.cs b/shared/CommandLine/AnsiConsole.cs similarity index 100% rename from src/Shared/CommandLine/AnsiConsole.cs rename to shared/CommandLine/AnsiConsole.cs diff --git a/src/Shared/CommandLine/CommandArgument.cs b/shared/CommandLine/CommandArgument.cs similarity index 100% rename from src/Shared/CommandLine/CommandArgument.cs rename to shared/CommandLine/CommandArgument.cs diff --git a/src/Shared/CommandLine/CommandLineApplication.cs b/shared/CommandLine/CommandLineApplication.cs similarity index 100% rename from src/Shared/CommandLine/CommandLineApplication.cs rename to shared/CommandLine/CommandLineApplication.cs diff --git a/src/Shared/CommandLine/CommandOption.cs b/shared/CommandLine/CommandOption.cs similarity index 100% rename from src/Shared/CommandLine/CommandOption.cs rename to shared/CommandLine/CommandOption.cs diff --git a/src/Shared/CommandLine/CommandOptionType.cs b/shared/CommandLine/CommandOptionType.cs similarity index 100% rename from src/Shared/CommandLine/CommandOptionType.cs rename to shared/CommandLine/CommandOptionType.cs diff --git a/src/Shared/CommandLine/CommandParsingException.cs b/shared/CommandLine/CommandParsingException.cs similarity index 100% rename from src/Shared/CommandLine/CommandParsingException.cs rename to shared/CommandLine/CommandParsingException.cs diff --git a/src/Shared/CommandLineApplicationExtensions.cs b/shared/CommandLineApplicationExtensions.cs similarity index 100% rename from src/Shared/CommandLineApplicationExtensions.cs rename to shared/CommandLineApplicationExtensions.cs diff --git a/src/Shared/DebugHelper.cs b/shared/DebugHelper.cs similarity index 100% rename from src/Shared/DebugHelper.cs rename to shared/DebugHelper.cs diff --git a/src/Shared/DotNetMuxer.cs b/shared/DotNetMuxer.cs similarity index 100% rename from src/Shared/DotNetMuxer.cs rename to shared/DotNetMuxer.cs diff --git a/src/Shared/Ensure.cs b/shared/Ensure.cs similarity index 100% rename from src/Shared/Ensure.cs rename to shared/Ensure.cs diff --git a/src/Shared/IConsole.cs b/shared/IConsole.cs similarity index 100% rename from src/Shared/IConsole.cs rename to shared/IConsole.cs diff --git a/src/Shared/PhysicalConsole.cs b/shared/PhysicalConsole.cs similarity index 100% rename from src/Shared/PhysicalConsole.cs rename to shared/PhysicalConsole.cs diff --git a/src/Shared/Reporting/ColorFormatter.cs b/shared/Reporting/ColorFormatter.cs similarity index 100% rename from src/Shared/Reporting/ColorFormatter.cs rename to shared/Reporting/ColorFormatter.cs diff --git a/src/Shared/Reporting/CompositeFormatter.cs b/shared/Reporting/CompositeFormatter.cs similarity index 100% rename from src/Shared/Reporting/CompositeFormatter.cs rename to shared/Reporting/CompositeFormatter.cs diff --git a/src/Shared/Reporting/ConditionalFormatter.cs b/shared/Reporting/ConditionalFormatter.cs similarity index 100% rename from src/Shared/Reporting/ConditionalFormatter.cs rename to shared/Reporting/ConditionalFormatter.cs diff --git a/src/Shared/Reporting/DefaultFormatter.cs b/shared/Reporting/DefaultFormatter.cs similarity index 100% rename from src/Shared/Reporting/DefaultFormatter.cs rename to shared/Reporting/DefaultFormatter.cs diff --git a/src/Shared/Reporting/FormatterBuilder.cs b/shared/Reporting/FormatterBuilder.cs similarity index 100% rename from src/Shared/Reporting/FormatterBuilder.cs rename to shared/Reporting/FormatterBuilder.cs diff --git a/src/Shared/Reporting/FormattingReporter.cs b/shared/Reporting/FormattingReporter.cs similarity index 100% rename from src/Shared/Reporting/FormattingReporter.cs rename to shared/Reporting/FormattingReporter.cs diff --git a/src/Shared/Reporting/IFormatter.cs b/shared/Reporting/IFormatter.cs similarity index 100% rename from src/Shared/Reporting/IFormatter.cs rename to shared/Reporting/IFormatter.cs diff --git a/src/Shared/Reporting/IReporter.cs b/shared/Reporting/IReporter.cs similarity index 100% rename from src/Shared/Reporting/IReporter.cs rename to shared/Reporting/IReporter.cs diff --git a/src/Shared/Reporting/PrefixFormatter.cs b/shared/Reporting/PrefixFormatter.cs similarity index 100% rename from src/Shared/Reporting/PrefixFormatter.cs rename to shared/Reporting/PrefixFormatter.cs diff --git a/src/Shared/Reporting/ReporterBuilder.cs b/shared/Reporting/ReporterBuilder.cs similarity index 100% rename from src/Shared/Reporting/ReporterBuilder.cs rename to shared/Reporting/ReporterBuilder.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj b/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj new file mode 100644 index 0000000..6858eb7 --- /dev/null +++ b/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj @@ -0,0 +1,23 @@ + + + + netcoreapp1.0 + dotnet-watch + Exe + Command line tool to watch for source file changes during development and restart the dotnet command. + dotnet;watch + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.nuspec b/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.nuspec deleted file mode 100644 index 22054d7..0000000 --- a/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.nuspec +++ /dev/null @@ -1,31 +0,0 @@ - - - - Microsoft.DotNet.Watcher.Tools - $version$ - Microsoft - Microsoft - false - Command line tool to watch for source file changes during development and restart the dotnet command. - dotnet,watch - true - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.xproj b/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.xproj deleted file mode 100644 index 6ce5b43..0000000 --- a/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 8a8ceabc-ac47-43ff-a5df-69224f7e1f46 - .\obj - .\bin\ - - - Microsoft.DotNet.Watcher - - - 2.0 - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Watcher.Tools/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.Watcher.Tools/Properties/AssemblyInfo.cs index df37305..db52f83 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/Properties/AssemblyInfo.cs +++ b/src/Microsoft.DotNet.Watcher.Tools/Properties/AssemblyInfo.cs @@ -2,10 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; -using System.Resources; +using System.Runtime.CompilerServices; [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: NeutralResourcesLanguage("en-US")] -[assembly: AssemblyCompany("Microsoft Corporation.")] -[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] -[assembly: AssemblyProduct("Microsoft .NET")] +[assembly: InternalsVisibleTo("Microsoft.DotNet.Watcher.Tools.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +// TODO remove when .Source packages work +[assembly: InternalsVisibleTo("Microsoft.DotNet.Watcher.Tools.FunctionalTests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.DotNet.Watcher.Tools/Properties/InternalsVisibleTo.cs b/src/Microsoft.DotNet.Watcher.Tools/Properties/InternalsVisibleTo.cs deleted file mode 100644 index ea9ec15..0000000 --- a/src/Microsoft.DotNet.Watcher.Tools/Properties/InternalsVisibleTo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.DotNet.Watcher.Tools.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] \ No newline at end of file diff --git a/src/Microsoft.DotNet.Watcher.Tools/Sources/ProcessHelper.cs b/src/Microsoft.DotNet.Watcher.Tools/Sources/ProcessHelper.cs new file mode 100644 index 0000000..eccf4dd --- /dev/null +++ b/src/Microsoft.DotNet.Watcher.Tools/Sources/ProcessHelper.cs @@ -0,0 +1,115 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +// TODO remove and using Microsoft.Extensions.Process.Sources when https://github.com/dotnet/sdk/issues/115 is fixed + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; + +namespace Microsoft.Extensions.Internal +{ + internal static class ProcessExtensions + { + private static readonly bool _isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + private static readonly TimeSpan _defaultTimeout = TimeSpan.FromSeconds(30); + + public static void KillTree(this Process process) + { + process.KillTree(_defaultTimeout); + } + + public static void KillTree(this Process process, TimeSpan timeout) + { + string stdout; + if (_isWindows) + { + RunProcessAndWaitForExit( + "taskkill", + $"/T /F /PID {process.Id}", + timeout, + out stdout); + } + else + { + var children = new HashSet(); + GetAllChildIdsUnix(process.Id, children, timeout); + foreach (var childId in children) + { + KillProcessUnix(childId, timeout); + } + KillProcessUnix(process.Id, timeout); + } + } + + private static void GetAllChildIdsUnix(int parentId, ISet children, TimeSpan timeout) + { + string stdout; + var exitCode = RunProcessAndWaitForExit( + "pgrep", + $"-P {parentId}", + timeout, + out stdout); + + if (exitCode == 0 && !string.IsNullOrEmpty(stdout)) + { + using (var reader = new StringReader(stdout)) + { + while (true) + { + var text = reader.ReadLine(); + if (text == null) + { + return; + } + + int id; + if (int.TryParse(text, out id)) + { + children.Add(id); + // Recursively get the children + GetAllChildIdsUnix(id, children, timeout); + } + } + } + } + } + + private static void KillProcessUnix(int processId, TimeSpan timeout) + { + string stdout; + RunProcessAndWaitForExit( + "kill", + $"-TERM {processId}", + timeout, + out stdout); + } + + private static int RunProcessAndWaitForExit(string fileName, string arguments, TimeSpan timeout, out string stdout) + { + var startInfo = new ProcessStartInfo + { + FileName = fileName, + Arguments = arguments, + RedirectStandardOutput = true, + UseShellExecute = false + }; + + var process = Process.Start(startInfo); + + stdout = null; + if (process.WaitForExit((int)timeout.TotalMilliseconds)) + { + stdout = process.StandardOutput.ReadToEnd(); + } + else + { + process.Kill(); + } + + return process.ExitCode; + } + } +} diff --git a/src/Microsoft.DotNet.Watcher.Tools/project.json b/src/Microsoft.DotNet.Watcher.Tools/project.json deleted file mode 100644 index 945f21c..0000000 --- a/src/Microsoft.DotNet.Watcher.Tools/project.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "outputName": "dotnet-watch", - "warningsAsErrors": true, - "emitEntryPoint": true, - "debugType": "portable", - "keyFile": "../../tools/Key.snk", - "copyToOutput": "toolassets/*.targets", - "embed": { - "mappings": { - "dotnetwatch.targets": "dotnetwatch.targets" - } - }, - "compile": { - "include": "../Shared/**/*.cs" - } - }, - "publishOptions": { - "include": [ - "toolassets/*.targets", - "prefercliruntime" - ] - }, - "dependencies": { - "Microsoft.Extensions.Process.Sources": { - "type": "build", - "version": "1.0.0" - }, - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.0" - } - }, - "frameworks": { - "netcoreapp1.0": {} - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj new file mode 100644 index 0000000..b80470d --- /dev/null +++ b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj @@ -0,0 +1,19 @@ + + + + netcoreapp1.0 + dotnet-sql-cache + Exe + Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching. + cache;distributedcache;sqlserver + + + + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.nuspec b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.nuspec deleted file mode 100644 index afe20d8..0000000 --- a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.nuspec +++ /dev/null @@ -1,28 +0,0 @@ - - - - Microsoft.Extensions.Caching.SqlConfig.Tools - $version$ - Microsoft - Microsoft - false - Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching. - cache,distributedcache,sqlserver - true - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.xproj b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.xproj deleted file mode 100644 index 1bba570..0000000 --- a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.xproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 53f3b53d-303a-4daa-9c38-4f55195fa5b9 - .\obj - .\bin\ - - - 2.0 - - - \ No newline at end of file diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Properties/AssemblyInfo.cs b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Properties/AssemblyInfo.cs index 8d8d881..1c2dd26 100644 --- a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Properties/AssemblyInfo.cs +++ b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Properties/AssemblyInfo.cs @@ -2,10 +2,5 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; -using System.Resources; [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: NeutralResourcesLanguage("en-us")] -[assembly: AssemblyCompany("Microsoft Corporation.")] -[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] -[assembly: AssemblyProduct("Microsoft .NET Extensions")] diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/prefercliruntime b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/prefercliruntime deleted file mode 100644 index e69de29..0000000 diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/project.json b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/project.json deleted file mode 100644 index 7fbfeae..0000000 --- a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/project.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "outputName": "dotnet-sql-cache", - "emitEntryPoint": true, - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk", - "compile": "../Shared/**/*.cs" - }, - "publishOptions": { - "include": "prefercliruntime" - }, - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "System.Data.SqlClient": "4.1.0" - }, - "frameworks": { - "netcoreapp1.0": {} - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj b/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj new file mode 100644 index 0000000..a7a1643 --- /dev/null +++ b/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj @@ -0,0 +1,22 @@ + + + + netcoreapp1.0 + dotnet-user-secrets + Exe + Command line tool to manage user secrets for Microsoft.Extensions.Configuration. + configuration;secrets;usersecrets + false + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.nuspec b/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.nuspec deleted file mode 100644 index d528291..0000000 --- a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.nuspec +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Microsoft.Extensions.SecretManager.Tools - $version$ - Microsoft - Microsoft - false - Command line tool to manage user secrets for Microsoft.Extensions.Configuration. - configuration,secrets,usersecrets - true - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.xproj b/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.xproj deleted file mode 100644 index aad1039..0000000 --- a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.xproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 8730e848-ca0f-4e0a-9a2f-bc22ad0b2c4e - .\obj - .\bin\ - - - 2.0 - - - \ No newline at end of file diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Properties/AssemblyInfo.cs b/src/Microsoft.Extensions.SecretManager.Tools/Properties/AssemblyInfo.cs index 8d8d881..98bf463 100644 --- a/src/Microsoft.Extensions.SecretManager.Tools/Properties/AssemblyInfo.cs +++ b/src/Microsoft.Extensions.SecretManager.Tools/Properties/AssemblyInfo.cs @@ -2,10 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; -using System.Resources; +using System.Runtime.CompilerServices; +[assembly: InternalsVisibleTo("Microsoft.Extensions.SecretManager.Tools.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: NeutralResourcesLanguage("en-us")] -[assembly: AssemblyCompany("Microsoft Corporation.")] -[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] -[assembly: AssemblyProduct("Microsoft .NET Extensions")] diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Properties/InternalsVisibleTo.cs b/src/Microsoft.Extensions.SecretManager.Tools/Properties/InternalsVisibleTo.cs deleted file mode 100644 index 8057e7a..0000000 --- a/src/Microsoft.Extensions.SecretManager.Tools/Properties/InternalsVisibleTo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.Extensions.SecretManager.Tools.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] \ No newline at end of file diff --git a/src/Microsoft.Extensions.SecretManager.Tools/prefercliruntime b/src/Microsoft.Extensions.SecretManager.Tools/prefercliruntime deleted file mode 100644 index e69de29..0000000 diff --git a/src/Microsoft.Extensions.SecretManager.Tools/project.json b/src/Microsoft.Extensions.SecretManager.Tools/project.json deleted file mode 100644 index e33c4f9..0000000 --- a/src/Microsoft.Extensions.SecretManager.Tools/project.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "outputName": "dotnet-user-secrets", - "emitEntryPoint": true, - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk", - "embed": { - "mappings": { - "ProjectIdResolverTargets.xml": "./resources/ProjectIdResolverTargets.xml" - } - }, - "compile": { - "include": "../Shared/**/*.cs" - } - }, - "publishOptions": { - "include": "prefercliruntime" - }, - "dependencies": { - "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0", - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - } - }, - "frameworks": { - "netcoreapp1.0": {} - } -} \ No newline at end of file diff --git a/src/dir.props b/src/dir.props new file mode 100644 index 0000000..97aeb4d --- /dev/null +++ b/src/dir.props @@ -0,0 +1,12 @@ + + + + DotnetCliTool + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Watcher.Tools/prefercliruntime b/src/prefercliruntime similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/prefercliruntime rename to src/prefercliruntime diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj new file mode 100644 index 0000000..ffcad24 --- /dev/null +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj @@ -0,0 +1,22 @@ + + + + netcoreapp1.0 + Exe + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.xproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.xproj deleted file mode 100644 index ed54a4c..0000000 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 16bade2f-1184-4518-8a70-b68a19d0805b - .\obj - .\bin\ - - - 2.0 - - - - - - \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs index fb7e058..080b07a 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs @@ -87,7 +87,6 @@ private void ExecuteCommand(string project, params string[] arguments) private void CreateTestDirectory() { Directory.CreateDirectory(WorkFolder); - File.WriteAllText(Path.Combine(WorkFolder, "global.json"), "{}"); var nugetConfigFilePath = FindNugetConfig(); @@ -116,7 +115,7 @@ public IEnumerable GetDotnetWatchArguments() private static string FindNugetConfig() { - var currentDirPath = Directory.GetCurrentDirectory(); + var currentDirPath = AppContext.BaseDirectory; string nugetConfigFile; while (true) diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj index e5fc0c1..a0446a8 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj @@ -1,6 +1,4 @@ - - - + netcoreapp1.0 Exe @@ -9,8 +7,6 @@ - - \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj index 04aad78..c48eaff 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj @@ -1,6 +1,4 @@ - - - + netstandard1.5 Library @@ -9,7 +7,5 @@ - - \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj index 904fb1c..380a05f 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj @@ -1,6 +1,4 @@ - - - + netcoreapp1.0 Exe @@ -8,8 +6,6 @@ - - \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj index e218c10..7ad3f30 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj @@ -1,6 +1,4 @@ - - - + netcoreapp1.0 Exe @@ -8,8 +6,6 @@ - - \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/clean-assets.cmd b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/clean-assets.cmd deleted file mode 100644 index f8999b5..0000000 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/clean-assets.cmd +++ /dev/null @@ -1,11 +0,0 @@ -@ECHO OFF -:again -if not "%1" == "" ( - echo "Deleting %1\TestProjects" - rmdir /s /q %1\TestProjects - echo "Deleting %1\toolassets" - rmdir /s /q %1\toolassets -) - -mkdir %1\toolassets -copy ..\..\src\Microsoft.DotNet.Watcher.Tools\toolassets\*.targets %1\toolassets \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/clean-assets.sh b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/clean-assets.sh deleted file mode 100755 index 21b69ed..0000000 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/clean-assets.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -if [ -z $1 ]; then - echo "Deleting $1/TestProjects" - rm -rf $1/TestProjects - - echo "Deleting $1/toolassets" - rm -rf $1/toolassets -fi - -mkdir -p $1/toolassets -cp ../../src/Microsoft.DotNet.Watcher.Tools/toolassets/*.targets $1/toolassets - -exit 0 \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/project.json b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/project.json deleted file mode 100644 index 327d701..0000000 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/project.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk", - "copyToOutput": { - "include": "TestProjects/" - }, - "compile": { - "exclude": "TestProjects/" - } - }, - "dependencies": { - "dotnet-test-xunit": "2.2.0-preview2-build1029", - "Microsoft.DotNet.Cli.Utils": "1.0.0-preview4-004215", - "Microsoft.DotNet.InternalAbstractions": "1.0.500-preview2-1-003177", - "Microsoft.AspNetCore.Testing": "1.0.0", - "Microsoft.DotNet.Watcher.Tools": "1.0.0-*", - "Microsoft.DotNet.Watcher.Tools.Tests": "1.0.0-*", - "Microsoft.Extensions.Process.Sources": { - "type": "build", - "version": "1.0.0" - }, - "xunit": "2.2.0-beta3-build3402" - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.1" - } - } - } - }, - "scripts": { - "precompile": "clean-assets %compile:OutputDir%" - }, - "publishOptions": { - "include": "TestProjects/" - }, - "testRunner": "xunit" -} \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/test.cmd b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/test.cmd deleted file mode 100644 index 0aa8bdf..0000000 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/test.cmd +++ /dev/null @@ -1,6 +0,0 @@ -@echo off - -rem For local testing - -dotnet build -..\..\.build\dotnet\dotnet.exe exec --depsfile bin\Debug\netcoreapp1.0\Microsoft.DotNet.Watcher.Tools.FunctionalTests.deps.json --runtimeconfig bin\Debug\netcoreapp1.0\Microsoft.DotNet.Watcher.Tools.FunctionalTests.runtimeconfig.json ..\..\.build\dotnet-test-xunit\2.2.0-preview2-build1029\lib\netcoreapp1.0\dotnet-test-xunit.dll bin\Debug\netcoreapp1.0\Microsoft.DotNet.Watcher.Tools.FunctionalTests.dll %* \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/test.sh b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/test.sh deleted file mode 100755 index e8cd202..0000000 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -set -e - -dotnet build - -../../.build/dotnet/dotnet exec \ ---depsfile bin/Debug/netcoreapp1.0/Microsoft.DotNet.Watcher.Tools.FunctionalTests.deps.json \ ---runtimeconfig bin/Debug/netcoreapp1.0/Microsoft.DotNet.Watcher.Tools.FunctionalTests.runtimeconfig.json \ -../../.build/dotnet-test-xunit/2.2.0-preview2-build1029/lib/netcoreapp1.0/dotnet-test-xunit.dll \ -bin/Debug/netcoreapp1.0/Microsoft.DotNet.Watcher.Tools.FunctionalTests.dll \ -$@ \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj b/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj new file mode 100644 index 0000000..c4885a4 --- /dev/null +++ b/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj @@ -0,0 +1,15 @@ + + + + netcoreapp1.0 + Exe + + + + + + + + + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.xproj b/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.xproj deleted file mode 100644 index 58c2a08..0000000 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.xproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - 14.0.25420 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 8a2e6961-6b12-4a8e-8215-3e7301d52eac - Microsoft.DotNet.Watcher.Tools.Tests - .\obj - .\bin\ - - - 2.0 - - - - - - \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/copyfiles.cmd b/test/Microsoft.DotNet.Watcher.Tools.Tests/copyfiles.cmd deleted file mode 100644 index 6bd0489..0000000 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/copyfiles.cmd +++ /dev/null @@ -1,9 +0,0 @@ -@ECHO OFF -:again -if not "%1" == "" ( - echo "Deleting %1\toolassets" - rmdir /s /q %1\toolassets -) - -mkdir %1\toolassets -copy ..\..\src\Microsoft.DotNet.Watcher.Tools\toolassets\*.targets %1\toolassets \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/copyfiles.sh b/test/Microsoft.DotNet.Watcher.Tools.Tests/copyfiles.sh deleted file mode 100755 index 78ae5ff..0000000 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/copyfiles.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -if [ -z $1 ]; then - echo "Deleting $1/toolassets" - rm -rf $1/toolassets -fi - -mkdir -p $1/toolassets -echo "Copying ./../src/Microsoft.DotNet.Watcher.Tools/toolassets/*.targets" -cp ../../src/Microsoft.DotNet.Watcher.Tools/toolassets/*.targets $1/toolassets - -exit 0 \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/project.json b/test/Microsoft.DotNet.Watcher.Tools.Tests/project.json deleted file mode 100644 index 1916498..0000000 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/project.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk", - "debugType": "portable", - "compile": "../Shared/**/*.cs" - }, - "dependencies": { - "dotnet-test-xunit": "2.2.0-preview2-build1029", - "Microsoft.DotNet.InternalAbstractions": "1.0.0", - "Microsoft.DotNet.Watcher.Tools": "1.0.0-*", - "xunit": "2.2.0-beta3-build3402" - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.1", - "type": "platform" - } - } - } - }, - "scripts": { - "precompile": "copyfiles %compile:OutputDir%" - }, - "testRunner": "xunit" -} \ No newline at end of file diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj b/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj new file mode 100644 index 0000000..503a9ed --- /dev/null +++ b/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj @@ -0,0 +1,12 @@ + + + + netcoreapp1.0 + Exe + + + + + + + \ No newline at end of file diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.xproj b/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.xproj deleted file mode 100644 index 2f0849b..0000000 --- a/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.xproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - 14.0.25420 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 7b331122-83b1-4f08-a119-dc846959844c - Microsoft.Extensions.SecretManager.Tools.Tests - .\obj - .\bin\ - - - 2.0 - - - - - - \ No newline at end of file diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/copyfiles.cmd b/test/Microsoft.Extensions.SecretManager.Tools.Tests/copyfiles.cmd deleted file mode 100644 index 7f24b79..0000000 --- a/test/Microsoft.Extensions.SecretManager.Tools.Tests/copyfiles.cmd +++ /dev/null @@ -1,9 +0,0 @@ -@ECHO OFF -:again -if not "%1" == "" ( - echo "Deleting %1\toolassets" - rmdir /s /q %1\toolassets -) - -mkdir %1\toolassets -copy ..\..\src\Microsoft.Extensions.SecretManager.Tools\toolassets\*.targets %1\toolassets \ No newline at end of file diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/copyfiles.sh b/test/Microsoft.Extensions.SecretManager.Tools.Tests/copyfiles.sh deleted file mode 100755 index a1d6dfe..0000000 --- a/test/Microsoft.Extensions.SecretManager.Tools.Tests/copyfiles.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -if [ -z $1 ]; then - echo "Deleting $1/toolassets" - rm -rf $1/toolassets -fi - -mkdir -p $1/toolassets -echo "Copying ./../src/Microsoft.Extensions.SecretManager.Tools/toolassets/*.targets" -cp ../../src/Microsoft.Extensions.SecretManager.Tools/toolassets/*.targets $1/toolassets - -exit 0 \ No newline at end of file diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/project.json b/test/Microsoft.Extensions.SecretManager.Tools.Tests/project.json deleted file mode 100644 index f0095be..0000000 --- a/test/Microsoft.Extensions.SecretManager.Tools.Tests/project.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk", - "compile": "../Shared/**/*.cs" - }, - "dependencies": { - "dotnet-test-xunit": "2.2.0-preview2-build1029", - "Microsoft.DotNet.InternalAbstractions": "1.0.500-preview2-1-003177", - "Microsoft.Extensions.SecretManager.Tools": "1.0.0-*", - "xunit": "2.2.0-beta3-build3402" - }, - "testRunner": "xunit", - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.1", - "type": "platform" - } - } - } - }, - "scripts": { - "precompile": "copyfiles %compile:OutputDir%" - } -} \ No newline at end of file diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/test.sh b/test/Microsoft.Extensions.SecretManager.Tools.Tests/test.sh deleted file mode 100755 index 31eb5fd..0000000 --- a/test/Microsoft.Extensions.SecretManager.Tools.Tests/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -set -e - -~/.dotnet/dotnet build - -../../.build/dotnet/dotnet exec \ ---depsfile bin/Debug/netcoreapp1.0/Microsoft.Extensions.SecretManager.Tools.Tests.deps.json \ ---runtimeconfig bin/Debug/netcoreapp1.0/Microsoft.Extensions.SecretManager.Tools.Tests.runtimeconfig.json \ -../../.build/dotnet-test-xunit/2.2.0-preview2-build1029/lib/netcoreapp1.0/dotnet-test-xunit.dll \ -bin/Debug/netcoreapp1.0/Microsoft.Extensions.SecretManager.Tools.Tests.dll \ -$@ \ No newline at end of file diff --git a/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj b/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj new file mode 100644 index 0000000..57f7f2c --- /dev/null +++ b/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj @@ -0,0 +1,11 @@ + + + + netcoreapp1.0 + Exe + + + + + + \ No newline at end of file diff --git a/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.xproj b/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.xproj deleted file mode 100644 index fec649a..0000000 --- a/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.xproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - {A24BF1D1-4326-4455-A528-09F1E20EDC83} - {8BB2217D-0F2D-49D1-97BC-3654ED321F3B} - Microsoft.Extensions.Tools.Tests - .\obj - .\bin\ - v4.5.1 - - - - 2.0 - - - diff --git a/test/Microsoft.Extensions.Tools.Tests/project.json b/test/Microsoft.Extensions.Tools.Tests/project.json deleted file mode 100644 index 2696161..0000000 --- a/test/Microsoft.Extensions.Tools.Tests/project.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk", - "compile": "../../src/Shared/**/*.cs" - }, - "dependencies": { - "dotnet-test-xunit": "2.2.0-preview2-build1029", - "Microsoft.DotNet.InternalAbstractions": "1.0.500-preview2-1-003177", - "xunit": "2.2.0-beta3-build3402" - }, - "testRunner": "xunit", - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.1", - "type": "platform" - } - } - } - } -} \ No newline at end of file diff --git a/test/dir.props b/test/dir.props new file mode 100644 index 0000000..1fff509 --- /dev/null +++ b/test/dir.props @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tools/NuGetPackager/NuGetPackager.xproj b/tools/NuGetPackager/NuGetPackager.xproj deleted file mode 100644 index 57c243c..0000000 --- a/tools/NuGetPackager/NuGetPackager.xproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - 14.0.25420 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 8b781d87-1fc3-4a34-9089-2bdf6b562b85 - NuGetPackager - .\obj - .\bin\ - - - - 2.0 - - - \ No newline at end of file diff --git a/tools/NuGetPackager/PackCommand.cs b/tools/NuGetPackager/PackCommand.cs deleted file mode 100644 index 53ecef3..0000000 --- a/tools/NuGetPackager/PackCommand.cs +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.DotNet.Cli.Utils; -using Microsoft.DotNet.ProjectModel; -using Microsoft.DotNet.ProjectModel.Graph; -using Microsoft.DotNet.ProjectModel.Utilities; -using NuGet.Frameworks; -using NuGet.Versioning; - -namespace NuGetPackager -{ - internal class PackCommand - { - private readonly string _baseDir; - - public PackCommand(string baseDir) - { - _baseDir = baseDir; - } - - public async Task PackAsync(string nuspec, string config, string outputDir) - { - var project = ProjectContext.Create(Path.GetDirectoryName(nuspec), FrameworkConstants.CommonFrameworks.NetCoreApp10); - var idx = 0; - var props = ""; - var first = true; - foreach (var depVersion in GetDependencies(project).OrderBy(p => p.Item1).Select(p => p.Item2)) - { - if (first) - { - first = false; - } - else - { - props += ";"; - } - - props += $"dep_{++idx}={depVersion}"; - } - var publishDir = Path.Combine(Directory.GetCurrentDirectory(), "artifacts/build", project.ProjectFile.Name); - if (Directory.Exists(publishDir)) - { - Directory.Delete(publishDir, recursive: true); - } - Directory.CreateDirectory(publishDir); - - var buildCommand = Command.CreateDotNet("publish", - new[] { project.ProjectFile.ProjectFilePath, "--configuration", config, "--output", publishDir }, - configuration: config); - - if (buildCommand.Execute().ExitCode != 0) - { - throw new GracefulException("Build failed"); - } - - Directory.CreateDirectory(outputDir); - - var version = project.ProjectFile.Version.ToNormalizedString(); - await Nuget("pack", - nuspec, - "-Verbosity", "detailed", - "-OutputDirectory", outputDir, - "-Version", version, - "-Properties", props, - "-BasePath", publishDir); - } - - private IEnumerable> GetDependencies(ProjectContext context) - { - // copied from https://github.com/dotnet/cli/blob/da0e365264e0ab555cdde978bdfd2e504bada49a/src/dotnet/commands/dotnet-pack/PackageGenerator.cs - var project = context.RootProject; - - foreach (var dependency in project.Dependencies) - { - if (dependency.Type.Equals(LibraryDependencyType.Build)) - { - continue; - } - - // TODO: Efficiency - var dependencyDescription = context.LibraryManager.GetLibraries().First(l => l.RequestedRanges.Contains(dependency)); - - // REVIEW: Can we get this far with unresolved dependencies - if (!dependencyDescription.Resolved) - { - continue; - } - - if (dependencyDescription.Identity.Type == LibraryType.Project && - ((ProjectDescription)dependencyDescription).Project.EmbedInteropTypes) - { - continue; - } - - VersionRange dependencyVersion = null; - - if (dependency.VersionRange == null || - dependency.VersionRange.IsFloating) - { - dependencyVersion = new VersionRange(dependencyDescription.Identity.Version); - } - else - { - dependencyVersion = dependency.VersionRange; - } - - Reporter.Verbose.WriteLine($"Adding dependency {dependency.Name.Yellow()} {VersionUtility.RenderVersion(dependencyVersion).Yellow()}"); - - yield return new Tuple(dependency.Name, dependencyVersion.MinVersion.ToString()); - } - } - - private static string GetLockFileVersion(ProjectContext project, string name) => - project - .LockFile - .PackageLibraries - .First(l => l.Name.Equals(name)) - .Version - .ToNormalizedString(); - - private async Task Nuget(params string[] args) - { - var pInfo = new ProcessStartInfo - { - Arguments = ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(args), - FileName = await GetNugetExePath() - }; - Console.WriteLine("command: ".Bold().Blue() + pInfo.FileName); - Console.WriteLine("arguments: ".Bold().Blue() + pInfo.Arguments); - - var process = Process.Start(pInfo); - process.WaitForExit(); - - if (process.ExitCode != 0) - { - throw new InvalidOperationException("NuGet exited with non-zero code " + process.ExitCode); - } - } - - private async Task GetNugetExePath() - { - if (Environment.GetEnvironmentVariable("KOREBUILD_NUGET_EXE") != null) - { - return Environment.GetEnvironmentVariable("KOREBUILD_NUGET_EXE"); - } - - var nugetPath = Path.Combine(_baseDir, ".build", "nuget.3.5.0.exe"); - if (File.Exists(nugetPath)) - { - return nugetPath; - } - - Console.WriteLine("log : Downloading nuget.exe 3.5.0"); - - var response = await new HttpClient().GetAsync("https://dist.nuget.org/win-x86-commandline/v3.5.0/NuGet.exe"); - using (var file = new FileStream(nugetPath, FileMode.CreateNew)) - { - response.EnsureSuccessStatusCode(); - await response.Content.LoadIntoBufferAsync(); - await response.Content.CopyToAsync(file); - } - return nugetPath; - } - } -} \ No newline at end of file diff --git a/tools/NuGetPackager/Program.cs b/tools/NuGetPackager/Program.cs deleted file mode 100644 index d73a31a..0000000 --- a/tools/NuGetPackager/Program.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.IO; -using System.Linq; -using Microsoft.Extensions.CommandLineUtils; -using Microsoft.DotNet.Cli.Utils; - -namespace NuGetPackager -{ - /// - /// This replaces the "dotnet-pack" command, which doesn't not yet support "package types" - /// and probably won't in time for the next release. - /// TODO remove this once CLI supports package type - /// - public class Program - { - public static int Main(string[] args) - { - var app = new CommandLineApplication(); - var optOutput = app.Option("-o|--output-dir ", "Output dir", CommandOptionType.SingleValue); - var optConfig = app.Option("-c|--configuration ", "Config", CommandOptionType.SingleValue); - var optsNuspec = app.Option("-n|--nuspec ", "nuspec", CommandOptionType.MultipleValue); - - app.OnExecute(async () => - { - if (!optsNuspec.Values.Any()) - { - Reporter.Error.WriteLine("Missing values for --nuspec"); - return 1; - } - - var config = optConfig.HasValue() - ? optConfig.Value() - : "Debug"; - var output = optOutput.Value() ?? Directory.GetCurrentDirectory(); - - if (!Path.IsPathRooted(output)) - { - output = Path.Combine(Directory.GetCurrentDirectory(), output); - } - - var packer = new PackCommand(Directory.GetCurrentDirectory()); - foreach (var nuspec in optsNuspec.Values) - { - await packer.PackAsync(nuspec, config, output); - } - - return 0; - }); - - return app.Execute(args); - } - } -} \ No newline at end of file diff --git a/tools/NuGetPackager/project.json b/tools/NuGetPackager/project.json deleted file mode 100644 index fe0b398..0000000 --- a/tools/NuGetPackager/project.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "buildOptions": { - "emitEntryPoint": true - }, - - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.0" - }, - "Microsoft.DotNet.ProjectModel": "1.0.0-rc3-003121", - "Microsoft.DotNet.Cli.Utils": "1.0.0-preview2-003121", - "Microsoft.Extensions.CommandLineUtils": "1.0.0" - }, - - "frameworks": { - "netcoreapp1.0": { } - } -} \ No newline at end of file diff --git a/version.props b/version.props new file mode 100644 index 0000000..c7af7a2 --- /dev/null +++ b/version.props @@ -0,0 +1,7 @@ + + + + 1.0.0 + msbuild3 + + \ No newline at end of file