Skip to content

Commit e2d7792

Browse files
morendedMounika Rendedla
andauthored
Add configuration to publish cred provider as tool. (#566)
This PR introduces packaging credprovider as dotnet tool. --------- Co-authored-by: Mounika Rendedla <[email protected]>
1 parent d3cb920 commit e2d7792

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<VersionSuffix></VersionSuffix>
66
<TargetFrameworks>net481;net6.0;net8.0</TargetFrameworks>
77
</PropertyGroup>
8+
89
<!-- Remove with netcoreapp3.1; required for self-contained build -->
910
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'osx-arm64'">
1011
<TargetFrameworks>net8.0</TargetFrameworks>

CredentialProvider.Microsoft/CredentialProvider.Microsoft.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<LangVersion>latest</LangVersion>
77
<ApplicationIcon>helpericons.ico</ApplicationIcon>
88
<VersionPrefix>$(CredentialProviderVersion)</VersionPrefix>
9-
<NuspecFile>CredentialProvider.Microsoft.nuspec</NuspecFile>
9+
<NuspecFile Condition=" '$(PackAsTool)' != 'true' ">CredentialProvider.Microsoft.nuspec</NuspecFile>
1010
<!-- Need to set properties explictly when using nuspec https://github.com/NuGet/Home/issues/6636#issuecomment-443280306 -->
1111
<NuspecProperties Condition=" '$(VersionSuffix)' == '' ">$(NuspecProperties);Configuration=$(Configuration);Version=$(VersionPrefix)</NuspecProperties>
1212
<NuspecProperties Condition=" '$(VersionSuffix)' != '' ">$(NuspecProperties);Configuration=$(Configuration);Version=$(VersionPrefix)-$(VersionSuffix)</NuspecProperties>
@@ -15,6 +15,16 @@
1515
<WarningLevel>4</WarningLevel>
1616
<NoWarn>$(NoWarn);NU5100</NoWarn>
1717
</PropertyGroup>
18+
19+
<PropertyGroup Condition="'$(PackAsTool)' == 'true'">
20+
<TargetFrameworks>net8.0</TargetFrameworks>
21+
<NuspecFile>Microsoft.Artifacts.CredentialProvider.NuGet.Tool.nuspec</NuspecFile>
22+
</PropertyGroup>
23+
<ItemGroup Condition="'$(PackAsTool)' == 'true'">
24+
<None Update="DotNetToolSettings.xml">
25+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
26+
</None>
27+
</ItemGroup>
1828

1929
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2030
<DebugSymbols>true</DebugSymbols>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<DotNetCliTool Version="1">
3+
<Commands>
4+
<Command Name="nuget-plugin-microsoft-artifacts-credential-provider" EntryPoint="CredentialProvider.Microsoft.dll" Runner="dotnet" />
5+
</Commands>
6+
</DotNetCliTool>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
3+
<metadata>
4+
<id>Microsoft.Artifacts.CredentialProvider.NuGet.Tool</id>
5+
<version>$Version$</version>
6+
<title>Microsoft Credential Provider tool for NuGet</title>
7+
<authors>Microsoft</authors>
8+
<owners>microsoft,nugetvss</owners>
9+
<description>The Microsoft Credential Provider tool enables the .NET CLI to authenticate with Azure Artifacts feeds. Use this tool to seamlessly restore and publish packages from secured feeds. For more information, see: http://docs.nuget.org/Consume/Credential-Providers</description>
10+
<licenseUrl>http://go.microsoft.com/fwlink/?LinkId=329770</licenseUrl>
11+
<projectUrl>http://go.microsoft.com/fwlink/?LinkId=623217</projectUrl>
12+
<iconUrl>http://go.microsoft.com/fwlink/?LinkId=615568</iconUrl>
13+
<requireLicenseAcceptance>true</requireLicenseAcceptance>
14+
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
15+
<tags>Microsoft Visual Studio Team Services VSTS VSO VisualStudio Package Management NuGet</tags>
16+
<packageTypes>
17+
<packageType name="DotnetTool" />
18+
</packageTypes>
19+
20+
</metadata>
21+
<files>
22+
<file src="ThirdPartyNotices.txt" target="\" />
23+
<file src="EULA_Microsoft Visual Studio Team Services Credential Provider.docx" target="\" />
24+
<file src="bin\$Configuration$\net8.0\publish\**\*.*" target="tools\net8.0\any" />
25+
</files>
26+
</package>

0 commit comments

Comments
 (0)