From 41b5c9a5fcf7861a63398ba73c011e273e2836da Mon Sep 17 00:00:00 2001 From: Javad Rahnama Date: Tue, 11 Jun 2024 14:53:27 -0700 Subject: [PATCH] Add | Add SourceLink translation (#2552) --- build.proj | 3 ++ src/Directory.Build.props | 8 ++---- tools/targets/RepositoryInfo.targets | 41 ++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 tools/targets/RepositoryInfo.targets diff --git a/build.proj b/build.proj index 7f04e9159c..24fa2b3c01 100644 --- a/build.proj +++ b/build.proj @@ -6,6 +6,9 @@ + + false + src\NuGet.config Debug AnyCPU diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 1fa393eccb..b1d427fd7b 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -80,12 +80,7 @@ true - - - - - - + @@ -95,6 +90,7 @@ + diff --git a/tools/targets/RepositoryInfo.targets b/tools/targets/RepositoryInfo.targets new file mode 100644 index 0000000000..c62efed34a --- /dev/null +++ b/tools/targets/RepositoryInfo.targets @@ -0,0 +1,41 @@ + + + + + + false + false + false + + + + + + + + true + <_TranslateUrlPattern>https://[^/]+/ADO.Net/_git/([^/-]+)-(.+) + <_TranslateUrlReplacement>https://github.com/dotnet/SqlClient + + + + + + $([System.Text.RegularExpressions.Regex]::Replace($(ScmRepositoryUrl), $(_TranslateUrlPattern), $(_TranslateUrlReplacement))) + + + + + + + $([System.Text.RegularExpressions.Regex]::Replace(%(SourceRoot.ScmRepositoryUrl), + $(_TranslateUrlPattern), $(_TranslateUrlReplacement))) + + + + +