Port CLI tools to be dotnet global tools
- Rename package IDs to dotnet-watch, dotnet-user-secrets, and dotnet-sql-cache - Change packaging layout to support dotnet-install-tool - Change package metadata to DotnetTool - Drop support for DotNetCliToolReference (those will continue to be available under previous package ID's) - Rename project files and folders
This commit is contained in:
parent
d81f23e159
commit
261b27b700
|
|
@ -35,3 +35,4 @@ testWorkDir/
|
||||||
.idea/
|
.idea/
|
||||||
.dotnet/
|
.dotnet/
|
||||||
global.json
|
global.json
|
||||||
|
*.binlog
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{66517987-2A5
|
||||||
src\Directory.Build.props = src\Directory.Build.props
|
src\Directory.Build.props = src\Directory.Build.props
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
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}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-watch", "src\dotnet-watch\dotnet-watch.csproj", "{8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8321E0D1-9A47-4D2F-AED8-3AE636D44E35}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8321E0D1-9A47-4D2F-AED8-3AE636D44E35}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
|
@ -36,17 +36,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F5B382BC-2
|
||||||
test\Directory.Build.props = test\Directory.Build.props
|
test\Directory.Build.props = test\Directory.Build.props
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
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}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-watch.FunctionalTests", "test\dotnet-watch.FunctionalTests\dotnet-watch.FunctionalTests.csproj", "{16BADE2F-1184-4518-8A70-B68A19D0805B}"
|
||||||
EndProject
|
EndProject
|
||||||
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}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-user-secrets", "src\dotnet-user-secrets\dotnet-user-secrets.csproj", "{8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}"
|
||||||
EndProject
|
EndProject
|
||||||
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}"
|
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
|
EndProject
|
||||||
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}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-watch.Tests", "test\dotnet-watch.Tests\dotnet-watch.Tests.csproj", "{8A2E6961-6B12-4A8E-8215-3E7301D52EAC}"
|
||||||
EndProject
|
EndProject
|
||||||
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}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-sql-cache", "src\dotnet-sql-cache\dotnet-sql-cache.csproj", "{53F3B53D-303A-4DAA-9C38-4F55195FA5B9}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.DeveloperCertificates.Tools", "src\Microsoft.AspNetCore.DeveloperCertificates.Tools\Microsoft.AspNetCore.DeveloperCertificates.Tools.csproj", "{4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-dev-certs", "src\dotnet-dev-certs\dotnet-dev-certs.csproj", "{4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.SecretManager", "tooling\Microsoft.VisualStudio.SecretManager\Microsoft.VisualStudio.SecretManager.csproj", "{5E117F2E-7152-447F-BF47-59F759EEF3A7}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.SecretManager", "tooling\Microsoft.VisualStudio.SecretManager\Microsoft.VisualStudio.SecretManager.csproj", "{5E117F2E-7152-447F-BF47-59F759EEF3A7}"
|
||||||
EndProject
|
EndProject
|
||||||
|
|
|
||||||
|
|
@ -4,24 +4,55 @@
|
||||||
"AdxVerificationCompositeRule"
|
"AdxVerificationCompositeRule"
|
||||||
],
|
],
|
||||||
"packages": {
|
"packages": {
|
||||||
"Microsoft.DotNet.Watcher.Tools": {
|
"dotnet-watch": {
|
||||||
"packageTypes": [
|
"packageTypes": [
|
||||||
"DotnetCliTool"
|
"DotnetTool"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Microsoft.Extensions.Caching.SqlConfig.Tools": {
|
"dotnet-sql-cache": {
|
||||||
"packageTypes": [
|
"packageTypes": [
|
||||||
"DotnetCliTool"
|
"DotnetTool"
|
||||||
]
|
],
|
||||||
|
"Exclusions": {
|
||||||
|
"WRONG_PUBLICKEYTOKEN": {
|
||||||
|
"tools/netcoreapp2.1/any/System.Data.SqlClient.dll": "Assembly is built by another project but bundled in our nupkg.",
|
||||||
|
"tools/netcoreapp2.1/any/System.Text.Encoding.CodePages.dll": "Assembly is built by another project but bundled in our nupkg.",
|
||||||
|
"tools/netcoreapp2.1/any/runtimes/unix/lib/netstandard2.0/System.Data.SqlClient.dll": "Assembly is built by another project but bundled in our nupkg.",
|
||||||
|
"tools/netcoreapp2.1/any/runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll": "Assembly is built by another project but bundled in our nupkg.",
|
||||||
|
"tools/netcoreapp2.1/any/runtimes/win/lib/netstandard2.0/System.Data.SqlClient.dll": "Assembly is built by another project but bundled in our nupkg."
|
||||||
|
},
|
||||||
|
"ASSEMBLY_INFORMATIONAL_VERSION_MISMATCH": {
|
||||||
|
"tools/netcoreapp2.1/any/System.Data.SqlClient.dll": "Assembly is built by another project but bundled in our nupkg."
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Microsoft.Extensions.SecretManager.Tools": {
|
"dotnet-user-secrets": {
|
||||||
"packageTypes": [
|
"packageTypes": [
|
||||||
"DotnetCliTool"
|
"DotnetTool"
|
||||||
]
|
],
|
||||||
|
"Exclusions": {
|
||||||
|
"NEUTRAL_RESOURCES_LANGUAGE": {
|
||||||
|
"tools/netcoreapp2.1/any/Newtonsoft.Json.dll": "Assembly is built by another project but bundled in our nupkg.",
|
||||||
|
"tools/netcoreapp2.1/any/System.Runtime.CompilerServices.Unsafe.dll": "Assembly is built by another project but bundled in our nupkg."
|
||||||
|
},
|
||||||
|
"SERVICING_ATTRIBUTE": {
|
||||||
|
"tools/netcoreapp2.1/any/Newtonsoft.Json.dll": "Assembly is built by another project but bundled in our nupkg."
|
||||||
|
},
|
||||||
|
"VERSION_INFORMATIONALVERSION": {
|
||||||
|
"tools/netcoreapp2.1/any/Newtonsoft.Json.dll": "Assembly is built by another project but bundled in our nupkg."
|
||||||
|
},
|
||||||
|
"WRONG_PUBLICKEYTOKEN": {
|
||||||
|
"tools/netcoreapp2.1/any/Newtonsoft.Json.dll": "Assembly is built by another project but bundled in our nupkg.",
|
||||||
|
"tools/netcoreapp2.1/any/System.Runtime.CompilerServices.Unsafe.dll": "Assembly is built by another project but bundled in our nupkg."
|
||||||
|
},
|
||||||
|
"ASSEMBLY_INFORMATIONAL_VERSION_MISMATCH": {
|
||||||
|
"tools/netcoreapp2.1/any/Newtonsoft.Json.dll": "Assembly is built by another project but bundled in our nupkg."
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Microsoft.AspNetCore.DeveloperCertificates.Tools": {
|
"dotnet-dev-certs": {
|
||||||
"packageTypes": [
|
"packageTypes": [
|
||||||
"DotnetCliTool"
|
"DotnetTool"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Microsoft.AspNetCore.DeveloperCertificates.XPlat": {
|
"Microsoft.AspNetCore.DeveloperCertificates.XPlat": {
|
||||||
|
|
|
||||||
39
README.md
39
README.md
|
|
@ -10,33 +10,36 @@ This project is part of ASP.NET Core. You can find samples, documentation and ge
|
||||||
|
|
||||||
The repository contains command-line tools for the .NET Core CLI. Follow the links below for more details on each tool.
|
The repository contains command-line tools for the .NET Core CLI. Follow the links below for more details on each tool.
|
||||||
|
|
||||||
- [dotnet-watch](src/Microsoft.DotNet.Watcher.Tools/) (Microsoft.DotNet.Watcher.Tools)
|
- [dotnet-watch](src/dotnet-watch/)
|
||||||
- [dotnet-user-secrets](src/Microsoft.Extensions.SecretManager.Tools/) (Microsoft.Extensions.SecretManager.Tools)
|
- [dotnet-user-secrets](src/dotnet-user-secrets/)
|
||||||
- [dotnet-sql-cache](src/Microsoft.Extensions.Caching.SqlConfig.Tools/) (Microsoft.Extensions.Caching.SqlConfig.Tools)
|
- [dotnet-sql-cache](src/dotnet-sql-cache/) (dotnet-sql-cache)
|
||||||
|
- [dotnet-dev-certs](src/dotnet-dev-certs/) (dotnet-dev-certs)
|
||||||
|
|
||||||
## How to Install
|
## How to Install
|
||||||
|
|
||||||
Install tools by editing your \*.csproj file and adding a `DotNetCliToolReference` with the package name and version.
|
Install tools using the .NET Core command-line.
|
||||||
|
|
||||||
|
```
|
||||||
|
dotnet install tool dotnet-watch
|
||||||
|
dotnet install tool dotnet-user-secrets
|
||||||
|
dotnet install tool dotnet-dev-certs
|
||||||
|
dotnet install tool dotnet-sql-cache
|
||||||
|
|
||||||
```xml
|
|
||||||
<ItemGroup>
|
|
||||||
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
|
|
||||||
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
|
|
||||||
<DotNetCliToolReference Include="Microsoft.Extensions.Caching.SqlConfig.Tools" Version="2.0.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, from command line, change directories to your project and run the following commands:
|
## Usage
|
||||||
|
|
||||||
|
The command line tools can be invoked as a new verb hanging off `dotnet`.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Location of MyProject.csproj which includes DotNetCliToolReference's
|
|
||||||
cd C:\Source\MyProject\
|
|
||||||
|
|
||||||
# Download tools into the project
|
|
||||||
dotnet restore
|
|
||||||
|
|
||||||
# Execute tools
|
|
||||||
dotnet watch
|
dotnet watch
|
||||||
dotnet user-secrets
|
dotnet user-secrets
|
||||||
dotnet sql-cache
|
dotnet sql-cache
|
||||||
|
dotnet dev-certs
|
||||||
|
```
|
||||||
|
|
||||||
|
Add `--help` to see more details. For example,
|
||||||
|
|
||||||
|
```
|
||||||
|
dotnet watch --help
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<BuildVSIX Condition="'$(BuildVSIX)' ==''">true</BuildVSIX>
|
<BuildVSIX Condition="'$(BuildVSIX)' ==''">true</BuildVSIX>
|
||||||
<RestoreDependsOn Condition="'$(OS)'=='Windows_NT' AND '$(BuildVSIX)' == 'true'">$(RestoreDependsOn);RestoreVSIX</RestoreDependsOn>
|
<RestoreDependsOn Condition="'$(OS)'=='Windows_NT' AND '$(BuildVSIX)' == 'true'">$(RestoreDependsOn);RestoreVSIX</RestoreDependsOn>
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
<PackageId>$(VSIXName)</PackageId>
|
<PackageId>$(VSIXName)</PackageId>
|
||||||
</ArtifactInfo>
|
</ArtifactInfo>
|
||||||
|
|
||||||
<FilesToSign Include="$(VSIXOutputPath)" Certificate="Vsix" />
|
<FilesToSign Include="$(VSIXOutputPath)" Certificate="Vsix" IsContainer="true" />
|
||||||
<FilesToExcludeFromSigning Include="$(VSIXManifestOutputPath)" />
|
<FilesToExcludeFromSigning Include="$(VSIXManifestOutputPath)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
|
|
||||||
|
|
||||||
<Watch Include="say-hello.js" />
|
<Watch Include="say-hello.js" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ Launch any command with dotnet-watch
|
||||||
Open a terminal to the directory containing this project.
|
Open a terminal to the directory containing this project.
|
||||||
|
|
||||||
```
|
```
|
||||||
dotnet restore
|
|
||||||
dotnet watch msbuild /t:RunMyNpmCommand
|
dotnet watch msbuild /t:RunMyNpmCommand
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,4 @@ dotnet-watch samples
|
||||||
====================
|
====================
|
||||||
|
|
||||||
The samples in this folder show some ways to customize dotnet-watch. For full details on
|
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 Microsoft.DotNet.Watcher.Tools](../../src/Microsoft.DotNet.Watcher.Tools/README.md) project.
|
available settings and configuration, see the [README for the dotnet-watch](../../src/dotnet-watch/README.md) project.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ Install .NET Core command line. <https://dot.net/core>
|
||||||
Open a terminal to the directory containing this project.
|
Open a terminal to the directory containing this project.
|
||||||
|
|
||||||
```
|
```
|
||||||
dotnet restore
|
|
||||||
dotnet watch run
|
dotnet watch run
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
|
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
|
||||||
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,7 @@ Install .NET Core command line. <https://dot.net/core>
|
||||||
Open a terminal to the directory containing this project.
|
Open a terminal to the directory containing this project.
|
||||||
|
|
||||||
```
|
```
|
||||||
dotnet restore watch.proj
|
dotnet watch msbuild /t:TestAndRun
|
||||||
dotnet watch msbuild watch.proj /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.
|
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.
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
|
|
||||||
|
|
||||||
<ProjectReference Include="Web\Web.csproj" />
|
<ProjectReference Include="Web\Web.csproj" />
|
||||||
<ProjectReference Include="Test\Test.csproj" />
|
<ProjectReference Include="Test\Test.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,15 @@
|
||||||
<Project>
|
<Project>
|
||||||
<Import Project="..\Directory.Build.props" />
|
<Import Project="..\Directory.Build.props" />
|
||||||
|
|
||||||
|
<ItemDefinitionGroup>
|
||||||
|
<ExcludePackageFileFromSigning>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</ExcludePackageFileFromSigning>
|
||||||
|
<SignedPackageFile>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</SignedPackageFile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
|
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<Project>
|
||||||
|
<Import Project="DotnetTool.props" Condition="'$(PackageType)' == 'DotnetTool'" />
|
||||||
|
|
||||||
|
<Import Project="..\Directory.Build.targets" />
|
||||||
|
<Import Project="PackGlobalTool.targets" />
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<NuspecFile>$(MSBuildProjectDirectory)\$(MSBuildProjectName).nuspec</NuspecFile>
|
||||||
|
<NuspecFile Condition=" ! Exists($(NuspecFile))" />
|
||||||
|
<Serviceable Condition=" '$(Serviceable)' == '' ">true</Serviceable>
|
||||||
|
|
||||||
|
<PackageArtifactCategory>ship</PackageArtifactCategory>
|
||||||
|
<AssemblySigningCertName>Microsoft</AssemblySigningCertName>
|
||||||
|
<IncludeSymbols>false</IncludeSymbols>
|
||||||
|
<IncludeSource>false</IncludeSource>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<SignedPackageFile Include="$(TargetPath)" PackagePath="tools/$(TargetFramework)/any/$(TargetFileName)" Certificate="$(AssemblySigningCertName)" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -5,6 +5,9 @@
|
||||||
<Description>Package for the CLI first run experience.</Description>
|
<Description>Package for the CLI first run experience.</Description>
|
||||||
<DefineConstants>$(DefineConstants);XPLAT</DefineConstants>
|
<DefineConstants>$(DefineConstants);XPLAT</DefineConstants>
|
||||||
<PackageTags>aspnet;cli</PackageTags>
|
<PackageTags>aspnet;cli</PackageTags>
|
||||||
|
|
||||||
|
<PackageArtifactCategory>shipoob</PackageArtifactCategory>
|
||||||
|
<AssemblySigningCertName>Microsoft</AssemblySigningCertName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
|
||||||
<AssemblyName>dotnet-sql-cache</AssemblyName>
|
|
||||||
<OutputType>exe</OutputType>
|
|
||||||
<Description>Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching.</Description>
|
|
||||||
<PackageId>Microsoft.Extensions.Caching.SqlConfig.Tools</PackageId>
|
|
||||||
<PackageTags>cache;distributedcache;sqlserver</PackageTags>
|
|
||||||
<PackageType>DotnetCliTool</PackageType>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="..\..\shared\**\*.cs" />
|
|
||||||
<None Include="prefercliruntime" Pack="true" PackagePath="\prefercliruntime" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" />
|
|
||||||
<PackageReference Include="System.Data.SqlClient" Version="$(SystemDataSqlClientPackageVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
|
||||||
<AssemblyName>dotnet-user-secrets</AssemblyName>
|
|
||||||
<OutputType>exe</OutputType>
|
|
||||||
<Description>Command line tool to manage user secrets for Microsoft.Extensions.Configuration.</Description>
|
|
||||||
<PackageId>Microsoft.Extensions.SecretManager.Tools</PackageId>
|
|
||||||
<PackageTags>configuration;secrets;usersecrets</PackageTags>
|
|
||||||
<PackageType>DotnetCliTool</PackageType>
|
|
||||||
<GenerateUserSecretsAttribute>false</GenerateUserSecretsAttribute>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="..\..\shared\**\*.cs" />
|
|
||||||
<Content Include="toolassets\SecretManager.targets" CopyToOutputDirectory="PreserveNewest" PackagePath="%(Identity)" />
|
|
||||||
<Content Include="prefercliruntime" PackagePath="\prefercliruntime" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="$(MicrosoftExtensionsConfigurationUserSecretsPackageVersion)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
<Project>
|
||||||
|
<Target Name="PackGlobalTool" Condition="'$(PackageType)' == 'DotnetTool'" BeforeTargets="GenerateNuspec" DependsOnTargets="Publish">
|
||||||
|
<PropertyGroup>
|
||||||
|
<NuspecProperties>
|
||||||
|
publishDir=$(PublishDir);
|
||||||
|
version=$(PackageVersion);
|
||||||
|
licenseUrl=$(PackageLicenseUrl);
|
||||||
|
projectUrl=$(PackageProjectUrl);
|
||||||
|
iconUrl=$(PackageIconUrl);
|
||||||
|
serviceable=$(Serviceable);
|
||||||
|
copyright=$(Copyright);
|
||||||
|
description=$(Description);
|
||||||
|
repositoryUrl=$(RepositoryUrl);
|
||||||
|
targetframework=$(TargetFramework);
|
||||||
|
</NuspecProperties>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<DotNetCliTool>
|
||||||
|
<Commands>
|
||||||
|
<Command Name="dotnet-dev-certs" EntryPoint="dotnet-dev-certs.dll" Runner="dotnet" />
|
||||||
|
</Commands>
|
||||||
|
</DotNetCliTool>
|
||||||
|
|
@ -12,7 +12,7 @@ using Microsoft.Extensions.Tools.Internal;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.DeveloperCertificates.Tools
|
namespace Microsoft.AspNetCore.DeveloperCertificates.Tools
|
||||||
{
|
{
|
||||||
class Program
|
internal class Program
|
||||||
{
|
{
|
||||||
private const int CriticalError = -1;
|
private const int CriticalError = -1;
|
||||||
private const int Success = 0;
|
private const int Success = 0;
|
||||||
|
|
@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.DeveloperCertificates.Tools
|
||||||
{
|
{
|
||||||
var app = new CommandLineApplication
|
var app = new CommandLineApplication
|
||||||
{
|
{
|
||||||
Name = "dotnet-developercertificates"
|
Name = "dotnet-dev-certs"
|
||||||
};
|
};
|
||||||
|
|
||||||
app.Command("https", c =>
|
app.Command("https", c =>
|
||||||
|
|
@ -2,12 +2,10 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
<AssemblyName>dotnet-dev-certs</AssemblyName>
|
|
||||||
<OutputType>exe</OutputType>
|
<OutputType>exe</OutputType>
|
||||||
<Description>Command line tool to generate certificates used in ASP.NET Core during development.</Description>
|
<Description>Command line tool to generate certificates used in ASP.NET Core during development.</Description>
|
||||||
<PackageId>Microsoft.AspNetCore.DeveloperCertificates.Tools</PackageId>
|
<PackageType>DotnetTool</PackageType>
|
||||||
<PackageTags>dotnet;developercertificates</PackageTags>
|
<RootNamespace>Microsoft.AspNetCore.DeveloperCertificates.Tools</RootNamespace>
|
||||||
<PackageType>DotnetCliTool</PackageType>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
@ -22,10 +20,6 @@
|
||||||
<Compile Include="..\..\shared\PhysicalConsole.cs" Link="PhysicalConsole.cs" />
|
<Compile Include="..\..\shared\PhysicalConsole.cs" Link="PhysicalConsole.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="prefercliruntime" PackagePath="\prefercliruntime" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Certificates.Generation.Sources" PrivateAssets="All" Version="$(MicrosoftAspNetCoreCertificatesGenerationSourcesPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.Certificates.Generation.Sources" PrivateAssets="All" Version="$(MicrosoftAspNetCoreCertificatesGenerationSourcesPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" />
|
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" />
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>dotnet-dev-certs</id>
|
||||||
|
<tags>dotnet developercertificates</tags>
|
||||||
|
<version>$version$</version>
|
||||||
|
<authors>Microsoft</authors>
|
||||||
|
<owners>Microsoft</owners>
|
||||||
|
<licenseUrl>$licenseUrl$</licenseUrl>
|
||||||
|
<projectUrl>$projectUrl$</projectUrl>
|
||||||
|
<iconUrl>$iconUrl$</iconUrl>
|
||||||
|
<description>$description$</description>
|
||||||
|
<copyright>$copyright$</copyright>
|
||||||
|
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||||
|
<serviceable>$serviceable$</serviceable>
|
||||||
|
<packageTypes>
|
||||||
|
<packageType name="DotnetTool" />
|
||||||
|
</packageTypes>
|
||||||
|
<repository type="git" url="$repositoryUrl$" />
|
||||||
|
<dependencies />
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="$publishdir$" target="tools/$targetframework$/any/" />
|
||||||
|
<file src="DotnetToolSettings.xml" target="tools/DotnetToolSettings.xml" />
|
||||||
|
</files>
|
||||||
|
</package>
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<DotNetCliTool>
|
||||||
|
<Commands>
|
||||||
|
<Command Name="dotnet-sql-cache" EntryPoint="dotnet-sql-cache.dll" Runner="dotnet" />
|
||||||
|
</Commands>
|
||||||
|
</DotNetCliTool>
|
||||||
|
|
@ -5,12 +5,10 @@ dotnet-sql-cache
|
||||||
|
|
||||||
### How To Install
|
### How To Install
|
||||||
|
|
||||||
Install `Microsoft.Extensions.Caching.SqlConfig.Tools` as a `DotNetCliToolReference` to your project.
|
From the command-line, execute:
|
||||||
|
|
||||||
```xml
|
```
|
||||||
<ItemGroup>
|
dotnet install tool dotnet-sql-cache
|
||||||
<DotNetCliToolReference Include="Microsoft.Extensions.Caching.SqlConfig.Tools" Version="2.0.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### How To Use
|
### How To Use
|
||||||
|
|
@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Caching.SqlConfig.Tools
|
||||||
internal class SqlQueries
|
internal class SqlQueries
|
||||||
{
|
{
|
||||||
private const string CreateTableFormat = "CREATE TABLE {0}(" +
|
private const string CreateTableFormat = "CREATE TABLE {0}(" +
|
||||||
// Maximum size of primary key column is 900 bytes (898 bytes from key + 2 additional bytes used by the
|
// Maximum size of primary key column is 900 bytes (898 bytes from key + 2 additional bytes used by the
|
||||||
// Sql Server). In the case where the key is greater than 898 bytes, then it gets truncated.
|
// Sql Server). In the case where the key is greater than 898 bytes, then it gets truncated.
|
||||||
// - Add collation to the key column to make it case-sensitive
|
// - Add collation to the key column to make it case-sensitive
|
||||||
"Id nvarchar(449) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL, " +
|
"Id nvarchar(449) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL, " +
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
|
<OutputType>exe</OutputType>
|
||||||
|
<Description>Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching.</Description>
|
||||||
|
<PackageType>DotnetTool</PackageType>
|
||||||
|
<PackageBasePath>tools/$(TargetFramework)/any/</PackageBasePath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\..\shared\**\*.cs" />
|
||||||
|
|
||||||
|
<!-- This should already be signed by the dotnet-core team -->
|
||||||
|
<ExcludePackageFileFromSigning Include="$(PublishDir)System.Data.SqlClient.dll" PackagePath="$(PackageBasePath)System.Data.SqlClient.dll" />
|
||||||
|
<ExcludePackageFileFromSigning Include="$(PublishDir)System.Text.Encoding.CodePages.dll" PackagePath="$(PackageBasePath)System.Text.Encoding.CodePages.dll" />
|
||||||
|
<ExcludePackageFileFromSigning Include="$(PublishDir)runtimes/win-arm64/native/sni.dll" PackagePath="$(PackageBasePath)runtimes/win-arm64/native/sni.dll" />
|
||||||
|
<ExcludePackageFileFromSigning Include="$(PublishDir)runtimes/win-x64/native/sni.dll" PackagePath="$(PackageBasePath)runtimes/win-x64/native/sni.dll" />
|
||||||
|
<ExcludePackageFileFromSigning Include="$(PublishDir)runtimes/win-x86/native/sni.dll" PackagePath="$(PackageBasePath)runtimes/win-x86/native/sni.dll" />
|
||||||
|
<ExcludePackageFileFromSigning Include="$(PublishDir)runtimes/unix/lib/netstandard2.0/System.Data.SqlClient.dll" PackagePath="$(PackageBasePath)runtimes/unix/lib/netstandard2.0/System.Data.SqlClient.dll" />
|
||||||
|
<ExcludePackageFileFromSigning Include="$(PublishDir)runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll" PackagePath="$(PackageBasePath)runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll" />
|
||||||
|
<ExcludePackageFileFromSigning Include="$(PublishDir)runtimes/win/lib/netstandard2.0/System.Data.SqlClient.dll" PackagePath="$(PackageBasePath)runtimes/win/lib/netstandard2.0/System.Data.SqlClient.dll" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" />
|
||||||
|
<PackageReference Include="System.Data.SqlClient" Version="$(SystemDataSqlClientPackageVersion)" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>dotnet-sql-cache</id>
|
||||||
|
<tags>cache distributedcache sqlserver</tags>
|
||||||
|
<version>$version$</version>
|
||||||
|
<authors>Microsoft</authors>
|
||||||
|
<owners>Microsoft</owners>
|
||||||
|
<licenseUrl>$licenseUrl$</licenseUrl>
|
||||||
|
<projectUrl>$projectUrl$</projectUrl>
|
||||||
|
<iconUrl>$iconUrl$</iconUrl>
|
||||||
|
<description>$description$</description>
|
||||||
|
<copyright>$copyright$</copyright>
|
||||||
|
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||||
|
<serviceable>$serviceable$</serviceable>
|
||||||
|
<packageTypes>
|
||||||
|
<packageType name="DotnetTool" />
|
||||||
|
</packageTypes>
|
||||||
|
<repository type="git" url="$repositoryUrl$" />
|
||||||
|
<dependencies />
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="$publishdir$" target="tools/$targetframework$/any/" />
|
||||||
|
<file src="DotnetToolSettings.xml" target="tools/DotnetToolSettings.xml" />
|
||||||
|
</files>
|
||||||
|
</package>
|
||||||
|
|
@ -33,15 +33,15 @@ namespace Microsoft.Extensions.SecretManager.Tools
|
||||||
|
|
||||||
var optionVerbose = app.VerboseOption();
|
var optionVerbose = app.VerboseOption();
|
||||||
|
|
||||||
var optionProject = app.Option("-p|--project <PROJECT>", "Path to project, default is current directory",
|
var optionProject = app.Option("-p|--project <PROJECT>", "Path to project. Defaults to searching the current directory.",
|
||||||
CommandOptionType.SingleValue, inherited: true);
|
CommandOptionType.SingleValue, inherited: true);
|
||||||
|
|
||||||
var optionConfig = app.Option("-c|--configuration <CONFIGURATION>", $"The project configuration to use. Defaults to 'Debug'",
|
var optionConfig = app.Option("-c|--configuration <CONFIGURATION>", $"The project configuration to use. Defaults to 'Debug'.",
|
||||||
CommandOptionType.SingleValue, inherited: true);
|
CommandOptionType.SingleValue, inherited: true);
|
||||||
|
|
||||||
// the escape hatch if project evaluation fails, or if users want to alter a secret store other than the one
|
// the escape hatch if project evaluation fails, or if users want to alter a secret store other than the one
|
||||||
// in the current project
|
// in the current project
|
||||||
var optionId = app.Option("--id", "The user secret id to use.",
|
var optionId = app.Option("--id", "The user secret ID to use.",
|
||||||
CommandOptionType.SingleValue, inherited: true);
|
CommandOptionType.SingleValue, inherited: true);
|
||||||
|
|
||||||
var options = new CommandLineOptions();
|
var options = new CommandLineOptions();
|
||||||
|
|
@ -69,4 +69,4 @@ namespace Microsoft.Extensions.SecretManager.Tools
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<DotNetCliTool>
|
||||||
|
<Commands>
|
||||||
|
<Command Name="dotnet-user-secrets" EntryPoint="dotnet-user-secrets.dll" Runner="dotnet" />
|
||||||
|
</Commands>
|
||||||
|
</DotNetCliTool>
|
||||||
|
|
@ -91,11 +91,10 @@ namespace Microsoft.Extensions.SecretManager.Tools.Internal
|
||||||
var assemblyDir = Path.GetDirectoryName(typeof(ProjectIdResolver).Assembly.Location);
|
var assemblyDir = Path.GetDirectoryName(typeof(ProjectIdResolver).Assembly.Location);
|
||||||
var searchPaths = new[]
|
var searchPaths = new[]
|
||||||
{
|
{
|
||||||
|
Path.Combine(AppContext.BaseDirectory, "assets"),
|
||||||
|
Path.Combine(assemblyDir, "assets"),
|
||||||
AppContext.BaseDirectory,
|
AppContext.BaseDirectory,
|
||||||
assemblyDir,
|
assemblyDir,
|
||||||
Path.Combine(assemblyDir, "../../toolassets"), // from nuget cache
|
|
||||||
Path.Combine(assemblyDir, "toolassets"), // from local build
|
|
||||||
Path.Combine(AppContext.BaseDirectory, "../../toolassets"), // relative to packaged deps.json
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
|
var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
|
||||||
|
|
@ -5,12 +5,10 @@ dotnet-user-secrets
|
||||||
|
|
||||||
### How To Install
|
### How To Install
|
||||||
|
|
||||||
Install `Microsoft.Extensions.SecretManager.Tools` as a `DotNetCliToolReference` to your project.
|
From the command-line, execute:
|
||||||
|
|
||||||
```xml
|
```
|
||||||
<ItemGroup>
|
dotnet install tool dotnet-user-secrets
|
||||||
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### How To Use
|
### How To Use
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
|
<OutputType>exe</OutputType>
|
||||||
|
<Description>Command line tool to manage user secrets for Microsoft.Extensions.Configuration.</Description>
|
||||||
|
<PackageType>DotnetTool</PackageType>
|
||||||
|
<GenerateUserSecretsAttribute>false</GenerateUserSecretsAttribute>
|
||||||
|
<RootNamespace>Microsoft.Extensions.SecretManager.Tools</RootNamespace>
|
||||||
|
<PackageBasePath>tools/$(TargetFramework)/any/</PackageBasePath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\..\shared\**\*.cs" />
|
||||||
|
<Content Include="assets\**\*" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
|
||||||
|
|
||||||
|
<!-- Files that come from other ASP.NET Core projects -->
|
||||||
|
<SignedPackageFile Include="$(PublishDir)Microsoft.Extensions.Configuration.Abstractions.dll" Certificate="$(AssemblySigningCertName)" PackagePath="$(PackageBasePath)Microsoft.Extensions.Configuration.Abstractions.dll" />
|
||||||
|
<SignedPackageFile Include="$(PublishDir)Microsoft.Extensions.Configuration.dll" Certificate="$(AssemblySigningCertName)" PackagePath="$(PackageBasePath)Microsoft.Extensions.Configuration.dll" />
|
||||||
|
<SignedPackageFile Include="$(PublishDir)Microsoft.Extensions.Configuration.FileExtensions.dll" Certificate="$(AssemblySigningCertName)" PackagePath="$(PackageBasePath)Microsoft.Extensions.Configuration.FileExtensions.dll" />
|
||||||
|
<SignedPackageFile Include="$(PublishDir)Microsoft.Extensions.Configuration.Json.dll" Certificate="$(AssemblySigningCertName)" PackagePath="$(PackageBasePath)Microsoft.Extensions.Configuration.Json.dll" />
|
||||||
|
<SignedPackageFile Include="$(PublishDir)Microsoft.Extensions.Configuration.UserSecrets.dll" Certificate="$(AssemblySigningCertName)" PackagePath="$(PackageBasePath)Microsoft.Extensions.Configuration.UserSecrets.dll" />
|
||||||
|
<SignedPackageFile Include="$(PublishDir)Microsoft.Extensions.FileProviders.Abstractions.dll" Certificate="$(AssemblySigningCertName)" PackagePath="$(PackageBasePath)Microsoft.Extensions.FileProviders.Abstractions.dll" />
|
||||||
|
<SignedPackageFile Include="$(PublishDir)Microsoft.Extensions.FileProviders.Physical.dll" Certificate="$(AssemblySigningCertName)" PackagePath="$(PackageBasePath)Microsoft.Extensions.FileProviders.Physical.dll" />
|
||||||
|
<SignedPackageFile Include="$(PublishDir)Microsoft.Extensions.FileSystemGlobbing.dll" Certificate="$(AssemblySigningCertName)" PackagePath="$(PackageBasePath)Microsoft.Extensions.FileSystemGlobbing.dll" />
|
||||||
|
<SignedPackageFile Include="$(PublishDir)Microsoft.Extensions.Primitives.dll" Certificate="$(AssemblySigningCertName)" PackagePath="$(PackageBasePath)Microsoft.Extensions.Primitives.dll" />
|
||||||
|
|
||||||
|
<!-- Third-party cert -->
|
||||||
|
<SignedPackageFile Include="$(PublishDir)Newtonsoft.Json.dll" Certificate="3PartyDual" PackagePath="$(PackageBasePath)Newtonsoft.Json.dll" />
|
||||||
|
|
||||||
|
<!-- This should already be signed by the dotnet-core team -->
|
||||||
|
<ExcludePackageFileFromSigning Include="$(PublishDir)System.Runtime.CompilerServices.Unsafe.dll" PackagePath="$(PackageBasePath)System.Runtime.CompilerServices.Unsafe.dll" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="$(MicrosoftExtensionsConfigurationUserSecretsPackageVersion)" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>dotnet-user-secrets</id>
|
||||||
|
<tags>configuration secrets usersecrets</tags>
|
||||||
|
<version>$version$</version>
|
||||||
|
<authors>Microsoft</authors>
|
||||||
|
<owners>Microsoft</owners>
|
||||||
|
<licenseUrl>$licenseUrl$</licenseUrl>
|
||||||
|
<projectUrl>$projectUrl$</projectUrl>
|
||||||
|
<iconUrl>$iconUrl$</iconUrl>
|
||||||
|
<description>$description$</description>
|
||||||
|
<copyright>$copyright$</copyright>
|
||||||
|
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||||
|
<serviceable>$serviceable$</serviceable>
|
||||||
|
<packageTypes>
|
||||||
|
<packageType name="DotnetTool" />
|
||||||
|
</packageTypes>
|
||||||
|
<repository type="git" url="$repositoryUrl$" />
|
||||||
|
<dependencies />
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="$publishdir$" target="tools/$targetframework$/any/" />
|
||||||
|
<file src="DotnetToolSettings.xml" target="tools/DotnetToolSettings.xml" />
|
||||||
|
</files>
|
||||||
|
</package>
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<DotNetCliTool>
|
||||||
|
<Commands>
|
||||||
|
<Command Name="dotnet-watch" EntryPoint="dotnet-watch.dll" Runner="dotnet" />
|
||||||
|
</Commands>
|
||||||
|
</DotNetCliTool>
|
||||||
|
|
@ -12,8 +12,8 @@ namespace Microsoft.DotNet.Watcher.Internal
|
||||||
|
|
||||||
public static IFileSystemWatcher CreateWatcher(string watchedDirectory, bool usePollingWatcher)
|
public static IFileSystemWatcher CreateWatcher(string watchedDirectory, bool usePollingWatcher)
|
||||||
{
|
{
|
||||||
return usePollingWatcher ?
|
return usePollingWatcher ?
|
||||||
new PollingFileWatcher(watchedDirectory) :
|
new PollingFileWatcher(watchedDirectory) :
|
||||||
new DotnetFileWatcher(watchedDirectory) as IFileSystemWatcher;
|
new DotnetFileWatcher(watchedDirectory) as IFileSystemWatcher;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -170,11 +170,10 @@ namespace Microsoft.DotNet.Watcher.Internal
|
||||||
var assemblyDir = Path.GetDirectoryName(typeof(MsBuildFileSetFactory).Assembly.Location);
|
var assemblyDir = Path.GetDirectoryName(typeof(MsBuildFileSetFactory).Assembly.Location);
|
||||||
var searchPaths = new[]
|
var searchPaths = new[]
|
||||||
{
|
{
|
||||||
|
Path.Combine(AppContext.BaseDirectory, "assets"),
|
||||||
|
Path.Combine(assemblyDir, "assets"),
|
||||||
AppContext.BaseDirectory,
|
AppContext.BaseDirectory,
|
||||||
assemblyDir,
|
assemblyDir,
|
||||||
Path.Combine(assemblyDir, "../../toolassets"), // from nuget cache
|
|
||||||
Path.Combine(assemblyDir, "toolassets"), // from local build
|
|
||||||
Path.Combine(AppContext.BaseDirectory, "../../toolassets"), // relative to packaged deps.json
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var targetPath = searchPaths.Select(p => Path.Combine(p, WatchTargetsFileName)).FirstOrDefault(File.Exists);
|
var targetPath = searchPaths.Select(p => Path.Combine(p, WatchTargetsFileName)).FirstOrDefault(File.Exists);
|
||||||
|
|
@ -4,12 +4,10 @@ dotnet-watch
|
||||||
|
|
||||||
### How To Install
|
### How To Install
|
||||||
|
|
||||||
Install `Microsoft.DotNet.Watcher.Tools` as a `DotNetCliToolReference` to your project.
|
From the command-line, execute:
|
||||||
|
|
||||||
```xml
|
```
|
||||||
<ItemGroup>
|
dotnet install tool dotnet-watch
|
||||||
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### How To Use
|
### How To Use
|
||||||
|
|
@ -2,18 +2,15 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
<AssemblyName>dotnet-watch</AssemblyName>
|
|
||||||
<OutputType>exe</OutputType>
|
<OutputType>exe</OutputType>
|
||||||
<Description>Command line tool to watch for source file changes during development and restart the dotnet command.</Description>
|
<Description>Command line tool to watch for source file changes during development and restart the dotnet command.</Description>
|
||||||
<PackageId>Microsoft.DotNet.Watcher.Tools</PackageId>
|
<PackageType>DotnetTool</PackageType>
|
||||||
<PackageTags>dotnet;watch</PackageTags>
|
<RootNamespace>Microsoft.DotNet.Watcher.Tools</RootNamespace>
|
||||||
<PackageType>DotnetCliTool</PackageType>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="..\..\shared\**\*.cs" />
|
<Compile Include="..\..\shared\**\*.cs" />
|
||||||
<Content Include="prefercliruntime" PackagePath="\prefercliruntime" />
|
<Content Include="assets\**\*" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
|
||||||
<Content Include="toolassets\DotNetWatch.targets" CopyToOutputDirectory="PreserveNewest" PackagePath="%(Identity)" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>dotnet-watch</id>
|
||||||
|
<tags>dotnet watch</tags>
|
||||||
|
<version>$version$</version>
|
||||||
|
<authors>Microsoft</authors>
|
||||||
|
<owners>Microsoft</owners>
|
||||||
|
<licenseUrl>$licenseUrl$</licenseUrl>
|
||||||
|
<projectUrl>$projectUrl$</projectUrl>
|
||||||
|
<iconUrl>$iconUrl$</iconUrl>
|
||||||
|
<description>$description$</description>
|
||||||
|
<copyright>$copyright$</copyright>
|
||||||
|
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||||
|
<serviceable>$serviceable$</serviceable>
|
||||||
|
<packageTypes>
|
||||||
|
<packageType name="DotnetTool" />
|
||||||
|
</packageTypes>
|
||||||
|
<repository type="git" url="$repositoryUrl$" />
|
||||||
|
<dependencies />
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="$publishdir$" target="tools/$targetframework$/any/" />
|
||||||
|
<file src="DotnetToolSettings.xml" target="tools/DotnetToolSettings.xml" />
|
||||||
|
</files>
|
||||||
|
</package>
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="..\Shared\**\*.cs" />
|
|
||||||
<Content Include="..\..\src\Microsoft.DotNet.Watcher.Tools\toolassets\DotNetWatch.targets" Link="toolassets\DotNetWatch.targets" CopyToOutputDirectory="PreserveNewest" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\src\Microsoft.DotNet.Watcher.Tools\Microsoft.DotNet.Watcher.Tools.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="..\Shared\**\*.cs" />
|
|
||||||
<Content Include="..\..\src\Microsoft.Extensions.SecretManager.Tools\toolassets\SecretManager.targets" Link="toolassets\SecretManager.targets" CopyToOutputDirectory="PreserveNewest" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\src\Microsoft.Extensions.SecretManager.Tools\Microsoft.Extensions.SecretManager.Tools.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
|
<AssemblyName>Microsoft.Extensions.SecretManager.Tools.Tests</AssemblyName>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\Shared\**\*.cs" />
|
||||||
|
<Content Include="..\..\src\dotnet-user-secrets\assets\SecretManager.targets" Link="assets\SecretManager.targets" CopyToOutputDirectory="PreserveNewest" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\src\dotnet-user-secrets\dotnet-user-secrets.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -39,6 +39,8 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
|
||||||
|
|
||||||
public string WorkFolder { get; }
|
public string WorkFolder { get; }
|
||||||
|
|
||||||
|
public string DotNetWatchPath { get; } = Path.Combine(AppContext.BaseDirectory, "tool", "dotnet-watch.dll");
|
||||||
|
|
||||||
public void AddTestProjectFolder(string projectName)
|
public void AddTestProjectFolder(string projectName)
|
||||||
{
|
{
|
||||||
var srcFolder = Path.Combine(TestProjectSourceRoot, projectName);
|
var srcFolder = Path.Combine(TestProjectSourceRoot, projectName);
|
||||||
|
|
@ -150,39 +152,6 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
|
||||||
File.Copy(nugetConfigFilePath, tempNugetConfigFile);
|
File.Copy(nugetConfigFilePath, tempNugetConfigFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<string> GetDotnetWatchArguments()
|
|
||||||
{
|
|
||||||
// this launches a new .NET Core process using the runtime of the current test app
|
|
||||||
// and the version of dotnet-watch that this test app is compiled against
|
|
||||||
var thisAssembly = Path.GetFileNameWithoutExtension(GetType().GetTypeInfo().Assembly.Location);
|
|
||||||
|
|
||||||
var args = new List<string>
|
|
||||||
{
|
|
||||||
"exec",
|
|
||||||
"--depsfile",
|
|
||||||
Path.Combine(AppContext.BaseDirectory, thisAssembly + ".deps.json"),
|
|
||||||
"--runtimeconfig",
|
|
||||||
Path.Combine(AppContext.BaseDirectory, thisAssembly + ".runtimeconfig.json")
|
|
||||||
};
|
|
||||||
|
|
||||||
if (AppContext.GetData("FX_DEPS_FILE") is string currentFxVersion)
|
|
||||||
{
|
|
||||||
// This overrides the version of shared fx in the runtimeconfig.json file.
|
|
||||||
// Tests do this to ensure dotnet-watch is executing on the version of Microsoft.NETCore.App
|
|
||||||
// used by the current test project. The test project can target multiple version of
|
|
||||||
// netcoreapp1.x in order to ensure the tool runs when it is lifted to higher netcore versions
|
|
||||||
// due to inclusion of the 'prefercliruntime' file in our nupkg.
|
|
||||||
|
|
||||||
var version = new FileInfo(currentFxVersion).Directory.Name;
|
|
||||||
args.Add("--fx-version");
|
|
||||||
args.Add(version);
|
|
||||||
}
|
|
||||||
|
|
||||||
args.Add(Path.Combine(AppContext.BaseDirectory, "dotnet-watch.dll"));
|
|
||||||
|
|
||||||
return args;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string FindNugetConfig()
|
private static string FindNugetConfig()
|
||||||
{
|
{
|
||||||
var currentDirPath = AppContext.BaseDirectory;
|
var currentDirPath = AppContext.BaseDirectory;
|
||||||
|
|
@ -216,4 +185,4 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -69,9 +69,11 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests
|
||||||
throw new InvalidOperationException($"Call {nameof(PrepareAsync)} first");
|
throw new InvalidOperationException($"Call {nameof(PrepareAsync)} first");
|
||||||
}
|
}
|
||||||
|
|
||||||
var args = Scenario
|
var args = new List<string>
|
||||||
.GetDotnetWatchArguments()
|
{
|
||||||
.Concat(arguments);
|
Scenario.DotNetWatchPath,
|
||||||
|
};
|
||||||
|
args.AddRange(arguments);
|
||||||
|
|
||||||
var spec = new ProcessSpec
|
var spec = new ProcessSpec
|
||||||
{
|
{
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue