From 87248e7ec104bb6b068b23078b872972b9496296 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Tue, 9 Apr 2024 17:20:15 -0300 Subject: [PATCH] Remove submodule for gcm and use tool package instead We need to tweak a bit the reference since the package is a tool-only package. We'd need to match the .NET version in the tool to avoid mismatch in reference assemblies, moving forward. This means we have to bump to .NET7 also. --- .gitmodules | 4 --- File.sln | 41 --------------------------- external/.editorconfig | 3 -- external/gcm | 1 - src/Directory.props | 4 --- src/File/AppPath.cs | 5 ++-- src/File/File.csproj | 20 +++++++------ src/File/Http/AzureRepoAuthHandler.cs | 2 +- src/File/Http/BitbucketAuthHandler.cs | 2 +- src/File/Http/GitHubAuthHandler.cs | 2 +- src/Tests/Tests.csproj | 2 +- 11 files changed, 18 insertions(+), 68 deletions(-) delete mode 100644 .gitmodules delete mode 100644 external/.editorconfig delete mode 160000 external/gcm diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0a8032c..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "external/gcm"] - path = external/gcm - url = https://github.com/GitCredentialManager/git-credential-manager - branch = main diff --git a/File.sln b/File.sln index d620771..b4a5a89 100644 --- a/File.sln +++ b/File.sln @@ -3,29 +3,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.2.32616.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8722AC17-A90B-406B-850A-C1B8EB89056D}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - .netconfig = .netconfig - src\Directory.props = src\Directory.props - src\Directory.targets = src\Directory.targets - readme.md = readme.md - EndProjectSection -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "File", "src\File\File.csproj", "{F98A74FE-B9B7-49EF-9E00-1911B4E244CB}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GCM", "GCM", "{F0D2DF05-3B25-467D-B27B-5D697C6ADE85}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHub", "external\gcm\src\shared\GitHub\GitHub.csproj", "{16C29C1C-E248-4DF5-84DA-DDF0D2ADD235}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Atlassian.Bitbucket", "external\gcm\src\shared\Atlassian.Bitbucket\Atlassian.Bitbucket.csproj", "{F51AD403-4C4B-4A09-AA7A-0C432982748E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AzureRepos", "external\gcm\src\shared\Microsoft.AzureRepos\Microsoft.AzureRepos.csproj", "{2E5862BA-4B16-4619-9EAA-D347D39F728F}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "src\Tests\Tests.csproj", "{86915414-399F-4B91-99C6-D64C987D9BF9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "external\gcm\src\shared\Core\Core.csproj", "{A5295AF2-1260-45D9-B1CC-055685EA87AE}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -36,36 +17,14 @@ Global {F98A74FE-B9B7-49EF-9E00-1911B4E244CB}.Debug|Any CPU.Build.0 = Debug|Any CPU {F98A74FE-B9B7-49EF-9E00-1911B4E244CB}.Release|Any CPU.ActiveCfg = Release|Any CPU {F98A74FE-B9B7-49EF-9E00-1911B4E244CB}.Release|Any CPU.Build.0 = Release|Any CPU - {16C29C1C-E248-4DF5-84DA-DDF0D2ADD235}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {16C29C1C-E248-4DF5-84DA-DDF0D2ADD235}.Debug|Any CPU.Build.0 = Debug|Any CPU - {16C29C1C-E248-4DF5-84DA-DDF0D2ADD235}.Release|Any CPU.ActiveCfg = Release|Any CPU - {16C29C1C-E248-4DF5-84DA-DDF0D2ADD235}.Release|Any CPU.Build.0 = Release|Any CPU - {F51AD403-4C4B-4A09-AA7A-0C432982748E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F51AD403-4C4B-4A09-AA7A-0C432982748E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F51AD403-4C4B-4A09-AA7A-0C432982748E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F51AD403-4C4B-4A09-AA7A-0C432982748E}.Release|Any CPU.Build.0 = Release|Any CPU - {2E5862BA-4B16-4619-9EAA-D347D39F728F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E5862BA-4B16-4619-9EAA-D347D39F728F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E5862BA-4B16-4619-9EAA-D347D39F728F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E5862BA-4B16-4619-9EAA-D347D39F728F}.Release|Any CPU.Build.0 = Release|Any CPU {86915414-399F-4B91-99C6-D64C987D9BF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {86915414-399F-4B91-99C6-D64C987D9BF9}.Debug|Any CPU.Build.0 = Debug|Any CPU {86915414-399F-4B91-99C6-D64C987D9BF9}.Release|Any CPU.ActiveCfg = Release|Any CPU {86915414-399F-4B91-99C6-D64C987D9BF9}.Release|Any CPU.Build.0 = Release|Any CPU - {A5295AF2-1260-45D9-B1CC-055685EA87AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A5295AF2-1260-45D9-B1CC-055685EA87AE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A5295AF2-1260-45D9-B1CC-055685EA87AE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A5295AF2-1260-45D9-B1CC-055685EA87AE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {16C29C1C-E248-4DF5-84DA-DDF0D2ADD235} = {F0D2DF05-3B25-467D-B27B-5D697C6ADE85} - {F51AD403-4C4B-4A09-AA7A-0C432982748E} = {F0D2DF05-3B25-467D-B27B-5D697C6ADE85} - {2E5862BA-4B16-4619-9EAA-D347D39F728F} = {F0D2DF05-3B25-467D-B27B-5D697C6ADE85} - {A5295AF2-1260-45D9-B1CC-055685EA87AE} = {F0D2DF05-3B25-467D-B27B-5D697C6ADE85} - EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {19B804F2-469A-40CA-9387-C9C1F7D231E8} EndGlobalSection diff --git a/external/.editorconfig b/external/.editorconfig deleted file mode 100644 index 0fba185..0000000 --- a/external/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -# ignore submodule -[gcm/**] -generated_code = true \ No newline at end of file diff --git a/external/gcm b/external/gcm deleted file mode 160000 index cf5a693..0000000 --- a/external/gcm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cf5a6933a62e1c1943cf4a76b25d22ff4f9df0c2 diff --git a/src/Directory.props b/src/Directory.props index 8945187..2df4361 100644 --- a/src/Directory.props +++ b/src/Directory.props @@ -7,10 +7,6 @@ $(PackOnBuild) $(MSBuildThisFileDirectory)..\bin - - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\ThisAssembly\bin'));$(RestoreSources) - $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\dotnet-config\bin'));$(RestoreSources) - https://clarius.org/dotnet-file false diff --git a/src/File/AppPath.cs b/src/File/AppPath.cs index e6fef31..b0c0a2c 100644 --- a/src/File/AppPath.cs +++ b/src/File/AppPath.cs @@ -1,8 +1,9 @@ -using GitCredentialManager; +using System; +using GitCredentialManager; namespace Devlooped; static class AppPath { - public static string Default { get; } = ApplicationBase.GetEntryApplicationPath(); + public static string Default { get; } = CommandContext.GetEntryApplicationPath(); } diff --git a/src/File/File.csproj b/src/File/File.csproj index 2332083..83688d2 100644 --- a/src/File/File.csproj +++ b/src/File/File.csproj @@ -1,10 +1,10 @@ - + A dotnet global tool for downloading and updating loose files from arbitrary URLs. Exe - net6.0 + net7.0 Major file @@ -23,19 +23,21 @@ - + - + + - - - - - + + + + + + \ No newline at end of file diff --git a/src/File/Http/AzureRepoAuthHandler.cs b/src/File/Http/AzureRepoAuthHandler.cs index e6fcdfc..4fbe5a2 100644 --- a/src/File/Http/AzureRepoAuthHandler.cs +++ b/src/File/Http/AzureRepoAuthHandler.cs @@ -46,7 +46,7 @@ protected override async Task SendAsync(HttpRequestMessage ["path"] = uri.GetComponents(UriComponents.Path, UriFormat.Unescaped), }); - var provider = new AzureReposHostProvider(new CommandContext(AppPath.Default)); + var provider = new AzureReposHostProvider(new CommandContext()); credential = await provider.GetCredentialAsync(input); return credential; diff --git a/src/File/Http/BitbucketAuthHandler.cs b/src/File/Http/BitbucketAuthHandler.cs index b60c7df..e043510 100644 --- a/src/File/Http/BitbucketAuthHandler.cs +++ b/src/File/Http/BitbucketAuthHandler.cs @@ -48,7 +48,7 @@ async Task GetCredentialAsync(Uri uri) ["path"] = uri.GetComponents(UriComponents.Path, UriFormat.Unescaped), }); - var provider = new BitbucketHostProvider(new CommandContext(AppPath.Default)); + var provider = new BitbucketHostProvider(new CommandContext()); credential = await provider.GetCredentialAsync(input); return credential; diff --git a/src/File/Http/GitHubAuthHandler.cs b/src/File/Http/GitHubAuthHandler.cs index d93da4f..ec4ac80 100644 --- a/src/File/Http/GitHubAuthHandler.cs +++ b/src/File/Http/GitHubAuthHandler.cs @@ -49,7 +49,7 @@ async Task GetCredentialAsync() ["host"] = "github.com", }); - var provider = new GitHubHostProvider(new CommandContext(AppPath.Default)); + var provider = new GitHubHostProvider(new CommandContext()); credential = await provider.GetCredentialAsync(input); return credential; diff --git a/src/Tests/Tests.csproj b/src/Tests/Tests.csproj index 1136ec7..255225a 100644 --- a/src/Tests/Tests.csproj +++ b/src/Tests/Tests.csproj @@ -2,7 +2,7 @@ File.Tests - net6.0 + net8.0 false