diff --git a/.appveyor.yml b/.appveyor.yml
deleted file mode 100644
index 4eea96ab69..0000000000
--- a/.appveyor.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-init:
-- git config --global core.autocrlf true
-branches:
- only:
- - dev
- - /^release\/.*$/
- - /^(.*\/)?ci-.*$/
-build_script:
-- ps: .\run.ps1 default-build
-clone_depth: 1
-environment:
- global:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
-test: 'off'
-deploy: 'off'
-os: Visual Studio 2017
diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index e2566a262e..0000000000
--- a/.editorconfig
+++ /dev/null
@@ -1,24 +0,0 @@
-# EditorConfig is awesome:http://EditorConfig.org
-
-# top-most EditorConfig file
-root = true
-
-[*]
-indent_style = space
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[*.cs]
-indent_size = 4
-dotnet_sort_system_directives_first = true:warning
-
-# Xml files
-[*.{csproj,config,props,targets,ruleset,config,resx,xml}]
-indent_size = 2
-
-[*.{json, yml}]
-indent_size = 2
-
-[*.{ps1,sh}]
-indent_size = 4
\ No newline at end of file
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index c2f0f84273..0000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,52 +0,0 @@
-*.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
-
-*.jpg binary
-*.png binary
-*.gif binary
-
-*.cs text=auto diff=csharp
-*.vb text=auto
-*.resx text=auto
-*.c text=auto
-*.cpp text=auto
-*.cxx text=auto
-*.h text=auto
-*.hxx text=auto
-*.py text=auto
-*.rb text=auto
-*.java text=auto
-*.html text=auto
-*.htm text=auto
-*.css text=auto
-*.scss text=auto
-*.sass text=auto
-*.less text=auto
-*.js text=auto
-*.lisp text=auto
-*.clj text=auto
-*.sql text=auto
-*.php text=auto
-*.lua text=auto
-*.m text=auto
-*.asm text=auto
-*.erl text=auto
-*.fs text=auto
-*.fsx text=auto
-*.hs text=auto
-
-*.csproj text=auto
-*.vbproj text=auto
-*.fsproj text=auto
-*.dbproj text=auto
-*.sln text=auto eol=crlf
-
-*.sh eol=lf
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 01ed76be4f..0000000000
--- a/.gitignore
+++ /dev/null
@@ -1,37 +0,0 @@
-[Oo]bj/
-[Bb]in/
-TestResults/
-.nuget/
-_ReSharper.*/
-packages/
-artifacts/
-PublishProfiles/
-*.user
-*.suo
-*.cache
-*.docstates
-_ReSharper.*
-nuget.exe
-*net45.csproj
-*net451.csproj
-*k10.csproj
-*.psess
-*.vsp
-*.pidb
-*.userprefs
-*DS_Store
-*.ncrunchsolution
-*.*sdf
-*.ipch
-*.sln.ide
-project.lock.json
-.testPublish/
-.build/
-/.vs/
-.vscode/
-*.nuget.props
-*.nuget.targets
-.idea/
-.dotnet/
-global.json
-*.binlog
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 64bdbb4441..0000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-language: csharp
-sudo: false
-dist: trusty
-env:
- global:
- - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- - DOTNET_CLI_TELEMETRY_OPTOUT: 1
-mono: none
-os:
-- linux
-- osx
-osx_image: xcode8.2
-addons:
- apt:
- packages:
- - libunwind8
-branches:
- only:
- - dev
- - /^release\/.*$/
- - /^(.*\/)?ci-.*$/
-before_install:
-- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s
- /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
- /usr/local/lib/; fi
-script:
-- ./build.sh
diff --git a/.vsts-pipelines/builds/ci-internal.yml b/.vsts-pipelines/builds/ci-internal.yml
deleted file mode 100644
index dc7b8a3cb9..0000000000
--- a/.vsts-pipelines/builds/ci-internal.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-trigger:
-- master
-- release/*
-
-resources:
- repositories:
- - repository: buildtools
- type: git
- name: aspnet-BuildTools
- ref: refs/heads/release/2.2
-
-phases:
-- template: .vsts-pipelines/templates/project-ci.yml@buildtools
diff --git a/.vsts-pipelines/builds/ci-public.yml b/.vsts-pipelines/builds/ci-public.yml
deleted file mode 100644
index f5087d9c30..0000000000
--- a/.vsts-pipelines/builds/ci-public.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-trigger:
-- master
-- release/*
-
-# See https://github.com/aspnet/BuildTools
-resources:
- repositories:
- - repository: buildtools
- type: github
- endpoint: DotNet-Bot GitHub Connection
- name: aspnet/BuildTools
- ref: refs/heads/release/2.2
-
-phases:
-- template: .vsts-pipelines/templates/project-ci.yml@buildtools
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index 64ff041d5c..0000000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,4 +0,0 @@
-Contributing
-======
-
-Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md) in the Home repo.
diff --git a/Directory.Build.props b/Directory.Build.props
deleted file mode 100644
index 80d6cc1543..0000000000
--- a/Directory.Build.props
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
- Microsoft .NET
- https://github.com/aspnet/DotNetTools
- git
- $(MSBuildThisFileDirectory)
- $(MSBuildThisFileDirectory)build\Key.snk
- true
- true
-
-
- false
- $(MSBuildThisFileDirectory)obj\$(MSBuildProjectName)\
- $(MSBuildThisFileDirectory)bin\$(MSBuildProjectName)\
-
-
-
diff --git a/Directory.Build.targets b/Directory.Build.targets
deleted file mode 100644
index 73b97f2807..0000000000
--- a/Directory.Build.targets
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- $(MicrosoftNETCoreApp21PackageVersion)
- $(MicrosoftNETCoreApp22PackageVersion)
- $(NETStandardLibrary20PackageVersion)
-
- 99.9
-
-
diff --git a/DotNetTools.sln b/DotNetTools.sln
deleted file mode 100644
index d996c043b6..0000000000
--- a/DotNetTools.sln
+++ /dev/null
@@ -1,206 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27120.0
-MinimumVisualStudioVersion = 15.0.26730.03
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{66517987-2A5A-4330-B130-207039378FD4}"
- ProjectSection(SolutionItems) = preProject
- src\Directory.Build.props = src\Directory.Build.props
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-watch", "src\dotnet-watch\dotnet-watch.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
- .appveyor.yml = .appveyor.yml
- .editorconfig = .editorconfig
- .gitattributes = .gitattributes
- .gitignore = .gitignore
- .travis.yml = .travis.yml
- build.cmd = build.cmd
- build.ps1 = build.ps1
- build.sh = build.sh
- CONTRIBUTING.md = CONTRIBUTING.md
- build\dependencies.props = build\dependencies.props
- Directory.Build.props = Directory.Build.props
- Directory.Build.targets = Directory.Build.targets
- LICENSE.txt = LICENSE.txt
- NuGet.config = NuGet.config
- NuGetPackageVerifier.json = NuGetPackageVerifier.json
- README.md = README.md
- build\sources.props = build\sources.props
- version.props = version.props
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F5B382BC-258F-46E1-AC3D-10E5CCD55134}"
- ProjectSection(SolutionItems) = preProject
- test\Directory.Build.props = test\Directory.Build.props
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-watch.FunctionalTests", "test\dotnet-watch.FunctionalTests\dotnet-watch.FunctionalTests.csproj", "{16BADE2F-1184-4518-8A70-B68A19D0805B}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-user-secrets", "src\dotnet-user-secrets\dotnet-user-secrets.csproj", "{8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-user-secrets.Tests", "test\dotnet-user-secrets.Tests\dotnet-user-secrets.Tests.csproj", "{7B331122-83B1-4F08-A119-DC846959844C}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-watch.Tests", "test\dotnet-watch.Tests\dotnet-watch.Tests.csproj", "{8A2E6961-6B12-4A8E-8215-3E7301D52EAC}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-sql-cache", "src\dotnet-sql-cache\dotnet-sql-cache.csproj", "{53F3B53D-303A-4DAA-9C38-4F55195FA5B9}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-dev-certs", "src\dotnet-dev-certs\dotnet-dev-certs.csproj", "{4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.SecretManager", "tooling\Microsoft.VisualStudio.SecretManager\Microsoft.VisualStudio.SecretManager.csproj", "{5E117F2E-7152-447F-BF47-59F759EEF3A7}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tooling", "tooling", "{62826851-7D74-4F1E-B7D1-12553B789CD8}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.SecretManager.TestExtension", "tooling\Microsoft.VisualStudio.SecretManager.TestExtension\Microsoft.VisualStudio.SecretManager.TestExtension.csproj", "{965F8820-F809-4081-9090-1AEC903F291B}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.DeveloperCertificates.XPlat", "src\Microsoft.AspNetCore.DeveloperCertificates.XPlat\Microsoft.AspNetCore.DeveloperCertificates.XPlat.csproj", "{96E71881-1465-44F5-B4B7-DF9B370FFD02}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.HttpRepl", "src\Microsoft.HttpRepl\Microsoft.HttpRepl.csproj", "{4725BEAD-34F0-43C1-BF46-7AB16B4DE81D}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Repl", "src\Microsoft.Repl\Microsoft.Repl.csproj", "{EE9A6128-3DE2-4206-A5A4-3ED935084590}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Repl.Tests", "test\Microsoft.Repl.Tests\Microsoft.Repl.Tests.csproj", "{59C2B354-3B5E-40EB-A7BC-74583A5707CA}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.HttpRepl.Tests", "test\Microsoft.HttpRepl.Tests\Microsoft.HttpRepl.Tests.csproj", "{BE7CC4CD-CD76-4211-B593-CAC84407162A}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- DebugNoVSIX|Any CPU = DebugNoVSIX|Any CPU
- Release|Any CPU = Release|Any CPU
- ReleaseNoVSIX|Any CPU = ReleaseNoVSIX|Any CPU
- EndGlobalSection
- 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}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}.DebugNoVSIX|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}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}.ReleaseNoVSIX|Any CPU.Build.0 = Release|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}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {16BADE2F-1184-4518-8A70-B68A19D0805B}.DebugNoVSIX|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}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {16BADE2F-1184-4518-8A70-B68A19D0805B}.ReleaseNoVSIX|Any CPU.Build.0 = Release|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}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}.DebugNoVSIX|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}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}.ReleaseNoVSIX|Any CPU.Build.0 = Release|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}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {7B331122-83B1-4F08-A119-DC846959844C}.DebugNoVSIX|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}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {7B331122-83B1-4F08-A119-DC846959844C}.ReleaseNoVSIX|Any CPU.Build.0 = Release|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}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {8A2E6961-6B12-4A8E-8215-3E7301D52EAC}.DebugNoVSIX|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}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {8A2E6961-6B12-4A8E-8215-3E7301D52EAC}.ReleaseNoVSIX|Any CPU.Build.0 = Release|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}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.DebugNoVSIX|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
- {53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {53F3B53D-303A-4DAA-9C38-4F55195FA5B9}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- {4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}.Release|Any CPU.Build.0 = Release|Any CPU
- {4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- {5E117F2E-7152-447F-BF47-59F759EEF3A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {5E117F2E-7152-447F-BF47-59F759EEF3A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {5E117F2E-7152-447F-BF47-59F759EEF3A7}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {5E117F2E-7152-447F-BF47-59F759EEF3A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {5E117F2E-7152-447F-BF47-59F759EEF3A7}.Release|Any CPU.Build.0 = Release|Any CPU
- {5E117F2E-7152-447F-BF47-59F759EEF3A7}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {965F8820-F809-4081-9090-1AEC903F291B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {965F8820-F809-4081-9090-1AEC903F291B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {965F8820-F809-4081-9090-1AEC903F291B}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {965F8820-F809-4081-9090-1AEC903F291B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {965F8820-F809-4081-9090-1AEC903F291B}.Release|Any CPU.Build.0 = Release|Any CPU
- {965F8820-F809-4081-9090-1AEC903F291B}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {96E71881-1465-44F5-B4B7-DF9B370FFD02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {96E71881-1465-44F5-B4B7-DF9B370FFD02}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {96E71881-1465-44F5-B4B7-DF9B370FFD02}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {96E71881-1465-44F5-B4B7-DF9B370FFD02}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {96E71881-1465-44F5-B4B7-DF9B370FFD02}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {96E71881-1465-44F5-B4B7-DF9B370FFD02}.Release|Any CPU.Build.0 = Release|Any CPU
- {96E71881-1465-44F5-B4B7-DF9B370FFD02}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {96E71881-1465-44F5-B4B7-DF9B370FFD02}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- {4725BEAD-34F0-43C1-BF46-7AB16B4DE81D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4725BEAD-34F0-43C1-BF46-7AB16B4DE81D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4725BEAD-34F0-43C1-BF46-7AB16B4DE81D}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {4725BEAD-34F0-43C1-BF46-7AB16B4DE81D}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {4725BEAD-34F0-43C1-BF46-7AB16B4DE81D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4725BEAD-34F0-43C1-BF46-7AB16B4DE81D}.Release|Any CPU.Build.0 = Release|Any CPU
- {4725BEAD-34F0-43C1-BF46-7AB16B4DE81D}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {4725BEAD-34F0-43C1-BF46-7AB16B4DE81D}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- {EE9A6128-3DE2-4206-A5A4-3ED935084590}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EE9A6128-3DE2-4206-A5A4-3ED935084590}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EE9A6128-3DE2-4206-A5A4-3ED935084590}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {EE9A6128-3DE2-4206-A5A4-3ED935084590}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {EE9A6128-3DE2-4206-A5A4-3ED935084590}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EE9A6128-3DE2-4206-A5A4-3ED935084590}.Release|Any CPU.Build.0 = Release|Any CPU
- {EE9A6128-3DE2-4206-A5A4-3ED935084590}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {EE9A6128-3DE2-4206-A5A4-3ED935084590}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- {59C2B354-3B5E-40EB-A7BC-74583A5707CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {59C2B354-3B5E-40EB-A7BC-74583A5707CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {59C2B354-3B5E-40EB-A7BC-74583A5707CA}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {59C2B354-3B5E-40EB-A7BC-74583A5707CA}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {59C2B354-3B5E-40EB-A7BC-74583A5707CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {59C2B354-3B5E-40EB-A7BC-74583A5707CA}.Release|Any CPU.Build.0 = Release|Any CPU
- {59C2B354-3B5E-40EB-A7BC-74583A5707CA}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {59C2B354-3B5E-40EB-A7BC-74583A5707CA}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- {BE7CC4CD-CD76-4211-B593-CAC84407162A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BE7CC4CD-CD76-4211-B593-CAC84407162A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BE7CC4CD-CD76-4211-B593-CAC84407162A}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {BE7CC4CD-CD76-4211-B593-CAC84407162A}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {BE7CC4CD-CD76-4211-B593-CAC84407162A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BE7CC4CD-CD76-4211-B593-CAC84407162A}.Release|Any CPU.Build.0 = Release|Any CPU
- {BE7CC4CD-CD76-4211-B593-CAC84407162A}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {BE7CC4CD-CD76-4211-B593-CAC84407162A}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {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}
- {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}
- {4FED5119-EE5C-4753-88A4-D61BDEB4D6C8} = {66517987-2A5A-4330-B130-207039378FD4}
- {5E117F2E-7152-447F-BF47-59F759EEF3A7} = {62826851-7D74-4F1E-B7D1-12553B789CD8}
- {965F8820-F809-4081-9090-1AEC903F291B} = {62826851-7D74-4F1E-B7D1-12553B789CD8}
- {96E71881-1465-44F5-B4B7-DF9B370FFD02} = {66517987-2A5A-4330-B130-207039378FD4}
- {4725BEAD-34F0-43C1-BF46-7AB16B4DE81D} = {66517987-2A5A-4330-B130-207039378FD4}
- {EE9A6128-3DE2-4206-A5A4-3ED935084590} = {66517987-2A5A-4330-B130-207039378FD4}
- {59C2B354-3B5E-40EB-A7BC-74583A5707CA} = {F5B382BC-258F-46E1-AC3D-10E5CCD55134}
- {BE7CC4CD-CD76-4211-B593-CAC84407162A} = {F5B382BC-258F-46E1-AC3D-10E5CCD55134}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {57C07F14-2EAC-44FF-A277-B9221B4B2BF7}
- EndGlobalSection
-EndGlobal
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index 7b2956ecee..0000000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Copyright (c) .NET Foundation and Contributors
-
-All rights reserved.
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed
-under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-CONDITIONS OF ANY KIND, either express or implied. See the License for the
-specific language governing permissions and limitations under the License.
diff --git a/NuGet.config b/NuGet.config
deleted file mode 100644
index e32bddfd51..0000000000
--- a/NuGet.config
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/README.md b/README.md
deleted file mode 100644
index 438b665cd8..0000000000
--- a/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-DotNetTools
-===========
-
-[](https://travis-ci.org/aspnet/DotNetTools/branches)
-[](https://ci.appveyor.com/project/aspnetci/DotNetTools/branch/dev)
-
-This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at .
-
-## Projects
-
-The repository contains command-line tools for ASP.NET Core that are bundled* in the [.NET Core CLI](https://github.com/dotnet/cli).
-Follow the links below for more details on each tool.
-
- - [dotnet-watch](src/dotnet-watch/README.md)
- - [dotnet-user-secrets](src/dotnet-user-secrets/README.md)
- - [dotnet-sql-cache](src/dotnet-sql-cache/README.md)
- - [dotnet-dev-certs](src/dotnet-dev-certs/README.md)
-
-*\*This applies to .NET Core CLI 2.1.300-preview2 and up. For earlier versions of the CLI, these tools must be installed separately.*
-
-*For 2.0 CLI and earlier, see for details.*
-
-*For 2.1.300-preview1 CLI, see for details.*
-
-## Usage
-
-The command line tools can be invoked as a subcommand of `dotnet`.
-
-```sh
-dotnet watch
-dotnet user-secrets
-dotnet sql-cache
-dotnet dev-certs
-```
-
-Add `--help` to see more details. For example,
-
-```
-dotnet watch --help
-```
diff --git a/build.cmd b/build.cmd
deleted file mode 100644
index c0050bda12..0000000000
--- a/build.cmd
+++ /dev/null
@@ -1,2 +0,0 @@
-@ECHO OFF
-PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE"
diff --git a/build.sh b/build.sh
deleted file mode 100755
index 98a4b22765..0000000000
--- a/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs)
-chmod +x "$DIR/run.sh"; sync
-"$DIR/run.sh" default-build "$@"
diff --git a/build/Key.snk b/build/Key.snk
deleted file mode 100644
index e10e4889c1..0000000000
Binary files a/build/Key.snk and /dev/null differ
diff --git a/build/VSIX.props b/build/VSIX.props
deleted file mode 100644
index 9640955a99..0000000000
--- a/build/VSIX.props
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/build/VSIX.targets b/build/VSIX.targets
deleted file mode 100644
index a761a9bc13..0000000000
--- a/build/VSIX.targets
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
- false
- $(RestoreDependsOn);RestoreVSIX
- $(PackageDependsOn);PackageVSIX
- $(GetArtifactInfoDependsOn);GetVSIXArtifactInfo
- Microsoft.VisualStudio.SecretManager
- $(RepositoryRoot)tooling\$(VSIXName)\$(VSIXName).csproj
- $(BuildDir)$(VSIXName).vsix
- $(BuildDir)$(VSIXName).json
- $(BuildDir)$(VSIXName).pdb
- shipoob
-
-
-
-
-
-
-
- VsixPackage
- $(PackageVersion)
- $(VSIXArtifactCategory)
- $(VSIXName)
-
-
-
- VsixPackageManifestFile
- $(VSIXArtifactCategory)
- $(VSIXName).vsix
- $(VSIXName)
-
-
-
- SymbolsFile
- $(VSIXArtifactCategory)
- $(VSIXName).vsix
- full
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(LogOutputDir)vsix-restore.rsp
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(LogOutputDir)vsix.log
- $(LogOutputDir)vsix-build.rsp
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/build/dependencies.props b/build/dependencies.props
deleted file mode 100644
index 3be7610a3d..0000000000
--- a/build/dependencies.props
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
-
-
- 2.2.0-preview2-20181026.4
- 2.2.0-rtm-35542
- 2.2.0-rtm-35542
- 2.2.0-rtm-35542
- 2.2.0-rtm-35545
- 2.2.0-rtm-35542
- 2.1.3
- 2.2.0-rtm-27023-02
- 15.9.0
- 5.2.6
- 2.0.3
- 11.0.2
- 4.6.0-rtm-27023-03
- 4.5.0
- 9.0.1
- 2.4.0
- 2.4.0
-
-
-
-
diff --git a/build/repo.props b/build/repo.props
deleted file mode 100644
index 2108954d7e..0000000000
--- a/build/repo.props
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
- Internal.AspNetCore.Universe.Lineup
- 2.2.0-*
- https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json
-
-
-
diff --git a/build/repo.targets b/build/repo.targets
deleted file mode 100644
index 1183428580..0000000000
--- a/build/repo.targets
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
- Configuration=$(Configuration)NoVSIX
-
-
-
diff --git a/build/sources.props b/build/sources.props
deleted file mode 100644
index cada42ba91..0000000000
--- a/build/sources.props
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- $(DotNetRestoreSources)
-
- $(RestoreSources);
- https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;
- https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
- https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json;
- https://vside.myget.org/F/vssdk/api/v3/index.json;
-
-
- $(RestoreSources);
- https://api.nuget.org/v3/index.json;
-
-
-
diff --git a/NuGetPackageVerifier.json b/eng/NuGetPackageVerifier.json
similarity index 95%
rename from NuGetPackageVerifier.json
rename to eng/NuGetPackageVerifier.json
index fb43448889..54e39b2ccd 100644
--- a/NuGetPackageVerifier.json
+++ b/eng/NuGetPackageVerifier.json
@@ -1,41 +1,41 @@
-{
- "adx": {
- "rules": [
- "AdxVerificationCompositeRule"
- ],
- "packages": {
- "dotnet-watch": {
- "packageTypes": [
- "DotnetTool"
- ]
- },
- "dotnet-sql-cache": {
- "packageTypes": [
- "DotnetTool"
- ]
- },
- "dotnet-user-secrets": {
- "packageTypes": [
- "DotnetTool"
- ]
- },
- "dotnet-dev-certs": {
- "packageTypes": [
- "DotnetTool"
- ]
- },
- "Microsoft.AspNetCore.DeveloperCertificates.XPlat": {
- "Exclusions": {
- "DOC_MISSING": {
- "lib/netcoreapp2.2/Microsoft.AspNetCore.DeveloperCertificates.XPlat.dll": "Docs not required to shipoob package"
- }
- }
- }
- }
- },
- "Default": {
- "rules": [
- "DefaultCompositeRule"
- ]
- }
-}
+{
+ "adx": {
+ "rules": [
+ "AdxVerificationCompositeRule"
+ ],
+ "packages": {
+ "dotnet-watch": {
+ "packageTypes": [
+ "DotnetTool"
+ ]
+ },
+ "dotnet-sql-cache": {
+ "packageTypes": [
+ "DotnetTool"
+ ]
+ },
+ "dotnet-user-secrets": {
+ "packageTypes": [
+ "DotnetTool"
+ ]
+ },
+ "dotnet-dev-certs": {
+ "packageTypes": [
+ "DotnetTool"
+ ]
+ },
+ "Microsoft.AspNetCore.DeveloperCertificates.XPlat": {
+ "Exclusions": {
+ "DOC_MISSING": {
+ "lib/netcoreapp2.2/Microsoft.AspNetCore.DeveloperCertificates.XPlat.dll": "Docs not required to shipoob package"
+ }
+ }
+ }
+ }
+ },
+ "Default": {
+ "rules": [
+ "DefaultCompositeRule"
+ ]
+ }
+}
diff --git a/korebuild-lock.txt b/korebuild-lock.txt
deleted file mode 100644
index a60356d3e0..0000000000
--- a/korebuild-lock.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-version:2.2.0-preview2-20181026.4
-commithash:f05a283e6c1eb66ef29a32526f75f8b567a986c9
diff --git a/korebuild.json b/korebuild.json
deleted file mode 100644
index 6cff0cf67e..0000000000
--- a/korebuild.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.2/tools/korebuild.schema.json",
- "channel": "release/2.2",
- "toolsets": {
- "visualstudio": {
- "required": [
- "windows"
- ],
- "includePrerelease": true,
- "versionRange": "[15.0.26730.03, 16.0)",
- "requiredWorkloads": [
- "Microsoft.VisualStudio.Component.VSSDK"
- ]
- }
- }
-}
diff --git a/run.cmd b/run.cmd
deleted file mode 100644
index d52d5c7e68..0000000000
--- a/run.cmd
+++ /dev/null
@@ -1,2 +0,0 @@
-@ECHO OFF
-PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE"
diff --git a/run.ps1 b/run.ps1
deleted file mode 100644
index 2f892843e0..0000000000
--- a/run.ps1
+++ /dev/null
@@ -1,210 +0,0 @@
-#!/usr/bin/env powershell
-#requires -version 4
-
-<#
-.SYNOPSIS
-Executes KoreBuild commands.
-
-.DESCRIPTION
-Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`.
-
-.PARAMETER Command
-The KoreBuild command to run.
-
-.PARAMETER Path
-The folder to build. Defaults to the folder containing this script.
-
-.PARAMETER Channel
-The channel of KoreBuild to download. Overrides the value from the config file.
-
-.PARAMETER DotNetHome
-The directory where .NET Core tools will be stored.
-
-.PARAMETER ToolsSource
-The base url where build tools can be downloaded. Overrides the value from the config file.
-
-.PARAMETER Update
-Updates KoreBuild to the latest version even if a lock file is present.
-
-.PARAMETER Reinstall
-Re-installs KoreBuild
-
-.PARAMETER ConfigFile
-The path to the configuration file that stores values. Defaults to korebuild.json.
-
-.PARAMETER ToolsSourceSuffix
-The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores.
-
-.PARAMETER CI
-Sets up CI specific settings and variables.
-
-.PARAMETER Arguments
-Arguments to be passed to the command
-
-.NOTES
-This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be.
-When the lockfile is not present, KoreBuild will create one using latest available version from $Channel.
-
-The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set
-in the file are overridden by command line parameters.
-
-.EXAMPLE
-Example config file:
-```json
-{
- "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/master/tools/korebuild.schema.json",
- "channel": "master",
- "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools"
-}
-```
-#>
-[CmdletBinding(PositionalBinding = $false)]
-param(
- [Parameter(Mandatory = $true, Position = 0)]
- [string]$Command,
- [string]$Path = $PSScriptRoot,
- [Alias('c')]
- [string]$Channel,
- [Alias('d')]
- [string]$DotNetHome,
- [Alias('s')]
- [string]$ToolsSource,
- [Alias('u')]
- [switch]$Update,
- [switch]$Reinstall,
- [string]$ToolsSourceSuffix,
- [string]$ConfigFile = $null,
- [switch]$CI,
- [Parameter(ValueFromRemainingArguments = $true)]
- [string[]]$Arguments
-)
-
-Set-StrictMode -Version 2
-$ErrorActionPreference = 'Stop'
-
-#
-# Functions
-#
-
-function Get-KoreBuild {
-
- $lockFile = Join-Path $Path 'korebuild-lock.txt'
-
- if (!(Test-Path $lockFile) -or $Update) {
- Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix
- }
-
- $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1
- if (!$version) {
- Write-Error "Failed to parse version from $lockFile. Expected a line that begins with 'version:'"
- }
- $version = $version.TrimStart('version:').Trim()
- $korebuildPath = Join-Paths $DotNetHome ('buildtools', 'korebuild', $version)
-
- if ($Reinstall -and (Test-Path $korebuildPath)) {
- Remove-Item -Force -Recurse $korebuildPath
- }
-
- if (!(Test-Path $korebuildPath)) {
- Write-Host -ForegroundColor Magenta "Downloading KoreBuild $version"
- New-Item -ItemType Directory -Path $korebuildPath | Out-Null
- $remotePath = "$ToolsSource/korebuild/artifacts/$version/korebuild.$version.zip"
-
- try {
- $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip"
- Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix
- if (Get-Command -Name 'Microsoft.PowerShell.Archive\Expand-Archive' -ErrorAction Ignore) {
- # Use built-in commands where possible as they are cross-plat compatible
- Microsoft.PowerShell.Archive\Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath
- }
- else {
- # Fallback to old approach for old installations of PowerShell
- Add-Type -AssemblyName System.IO.Compression.FileSystem
- [System.IO.Compression.ZipFile]::ExtractToDirectory($tmpfile, $korebuildPath)
- }
- }
- catch {
- Remove-Item -Recurse -Force $korebuildPath -ErrorAction Ignore
- throw
- }
- finally {
- Remove-Item $tmpfile -ErrorAction Ignore
- }
- }
-
- return $korebuildPath
-}
-
-function Join-Paths([string]$path, [string[]]$childPaths) {
- $childPaths | ForEach-Object { $path = Join-Path $path $_ }
- return $path
-}
-
-function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) {
- if ($RemotePath -notlike 'http*') {
- Copy-Item $RemotePath $LocalPath
- return
- }
-
- $retries = 10
- while ($retries -gt 0) {
- $retries -= 1
- try {
- Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath
- return
- }
- catch {
- Write-Verbose "Request failed. $retries retries remaining"
- }
- }
-
- Write-Error "Download failed: '$RemotePath'."
-}
-
-#
-# Main
-#
-
-# Load configuration or set defaults
-
-$Path = Resolve-Path $Path
-if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' }
-
-if (Test-Path $ConfigFile) {
- try {
- $config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json
- if ($config) {
- if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel }
- if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource}
- }
- }
- catch {
- Write-Host -ForegroundColor Red $Error[0]
- Write-Error "$ConfigFile contains invalid JSON."
- exit 1
- }
-}
-
-if (!$DotNetHome) {
- $DotNetHome = if ($env:DOTNET_HOME) { $env:DOTNET_HOME } `
- elseif ($CI) { Join-Path $PSScriptRoot '.dotnet' } `
- elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} `
- elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}`
- else { Join-Path $PSScriptRoot '.dotnet'}
-}
-
-if (!$Channel) { $Channel = 'master' }
-if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' }
-
-# Execute
-
-$korebuildPath = Get-KoreBuild
-Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1')
-
-try {
- Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile -CI:$CI
- Invoke-KoreBuildCommand $Command @Arguments
-}
-finally {
- Remove-Module 'KoreBuild' -ErrorAction Ignore
-}
diff --git a/run.sh b/run.sh
deleted file mode 100755
index 129b0b9576..0000000000
--- a/run.sh
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-#
-# variables
-#
-
-RESET="\033[0m"
-RED="\033[0;31m"
-YELLOW="\033[0;33m"
-MAGENTA="\033[0;95m"
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-verbose=false
-update=false
-reinstall=false
-repo_path="$DIR"
-channel=''
-tools_source=''
-tools_source_suffix=''
-ci=false
-
-#
-# Functions
-#
-__usage() {
- echo "Usage: $(basename "${BASH_SOURCE[0]}") command [options] [[--] ...]"
- echo ""
- echo "Arguments:"
- echo " command The command to be run."
- echo " ... Arguments passed to the command. Variable number of arguments allowed."
- echo ""
- echo "Options:"
- echo " --verbose Show verbose output."
- echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.."
- echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json."
- echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet."
- echo " --path The directory to build. Defaults to the directory containing the script."
- echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file."
- echo " --tools-source-suffix|-ToolsSourceSuffix The suffix to append to tools-source. Useful for query strings."
- echo " -u|--update Update to the latest KoreBuild even if the lock file is present."
- echo " --reinstall Reinstall KoreBuild."
- echo " --ci Apply CI specific settings and environment variables."
- echo ""
- echo "Description:"
- echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be."
- echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel."
-
- if [[ "${1:-}" != '--no-exit' ]]; then
- exit 2
- fi
-}
-
-get_korebuild() {
- local version
- local lock_file="$repo_path/korebuild-lock.txt"
- if [ ! -f "$lock_file" ] || [ "$update" = true ]; then
- __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix"
- fi
- version="$(grep 'version:*' -m 1 "$lock_file")"
- if [[ "$version" == '' ]]; then
- __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'"
- return 1
- fi
- version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
- local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version"
-
- if [ "$reinstall" = true ] && [ -d "$korebuild_path" ]; then
- rm -rf "$korebuild_path"
- fi
-
- {
- if [ ! -d "$korebuild_path" ]; then
- mkdir -p "$korebuild_path"
- local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip"
- tmpfile="$(mktemp)"
- echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}"
- if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then
- unzip -q -d "$korebuild_path" "$tmpfile"
- fi
- rm "$tmpfile" || true
- fi
-
- source "$korebuild_path/KoreBuild.sh"
- } || {
- if [ -d "$korebuild_path" ]; then
- echo "Cleaning up after failed installation"
- rm -rf "$korebuild_path" || true
- fi
- return 1
- }
-}
-
-__error() {
- echo -e "${RED}error: $*${RESET}" 1>&2
-}
-
-__warn() {
- echo -e "${YELLOW}warning: $*${RESET}"
-}
-
-__machine_has() {
- hash "$1" > /dev/null 2>&1
- return $?
-}
-
-__get_remote_file() {
- local remote_path=$1
- local local_path=$2
- local remote_path_suffix=$3
-
- if [[ "$remote_path" != 'http'* ]]; then
- cp "$remote_path" "$local_path"
- return 0
- fi
-
- local failed=false
- if __machine_has wget; then
- wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true
- else
- failed=true
- fi
-
- if [ "$failed" = true ] && __machine_has curl; then
- failed=false
- curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true
- fi
-
- if [ "$failed" = true ]; then
- __error "Download failed: $remote_path" 1>&2
- return 1
- fi
-}
-
-#
-# main
-#
-
-command="${1:-}"
-shift
-
-while [[ $# -gt 0 ]]; do
- case $1 in
- -\?|-h|--help)
- __usage --no-exit
- exit 0
- ;;
- -c|--channel|-Channel)
- shift
- channel="${1:-}"
- [ -z "$channel" ] && __usage
- ;;
- --config-file|-ConfigFile)
- shift
- config_file="${1:-}"
- [ -z "$config_file" ] && __usage
- if [ ! -f "$config_file" ]; then
- __error "Invalid value for --config-file. $config_file does not exist."
- exit 1
- fi
- ;;
- -d|--dotnet-home|-DotNetHome)
- shift
- DOTNET_HOME="${1:-}"
- [ -z "$DOTNET_HOME" ] && __usage
- ;;
- --path|-Path)
- shift
- repo_path="${1:-}"
- [ -z "$repo_path" ] && __usage
- ;;
- -s|--tools-source|-ToolsSource)
- shift
- tools_source="${1:-}"
- [ -z "$tools_source" ] && __usage
- ;;
- --tools-source-suffix|-ToolsSourceSuffix)
- shift
- tools_source_suffix="${1:-}"
- [ -z "$tools_source_suffix" ] && __usage
- ;;
- -u|--update|-Update)
- update=true
- ;;
- --reinstall|-[Rr]einstall)
- reinstall=true
- ;;
- --ci|-[Cc][Ii])
- ci=true
- if [[ -z "${DOTNET_HOME:-}" ]]; then
- DOTNET_HOME="$DIR/.dotnet"
- fi
- ;;
- --verbose|-Verbose)
- verbose=true
- ;;
- --)
- shift
- break
- ;;
- *)
- break
- ;;
- esac
- shift
-done
-
-if ! __machine_has unzip; then
- __error 'Missing required command: unzip'
- exit 1
-fi
-
-if ! __machine_has curl && ! __machine_has wget; then
- __error 'Missing required command. Either wget or curl is required.'
- exit 1
-fi
-
-[ -z "${config_file:-}" ] && config_file="$repo_path/korebuild.json"
-if [ -f "$config_file" ]; then
- if __machine_has jq ; then
- if jq '.' "$config_file" >/dev/null ; then
- config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")"
- config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")"
- else
- __error "$config_file contains invalid JSON."
- exit 1
- fi
- elif __machine_has python ; then
- if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then
- config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
- config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
- else
- __error "$config_file contains invalid JSON."
- exit 1
- fi
- elif __machine_has python3 ; then
- if python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then
- config_channel="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
- config_tools_source="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
- else
- __error "$config_file contains invalid JSON."
- exit 1
- fi
- else
- __error 'Missing required command: jq or python. Could not parse the JSON file.'
- exit 1
- fi
-
- [ ! -z "${config_channel:-}" ] && channel="$config_channel"
- [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source"
-fi
-
-[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet"
-[ -z "$channel" ] && channel='master'
-[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools'
-
-get_korebuild
-set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" "$ci"
-invoke_korebuild_command "$command" "$@"
diff --git a/samples/dotnet-watch/Directory.Build.props b/samples/dotnet-watch/Directory.Build.props
deleted file mode 100644
index 76c9003a6b..0000000000
--- a/samples/dotnet-watch/Directory.Build.props
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/samples/dotnet-watch/Directory.Build.targets b/samples/dotnet-watch/Directory.Build.targets
deleted file mode 100644
index 76c9003a6b..0000000000
--- a/samples/dotnet-watch/Directory.Build.targets
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj b/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj
deleted file mode 100644
index 1609403042..0000000000
--- a/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- netcoreapp2.2
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/dotnet-watch/LaunchAnyCommand/README.md b/samples/dotnet-watch/LaunchAnyCommand/README.md
deleted file mode 100644
index fa52f4073e..0000000000
--- a/samples/dotnet-watch/LaunchAnyCommand/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-Launch any command with dotnet-watch
-====================================
-
-## Prerequisites
-
-1. Install .NET Core command line.
-2. Install NodeJS.
-
-## Usage
-
-Open a terminal to the directory containing this project.
-
-```
-dotnet watch msbuild /t:RunMyNpmCommand
-```
-
-Changing the .csproj file, or the say-hello.js file will cause dotnet-watch to re-run the 'RunMyNpmCommand' target in MyApp.csproj.
diff --git a/samples/dotnet-watch/LaunchAnyCommand/package.json b/samples/dotnet-watch/LaunchAnyCommand/package.json
deleted file mode 100644
index 61e25fb082..0000000000
--- a/samples/dotnet-watch/LaunchAnyCommand/package.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "name": "any-command",
- "version": "0.0.0",
- "private": true,
- "scripts": {
- "custom": "node say-hello.js"
- }
-}
diff --git a/samples/dotnet-watch/LaunchAnyCommand/say-hello.js b/samples/dotnet-watch/LaunchAnyCommand/say-hello.js
deleted file mode 100644
index c35728f5a1..0000000000
--- a/samples/dotnet-watch/LaunchAnyCommand/say-hello.js
+++ /dev/null
@@ -1 +0,0 @@
-console.log("Hello from Javascript");
diff --git a/samples/dotnet-watch/README.md b/samples/dotnet-watch/README.md
deleted file mode 100644
index 5988ab77ba..0000000000
--- a/samples/dotnet-watch/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-dotnet-watch samples
-====================
-
-The samples in this folder show some ways to customize dotnet-watch. For full details on
-available settings and configuration, see the [README for the dotnet-watch](../../src/dotnet-watch/README.md) project.
diff --git a/samples/dotnet-watch/WatchJavascriptFiles/Program.cs b/samples/dotnet-watch/WatchJavascriptFiles/Program.cs
deleted file mode 100755
index f71a9e073d..0000000000
--- a/samples/dotnet-watch/WatchJavascriptFiles/Program.cs
+++ /dev/null
@@ -1,28 +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 Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
-
-namespace WatchJavascriptFiles
-{
- public class Program
- {
- public static void Main(string[] args)
- {
- var host = new WebHostBuilder()
- .UseKestrel()
- .UseContentRoot(Directory.GetCurrentDirectory())
- .Configure(app =>
- app.Run(async (context) =>
- {
- await context.Response.WriteAsync("Hello World!");
- }))
- .Build();
-
- host.Run();
- }
- }
-}
diff --git a/samples/dotnet-watch/WatchJavascriptFiles/README.md b/samples/dotnet-watch/WatchJavascriptFiles/README.md
deleted file mode 100644
index 3b0a148cd0..0000000000
--- a/samples/dotnet-watch/WatchJavascriptFiles/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-Watch JavaScript files with dotnet-watch
-========================================
-
-## Prerequisites
-
-Install .NET Core command line.
-
-## Usage
-
-Open a terminal to the directory containing this project.
-
-```
-dotnet watch run
-```
-
-Changing the .csproj file, or \*.js file in wwwroot, or any \*.cs file will cause dotnet-watch to restart the website.
diff --git a/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj b/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj
deleted file mode 100755
index 0c0cac78f3..0000000000
--- a/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
- netcoreapp2.2
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/dotnet-watch/WatchJavascriptFiles/wwwroot/app.js b/samples/dotnet-watch/WatchJavascriptFiles/wwwroot/app.js
deleted file mode 100644
index a94cbdc370..0000000000
--- a/samples/dotnet-watch/WatchJavascriptFiles/wwwroot/app.js
+++ /dev/null
@@ -1 +0,0 @@
-document.title = "My awesome website";
diff --git a/samples/dotnet-watch/WatchMultipleProjects/README.md b/samples/dotnet-watch/WatchMultipleProjects/README.md
deleted file mode 100644
index 46d7a7904c..0000000000
--- a/samples/dotnet-watch/WatchMultipleProjects/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-Watch multiple projects with dotnet-watch
-=========================================
-
-## Prerequisites
-
-Install .NET Core command line.
-
-## Usage
-
-Open a terminal to the directory containing this project.
-
-```
-dotnet watch msbuild /t:TestAndRun
-```
-
-The "TestAndRun" target in watch.proj will execute "dotnet test" on Test.csproj and then launch the website by calling "dotnet run" on Web.csproj.
-
-Changing any \*.cs file in Test/ or Web/, any \*.csproj file, or watch.proj, will cause dotnet-watch to relaunch the "TestAndRun" target from watch.proj.
diff --git a/samples/dotnet-watch/WatchMultipleProjects/Test/Test.csproj b/samples/dotnet-watch/WatchMultipleProjects/Test/Test.csproj
deleted file mode 100755
index 0559578c32..0000000000
--- a/samples/dotnet-watch/WatchMultipleProjects/Test/Test.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- netcoreapp2.2
-
-
-
-
-
-
-
-
-
diff --git a/samples/dotnet-watch/WatchMultipleProjects/Test/UnitTest1.cs b/samples/dotnet-watch/WatchMultipleProjects/Test/UnitTest1.cs
deleted file mode 100755
index 0da9a7f234..0000000000
--- a/samples/dotnet-watch/WatchMultipleProjects/Test/UnitTest1.cs
+++ /dev/null
@@ -1,17 +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 Xunit;
-
-namespace Test
-{
- public class UnitTest1
- {
- [Fact]
- public void Test1()
- {
- Assert.True(true);
- }
- }
-}
diff --git a/samples/dotnet-watch/WatchMultipleProjects/Web/Program.cs b/samples/dotnet-watch/WatchMultipleProjects/Web/Program.cs
deleted file mode 100755
index 6a02b1f332..0000000000
--- a/samples/dotnet-watch/WatchMultipleProjects/Web/Program.cs
+++ /dev/null
@@ -1,28 +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 Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
-
-namespace Web
-{
- public class Program
- {
- public static void Main(string[] args)
- {
- var host = new WebHostBuilder()
- .UseKestrel()
- .UseContentRoot(Directory.GetCurrentDirectory())
- .Configure(app =>
- app.Run(async (context) =>
- {
- await context.Response.WriteAsync("Hello World!");
- }))
- .Build();
-
- host.Run();
- }
- }
-}
diff --git a/samples/dotnet-watch/WatchMultipleProjects/Web/Web.csproj b/samples/dotnet-watch/WatchMultipleProjects/Web/Web.csproj
deleted file mode 100755
index 616246b199..0000000000
--- a/samples/dotnet-watch/WatchMultipleProjects/Web/Web.csproj
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- netcoreapp2.2
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/dotnet-watch/WatchMultipleProjects/watch.csproj b/samples/dotnet-watch/WatchMultipleProjects/watch.csproj
deleted file mode 100644
index 5ca4ee2379..0000000000
--- a/samples/dotnet-watch/WatchMultipleProjects/watch.csproj
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- netcoreapp2.2
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
deleted file mode 100644
index 4b89a431e7..0000000000
--- a/src/Directory.Build.props
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets
deleted file mode 100644
index c7b5f24861..0000000000
--- a/src/Directory.Build.targets
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/Microsoft.HttpRepl/AggregateDirectoryStructure.cs b/src/Microsoft.HttpRepl/AggregateDirectoryStructure.cs
deleted file mode 100644
index 19dcb289f8..0000000000
--- a/src/Microsoft.HttpRepl/AggregateDirectoryStructure.cs
+++ /dev/null
@@ -1,41 +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.Linq;
-
-namespace Microsoft.HttpRepl
-{
- public class AggregateDirectoryStructure : IDirectoryStructure
- {
- private readonly IDirectoryStructure _first;
- private readonly IDirectoryStructure _second;
-
- public AggregateDirectoryStructure(IDirectoryStructure first, IDirectoryStructure second)
- {
- _first = first;
- _second = second;
- }
-
- public IEnumerable DirectoryNames
- {
- get
- {
- HashSet values = new HashSet(StringComparer.OrdinalIgnoreCase);
- values.UnionWith(_first.DirectoryNames);
- values.UnionWith(_second.DirectoryNames);
- return values.OrderBy(x => x, StringComparer.OrdinalIgnoreCase);
- }
- }
-
- public IDirectoryStructure Parent => _first.Parent ?? _second.Parent;
-
- public IDirectoryStructure GetChildDirectory(string name)
- {
- return new AggregateDirectoryStructure(_first.GetChildDirectory(name), _second.GetChildDirectory(name));
- }
-
- public IRequestInfo RequestInfo => _first.RequestInfo ?? _second.RequestInfo;
- }
-}
diff --git a/src/Microsoft.HttpRepl/Commands/BaseHttpCommand.cs b/src/Microsoft.HttpRepl/Commands/BaseHttpCommand.cs
deleted file mode 100644
index 30191306e4..0000000000
--- a/src/Microsoft.HttpRepl/Commands/BaseHttpCommand.cs
+++ /dev/null
@@ -1,611 +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.Net.Http.Headers;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using Microsoft.HttpRepl.Formatting;
-using Microsoft.HttpRepl.Preferences;
-using Microsoft.HttpRepl.Suggestions;
-using Microsoft.Repl;
-using Microsoft.Repl.Commanding;
-using Microsoft.Repl.ConsoleHandling;
-using Microsoft.Repl.Parsing;
-using Microsoft.Repl.Suggestions;
-using Newtonsoft.Json.Linq;
-
-namespace Microsoft.HttpRepl.Commands
-{
- public abstract class BaseHttpCommand : CommandWithStructuredInputBase
- {
- private const string HeaderOption = nameof(HeaderOption);
- private const string ResponseHeadersFileOption = nameof(ResponseHeadersFileOption);
- private const string ResponseBodyFileOption = nameof(ResponseBodyFileOption);
- private const string ResponseFileOption = nameof(ResponseFileOption);
- private const string BodyFileOption = nameof(BodyFileOption);
- private const string NoBodyOption = nameof(NoBodyOption);
- private const string NoFormattingOption = nameof(NoFormattingOption);
- private const string StreamingOption = nameof(StreamingOption);
- private const string BodyContentOption = nameof(BodyContentOption);
- private static readonly char[] HeaderSeparatorChars = new[] { '=', ':' };
-
- private CommandInputSpecification _inputSpec;
-
- protected abstract string Verb { get; }
-
- protected abstract bool RequiresBody { get; }
-
- public override CommandInputSpecification InputSpec
- {
- get
- {
- if (_inputSpec != null)
- {
- return _inputSpec;
- }
-
- CommandInputSpecificationBuilder builder = CommandInputSpecification.Create(Verb)
- .MaximumArgCount(1)
- .WithOption(new CommandOptionSpecification(HeaderOption, requiresValue: true, forms: new[] {"--header", "-h"}))
- .WithOption(new CommandOptionSpecification(ResponseFileOption, requiresValue: true, maximumOccurrences: 1, forms: new[] { "--response", }))
- .WithOption(new CommandOptionSpecification(ResponseHeadersFileOption, requiresValue: true, maximumOccurrences: 1, forms: new[] { "--response:headers", }))
- .WithOption(new CommandOptionSpecification(ResponseBodyFileOption, requiresValue: true, maximumOccurrences: 1, forms: new[] { "--response:body", }))
- .WithOption(new CommandOptionSpecification(NoFormattingOption, maximumOccurrences: 1, forms: new[] { "--no-formatting", "-F" }))
- .WithOption(new CommandOptionSpecification(StreamingOption, maximumOccurrences: 1, forms: new[] { "--streaming", "-s" }));
-
- if (RequiresBody)
- {
- builder = builder.WithOption(new CommandOptionSpecification(NoBodyOption, maximumOccurrences: 1, forms: "--no-body"))
- .WithOption(new CommandOptionSpecification(BodyFileOption, requiresValue: true, maximumOccurrences: 1, forms: new[] {"--file", "-f"}))
- .WithOption(new CommandOptionSpecification(BodyContentOption, requiresValue: true, maximumOccurrences: 1, forms: new[] {"--content", "-c"}));
- }
-
- _inputSpec = builder.Finish();
- return _inputSpec;
- }
- }
-
- protected override async Task ExecuteAsync(IShellState shellState, HttpState programState, DefaultCommandInput commandInput, ICoreParseResult parseResult, CancellationToken cancellationToken)
- {
- if (programState.BaseAddress == null && (commandInput.Arguments.Count == 0 || !Uri.TryCreate(commandInput.Arguments[0].Text, UriKind.Absolute, out Uri _)))
- {
- shellState.ConsoleManager.Error.WriteLine("'set base {url}' must be called before issuing requests to a relative path".SetColor(programState.ErrorColor));
- return;
- }
-
- if (programState.SwaggerEndpoint != null)
- {
- string swaggerRequeryBehaviorSetting = programState.GetStringPreference(WellKnownPreference.SwaggerRequeryBehavior, "auto");
-
- if (swaggerRequeryBehaviorSetting.StartsWith("auto", StringComparison.OrdinalIgnoreCase))
- {
- await SetSwaggerCommand.CreateDirectoryStructureForSwaggerEndpointAsync(shellState, programState, programState.SwaggerEndpoint, cancellationToken).ConfigureAwait(false);
- }
- }
-
- Dictionary thisRequestHeaders = new Dictionary();
-
- foreach (InputElement header in commandInput.Options[HeaderOption])
- {
- int equalsIndex = header.Text.IndexOfAny(HeaderSeparatorChars);
-
- if (equalsIndex < 0)
- {
- shellState.ConsoleManager.Error.WriteLine("Headers must be formatted as {header}={value} or {header}:{value}".SetColor(programState.ErrorColor));
- return;
- }
-
- thisRequestHeaders[header.Text.Substring(0, equalsIndex)] = header.Text.Substring(equalsIndex + 1);
- }
-
- Uri effectivePath = programState.GetEffectivePath(commandInput.Arguments.Count > 0 ? commandInput.Arguments[0].Text : string.Empty);
- HttpRequestMessage request = new HttpRequestMessage(new HttpMethod(Verb.ToUpperInvariant()), effectivePath);
- bool noBody = false;
-
- if (RequiresBody)
- {
- string filePath = null;
- string bodyContent = null;
- bool deleteFile = false;
- noBody = commandInput.Options[NoBodyOption].Count > 0;
-
- if (!thisRequestHeaders.TryGetValue("content-type", out string contentType) && programState.Headers.TryGetValue("content-type", out IEnumerable contentTypes))
- {
- contentType = contentTypes.FirstOrDefault();
- }
-
- if (!noBody)
- {
- if (string.IsNullOrEmpty(contentType))
- {
- contentType = "application/json";
- }
-
- if (commandInput.Options[BodyFileOption].Count > 0)
- {
- filePath = commandInput.Options[BodyFileOption][0].Text;
-
- if (!File.Exists(filePath))
- {
- shellState.ConsoleManager.Error.WriteLine($"Content file {filePath} does not exist".SetColor(programState.ErrorColor));
- return;
- }
- }
- else if (commandInput.Options[BodyContentOption].Count > 0)
- {
- bodyContent = commandInput.Options[BodyContentOption][0].Text;
- }
- else
- {
- string defaultEditorCommand = programState.GetStringPreference(WellKnownPreference.DefaultEditorCommand);
- if (defaultEditorCommand == null)
- {
- shellState.ConsoleManager.Error.WriteLine($"The default editor must be configured using the command `pref set {WellKnownPreference.DefaultEditorCommand} \"{{commandline}}\"`".SetColor(programState.ErrorColor));
- return;
- }
-
- deleteFile = true;
- filePath = Path.GetTempFileName();
-
- string exampleBody = programState.GetExampleBody(commandInput.Arguments.Count > 0 ? commandInput.Arguments[0].Text : string.Empty, ref contentType, Verb);
-
- if (!string.IsNullOrEmpty(exampleBody))
- {
- File.WriteAllText(filePath, exampleBody);
- }
-
- string defaultEditorArguments = programState.GetStringPreference(WellKnownPreference.DefaultEditorArguments) ?? "";
- string original = defaultEditorArguments;
- string pathString = $"\"{filePath}\"";
-
- defaultEditorArguments = defaultEditorArguments.Replace("{filename}", pathString);
-
- if (string.Equals(defaultEditorArguments, original, StringComparison.Ordinal))
- {
- defaultEditorArguments = (defaultEditorArguments + " " + pathString).Trim();
- }
-
- ProcessStartInfo info = new ProcessStartInfo(defaultEditorCommand, defaultEditorArguments);
-
- Process.Start(info)?.WaitForExit();
- }
- }
-
- if (string.IsNullOrEmpty(contentType))
- {
- contentType = "application/json";
- }
-
- byte[] data = noBody
- ? new byte[0]
- : string.IsNullOrEmpty(bodyContent)
- ? File.ReadAllBytes(filePath)
- : Encoding.UTF8.GetBytes(bodyContent);
-
- HttpContent content = new ByteArrayContent(data);
- content.Headers.ContentType = new MediaTypeHeaderValue(contentType);
- request.Content = content;
-
- if (deleteFile)
- {
- File.Delete(filePath);
- }
-
- foreach (KeyValuePair> header in programState.Headers)
- {
- content.Headers.TryAddWithoutValidation(header.Key, header.Value);
- }
-
- foreach (KeyValuePair header in thisRequestHeaders)
- {
- content.Headers.TryAddWithoutValidation(header.Key, header.Value);
- }
- }
-
- foreach (KeyValuePair> header in programState.Headers)
- {
- request.Headers.TryAddWithoutValidation(header.Key, header.Value);
- }
-
- foreach (KeyValuePair header in thisRequestHeaders)
- {
- request.Headers.TryAddWithoutValidation(header.Key, header.Value);
- }
-
- string headersTarget = commandInput.Options[ResponseHeadersFileOption].FirstOrDefault()?.Text ?? commandInput.Options[ResponseFileOption].FirstOrDefault()?.Text;
- string bodyTarget = commandInput.Options[ResponseBodyFileOption].FirstOrDefault()?.Text ?? commandInput.Options[ResponseFileOption].FirstOrDefault()?.Text;
-
- HttpResponseMessage response = await programState.Client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
- await HandleResponseAsync(programState, commandInput, shellState.ConsoleManager, response, programState.EchoRequest, headersTarget, bodyTarget, cancellationToken).ConfigureAwait(false);
- }
-
- private static async Task HandleResponseAsync(HttpState programState, DefaultCommandInput commandInput, IConsoleManager consoleManager, HttpResponseMessage response, bool echoRequest, string headersTargetFile, string bodyTargetFile, CancellationToken cancellationToken)
- {
- RequestConfig requestConfig = new RequestConfig(programState);
- ResponseConfig responseConfig = new ResponseConfig(programState);
- string protocolInfo;
-
- if (echoRequest)
- {
- string hostString = response.RequestMessage.RequestUri.Scheme + "://" + response.RequestMessage.RequestUri.Host + (!response.RequestMessage.RequestUri.IsDefaultPort ? ":" + response.RequestMessage.RequestUri.Port : "");
- consoleManager.WriteLine($"Request to {hostString}...".SetColor(requestConfig.AddressColor));
- consoleManager.WriteLine();
-
- string method = response.RequestMessage.Method.ToString().ToUpperInvariant().SetColor(requestConfig.MethodColor);
- string pathAndQuery = response.RequestMessage.RequestUri.PathAndQuery.SetColor(requestConfig.AddressColor);
- protocolInfo = $"{"HTTP".SetColor(requestConfig.ProtocolNameColor)}{"/".SetColor(requestConfig.ProtocolSeparatorColor)}{response.Version.ToString().SetColor(requestConfig.ProtocolVersionColor)}";
-
- consoleManager.WriteLine($"{method} {pathAndQuery} {protocolInfo}");
- IEnumerable>> requestHeaders = response.RequestMessage.Headers;
-
- if (response.RequestMessage.Content != null)
- {
- requestHeaders = requestHeaders.Union(response.RequestMessage.Content.Headers);
- }
-
- foreach (KeyValuePair> header in requestHeaders.OrderBy(x => x.Key))
- {
- string headerKey = header.Key.SetColor(requestConfig.HeaderKeyColor);
- string headerSep = ":".SetColor(requestConfig.HeaderSeparatorColor);
- string headerValue = string.Join(";".SetColor(requestConfig.HeaderValueSeparatorColor), header.Value.Select(x => x.Trim().SetColor(requestConfig.HeaderValueColor)));
- consoleManager.WriteLine($"{headerKey}{headerSep} {headerValue}");
- }
-
- consoleManager.WriteLine();
-
- if (response.RequestMessage.Content != null)
- {
- using (StreamWriter writer = new StreamWriter(new MemoryStream()))
- {
- await FormatBodyAsync(commandInput, programState, consoleManager, response.RequestMessage.Content, writer, cancellationToken).ConfigureAwait(false);
- }
- }
-
- consoleManager.WriteLine();
- consoleManager.WriteLine($"Response from {hostString}...".SetColor(requestConfig.AddressColor));
- consoleManager.WriteLine();
- }
-
- protocolInfo = $"{"HTTP".SetColor(responseConfig.ProtocolNameColor)}{"/".SetColor(responseConfig.ProtocolSeparatorColor)}{response.Version.ToString().SetColor(responseConfig.ProtocolVersionColor)}";
- string status = ((int)response.StatusCode).ToString().SetColor(responseConfig.StatusCodeColor) + " " + response.ReasonPhrase.SetColor(responseConfig.StatusReasonPhraseColor);
-
- consoleManager.WriteLine($"{protocolInfo} {status}");
-
- IEnumerable>> responseHeaders = response.Headers;
-
- if (response.Content != null)
- {
- responseHeaders = responseHeaders.Union(response.Content.Headers);
- }
-
- StreamWriter headerFileWriter;
-
- if (headersTargetFile != null)
- {
- headerFileWriter = new StreamWriter(File.Create(headersTargetFile));
- }
- else
- {
- headerFileWriter = new StreamWriter(new MemoryStream());
- }
-
- foreach (KeyValuePair> header in responseHeaders.OrderBy(x => x.Key))
- {
- string headerKey = header.Key.SetColor(responseConfig.HeaderKeyColor);
- string headerSep = ":".SetColor(responseConfig.HeaderSeparatorColor);
- string headerValue = string.Join(";".SetColor(responseConfig.HeaderValueSeparatorColor), header.Value.Select(x => x.Trim().SetColor(responseConfig.HeaderValueColor)));
- consoleManager.WriteLine($"{headerKey}{headerSep} {headerValue}");
- headerFileWriter.WriteLine($"{header.Key}: {string.Join(";", header.Value.Select(x => x.Trim()))}");
- }
-
- StreamWriter bodyFileWriter;
- if (!string.Equals(headersTargetFile, bodyTargetFile, StringComparison.Ordinal))
- {
- headerFileWriter.Flush();
- headerFileWriter.Close();
- headerFileWriter.Dispose();
-
- if (bodyTargetFile != null)
- {
- bodyFileWriter = new StreamWriter(File.Create(bodyTargetFile));
- }
- else
- {
- bodyFileWriter = new StreamWriter(new MemoryStream());
- }
- }
- else
- {
- headerFileWriter.WriteLine();
- bodyFileWriter = headerFileWriter;
- }
-
- consoleManager.WriteLine();
-
- if (response.Content != null)
- {
- await FormatBodyAsync(commandInput, programState, consoleManager, response.Content, bodyFileWriter, cancellationToken).ConfigureAwait(false);
- }
-
- bodyFileWriter.Flush();
- bodyFileWriter.Close();
- bodyFileWriter.Dispose();
-
- consoleManager.WriteLine();
- }
-
- private static async Task FormatBodyAsync(DefaultCommandInput commandInput, HttpState programState, IConsoleManager consoleManager, HttpContent content, StreamWriter bodyFileWriter, CancellationToken cancellationToken)
- {
- if (commandInput.Options[StreamingOption].Count > 0)
- {
- Memory buffer = new Memory(new char[2048]);
- Stream s = await content.ReadAsStreamAsync().ConfigureAwait(false);
- StreamReader reader = new StreamReader(s);
- consoleManager.WriteLine("Streaming the response, press any key to stop...".SetColor(programState.WarningColor));
-
- while (!cancellationToken.IsCancellationRequested)
- {
- try
- {
- ValueTask readTask = reader.ReadAsync(buffer, cancellationToken);
- if (await WaitForCompletionAsync(readTask, cancellationToken).ConfigureAwait(false))
- {
- if (readTask.Result == 0)
- {
- break;
- }
-
- string str = new string(buffer.Span.Slice(0, readTask.Result));
- consoleManager.Write(str);
- bodyFileWriter.Write(str);
- }
- else
- {
- break;
- }
- }
- catch (OperationCanceledException)
- {
- }
- }
-
- return;
- }
-
- string contentType = null;
- if (content.Headers.TryGetValues("Content-Type", out IEnumerable contentTypeValues))
- {
- contentType = contentTypeValues.FirstOrDefault()?.Split(';').FirstOrDefault();
- }
-
- contentType = contentType?.ToUpperInvariant() ?? "text/plain";
-
- if (commandInput.Options[NoFormattingOption].Count == 0)
- {
- if (contentType.EndsWith("/JSON", StringComparison.OrdinalIgnoreCase)
- || contentType.EndsWith("-JSON", StringComparison.OrdinalIgnoreCase)
- || contentType.EndsWith("+JSON", StringComparison.OrdinalIgnoreCase)
- || contentType.EndsWith("/JAVASCRIPT", StringComparison.OrdinalIgnoreCase)
- || contentType.EndsWith("-JAVASCRIPT", StringComparison.OrdinalIgnoreCase)
- || contentType.EndsWith("+JAVASCRIPT", StringComparison.OrdinalIgnoreCase))
- {
- if (await FormatJsonAsync(programState, consoleManager, content, bodyFileWriter))
- {
- return;
- }
- }
- else if (contentType.EndsWith("/HTML", StringComparison.OrdinalIgnoreCase)
- || contentType.EndsWith("-HTML", StringComparison.OrdinalIgnoreCase)
- || contentType.EndsWith("+HTML", StringComparison.OrdinalIgnoreCase)
- || contentType.EndsWith("/XML", StringComparison.OrdinalIgnoreCase)
- || contentType.EndsWith("-XML", StringComparison.OrdinalIgnoreCase)
- || contentType.EndsWith("+XML", StringComparison.OrdinalIgnoreCase))
- {
- if (await FormatXmlAsync(consoleManager, content, bodyFileWriter))
- {
- return;
- }
- }
- }
-
- string responseContent = await content.ReadAsStringAsync().ConfigureAwait(false);
- bodyFileWriter.WriteLine(responseContent);
- consoleManager.WriteLine(responseContent);
- }
-
- private static async Task WaitForCompletionAsync(ValueTask readTask, CancellationToken cancellationToken)
- {
- while (!readTask.IsCompleted && !cancellationToken.IsCancellationRequested && !Console.KeyAvailable)
- {
- await Task.Delay(1, cancellationToken).ConfigureAwait(false);
- }
-
- if (Console.KeyAvailable)
- {
- Console.ReadKey(false);
- return false;
- }
-
- return readTask.IsCompleted;
- }
-
- private static async Task FormatXmlAsync(IWritable consoleManager, HttpContent content, StreamWriter bodyFileWriter)
- {
- string responseContent = await content.ReadAsStringAsync().ConfigureAwait(false);
- try
- {
- XDocument body = XDocument.Parse(responseContent);
- consoleManager.WriteLine(body.ToString());
- bodyFileWriter.WriteLine(body.ToString());
- return true;
- }
- catch
- {
- }
-
- return false;
- }
-
- private static async Task FormatJsonAsync(HttpState programState, IWritable outputSink, HttpContent content, StreamWriter bodyFileWriter)
- {
- string responseContent = await content.ReadAsStringAsync().ConfigureAwait(false);
-
- try
- {
- JsonConfig config = new JsonConfig(programState);
- string formatted = JsonVisitor.FormatAndColorize(config, responseContent);
- outputSink.WriteLine(formatted);
- bodyFileWriter.WriteLine(JToken.Parse(responseContent).ToString());
- return true;
- }
- catch
- {
- }
-
- return false;
- }
-
- protected override string GetHelpDetails(IShellState shellState, HttpState programState, DefaultCommandInput commandInput, ICoreParseResult parseResult)
- {
- var helpText = new StringBuilder();
- helpText.Append("Usage: ".Bold());
- helpText.AppendLine($"{Verb.ToUpperInvariant()} [Options]");
- helpText.AppendLine();
- helpText.AppendLine($"Issues a {Verb.ToUpperInvariant()} request.");
-
- if (RequiresBody)
- {
- helpText.AppendLine("Your default editor will be opened with a sample body if no options are provided.");
- }
-
- return helpText.ToString();
- }
-
- public override string GetHelpSummary(IShellState shellState, HttpState programState)
- {
- return $"{Verb.ToLowerInvariant()} - Issues a {Verb.ToUpperInvariant()} request";
- }
-
- protected override IEnumerable GetArgumentSuggestionsForText(IShellState shellState, HttpState programState, ICoreParseResult parseResult, DefaultCommandInput commandInput, string normalCompletionString)
- {
- List results = new List();
-
- if (programState.Structure != null && programState.BaseAddress != null)
- {
- //If it's an absolute URI, nothing to suggest
- if (Uri.TryCreate(parseResult.Sections[1], UriKind.Absolute, out Uri _))
- {
- return null;
- }
-
- string path = normalCompletionString.Replace('\\', '/');
- int searchFrom = normalCompletionString.Length - 1;
- int lastSlash = path.LastIndexOf('/', searchFrom);
- string prefix;
-
- if (lastSlash < 0)
- {
- path = string.Empty;
- prefix = normalCompletionString;
- }
- else
- {
- path = path.Substring(0, lastSlash + 1);
- prefix = normalCompletionString.Substring(lastSlash + 1);
- }
-
- IDirectoryStructure s = programState.Structure.TraverseTo(programState.PathSections.Reverse()).TraverseTo(path);
-
- foreach (string child in s.DirectoryNames)
- {
- if (child.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
- {
- results.Add(path + child);
- }
- }
- }
-
- return results;
- }
-
- protected override IEnumerable GetOptionValueCompletions(IShellState shellState, HttpState programState, string optionId, DefaultCommandInput commandInput, ICoreParseResult parseResult, string normalizedCompletionText)
- {
- if (string.Equals(optionId, BodyFileOption, StringComparison.Ordinal) || string.Equals(optionId, ResponseFileOption, StringComparison.OrdinalIgnoreCase) || string.Equals(optionId, ResponseBodyFileOption, StringComparison.OrdinalIgnoreCase) || string.Equals(optionId, ResponseHeadersFileOption, StringComparison.OrdinalIgnoreCase))
- {
- return FileSystemCompletion.GetCompletions(normalizedCompletionText);
- }
-
- if (string.Equals(optionId, HeaderOption, StringComparison.Ordinal))
- {
- HashSet alreadySpecifiedHeaders = new HashSet(StringComparer.Ordinal);
- IReadOnlyList options = commandInput.Options[HeaderOption];
- for (int i = 0; i < options.Count; ++i)
- {
- if (options[i] == commandInput.SelectedElement)
- {
- continue;
- }
-
- string elementText = options[i].Text;
- string existingHeaderName = elementText.Split(HeaderSeparatorChars)[0];
- alreadySpecifiedHeaders.Add(existingHeaderName);
- }
-
- //Check to see if the selected element is in a header name or value
- int equalsIndex = normalizedCompletionText.IndexOfAny(HeaderSeparatorChars);
- string path = commandInput.Arguments.Count > 0 ? commandInput.Arguments[0].Text : string.Empty;
-
- if (equalsIndex < 0)
- {
- IEnumerable headerNameOptions = HeaderCompletion.GetCompletions(alreadySpecifiedHeaders, normalizedCompletionText);
-
- if (headerNameOptions == null)
- {
- return null;
- }
-
- List allSuggestions = new List();
- foreach (string suggestion in headerNameOptions.Select(x => x))
- {
- allSuggestions.Add(suggestion + ":");
-
- IEnumerable suggestions = HeaderCompletion.GetValueCompletions(Verb, path, suggestion, string.Empty, programState);
-
- if (suggestions != null)
- {
- foreach (string valueSuggestion in suggestions)
- {
- allSuggestions.Add(suggestion + ":" + valueSuggestion);
- }
- }
- }
-
- return allSuggestions;
- }
- else
- {
- //Didn't exit from the header name check, so must be a value
- string headerName = normalizedCompletionText.Substring(0, equalsIndex);
- IEnumerable suggestions = HeaderCompletion.GetValueCompletions(Verb, path, headerName, normalizedCompletionText.Substring(equalsIndex + 1), programState);
-
- if (suggestions == null)
- {
- return null;
- }
-
- return suggestions.Select(x => normalizedCompletionText.Substring(0, equalsIndex + 1) + x);
- }
- }
-
- return null;
- }
- }
-}
diff --git a/src/Microsoft.HttpRepl/Commands/ChangeDirectoryCommand.cs b/src/Microsoft.HttpRepl/Commands/ChangeDirectoryCommand.cs
deleted file mode 100644
index 4fd011d182..0000000000
--- a/src/Microsoft.HttpRepl/Commands/ChangeDirectoryCommand.cs
+++ /dev/null
@@ -1,90 +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.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.HttpRepl.Suggestions;
-using Microsoft.Repl;
-using Microsoft.Repl.Commanding;
-using Microsoft.Repl.ConsoleHandling;
-using Microsoft.Repl.Parsing;
-
-namespace Microsoft.HttpRepl.Commands
-{
- public class ChangeDirectoryCommand : CommandWithStructuredInputBase
- {
- protected override Task ExecuteAsync(IShellState shellState, HttpState programState, DefaultCommandInput commandInput, ICoreParseResult parseResult, CancellationToken cancellationToken)
- {
- if (commandInput.Arguments.Count == 0 || string.IsNullOrEmpty(commandInput.Arguments[0]?.Text))
- {
- shellState.ConsoleManager.WriteLine($"/{string.Join("/", programState.PathSections.Reverse())}");
- }
- else
- {
- string[] parts = commandInput.Arguments[0].Text.Replace('\\', '/').Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
-
- if (commandInput.Arguments[0].Text.StartsWith("/", StringComparison.Ordinal))
- {
- programState.PathSections.Clear();
- }
-
- foreach (string part in parts)
- {
- switch (part)
- {
- case ".":
- break;
- case "..":
- if (programState.PathSections.Count > 0)
- {
- programState.PathSections.Pop();
- }
- break;
- default:
- programState.PathSections.Push(part);
- break;
- }
- }
-
- IDirectoryStructure s = programState.Structure.TraverseTo(programState.PathSections.Reverse());
-
- string thisDirMethod = s.RequestInfo != null && s.RequestInfo.Methods.Count > 0
- ? "[" + string.Join("|", s.RequestInfo.Methods) + "]"
- : "[]";
-
- shellState.ConsoleManager.WriteLine($"/{string.Join("/", programState.PathSections.Reverse())} {thisDirMethod}");
- }
-
- return Task.CompletedTask;
- }
-
- public override CommandInputSpecification InputSpec { get; } = CommandInputSpecification.Create("cd")
- .MaximumArgCount(1)
- .Finish();
-
- protected override string GetHelpDetails(IShellState shellState, HttpState programState, DefaultCommandInput commandInput, ICoreParseResult parseResult)
- {
- var help = new StringBuilder();
- help.Append("Usage:".Bold());
- help.AppendLine("cd [directory]");
- help.AppendLine();
- help.AppendLine("Prints the current directory if no argument is specified, otherwise changes to the specified directory");
-
- return help.ToString();
- }
-
- public override string GetHelpSummary(IShellState shellState, HttpState programState)
- {
- return "cd [directory name] - Prints the current directory if no argument is specified, otherwise changes to the specified directory";
- }
-
- protected override IEnumerable GetArgumentSuggestionsForText(IShellState shellState, HttpState programState, ICoreParseResult parseResult, DefaultCommandInput commandInput, string normalCompletionString)
- {
- return ServerPathCompletion.GetCompletions(programState, normalCompletionString);
- }
- }
-}
diff --git a/src/Microsoft.HttpRepl/Commands/ClearCommand.cs b/src/Microsoft.HttpRepl/Commands/ClearCommand.cs
deleted file mode 100644
index 4244946c95..0000000000
--- a/src/Microsoft.HttpRepl/Commands/ClearCommand.cs
+++ /dev/null
@@ -1,65 +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.Threading;
-using System.Threading.Tasks;
-using Microsoft.Repl;
-using Microsoft.Repl.Commanding;
-using Microsoft.Repl.Parsing;
-
-namespace Microsoft.HttpRepl.Commands
-{
- public class ClearCommand : ICommand