Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<SystemReflectionMetadataVersion>1.8.1</SystemReflectionMetadataVersion>
<SystemValueTupleVersion>4.5.0</SystemValueTupleVersion>
<SystemTextJsonVersion>4.7.2</SystemTextJsonVersion>
<XunitCombinatorialVersion>1.5.25</XunitCombinatorialVersion>
<!-- libgit2 used for integration tests -->
<LibGit2SharpVersion>0.27.0-preview-0119</LibGit2SharpVersion>
</PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/Common/CommonResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,10 @@
<data name="UnableToDetermineRepositoryUrl" xml:space="preserve">
<value>Unable to determine repository url, the source code won't be available via source link.</value>
</data>
<data name="NoWellFormedHostUrisSpecified" xml:space="preserve">
<value>No well-formed host URIs specified: {0}.</value>
</data>
<data name="IgnoringInvalidHostName" xml:space="preserve">
<value>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</value>
</data>
</root>
10 changes: 9 additions & 1 deletion src/Common/GetSourceLinkUrlGitTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public abstract class GetSourceLinkUrlGitTask : Task
protected const string NotApplicableValue = "N/A";
private const string ContentUrlMetadataName = "ContentUrl";

[Required, NotNull]
/// <summary>
/// Optional, but null is elimated when the task starts executing.
/// </summary>
public ITaskItem? SourceRoot { get; set; }

/// <summary>
Expand Down Expand Up @@ -65,6 +67,12 @@ public override bool Execute()

private void ExecuteImpl()
{
// Avoid errors when no SourceRoot is specified, _InitializeXyzGitSourceLinkUrl target will simply not update any SourceRoots.
if (SourceRoot == null)
{
return;
}

// skip SourceRoot that already has SourceLinkUrl set, or its SourceControl is not "git":
if (!string.IsNullOrEmpty(SourceRoot.GetMetadata(Names.SourceRoot.SourceLinkUrl)) ||
!string.Equals(SourceRoot.GetMetadata(Names.SourceRoot.SourceControl), SourceControlName, StringComparison.OrdinalIgnoreCase))
Expand Down
10 changes: 8 additions & 2 deletions src/Common/TranslateRepositoryUrlGitTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ public override bool Execute()

private void ExecuteImpl()
{
// Assign translated roots even when the task fails (or no Hosts were specified) to avoid cascading errors.
TranslatedSourceRoots = SourceRoots;

var hostUris = GetHostUris().ToArray();
if (hostUris.Length == 0)
{
Log.LogMessage(CommonResources.NoWellFormedHostUrisSpecified, "'" + string.Join("','", (Hosts ?? Array.Empty<ITaskItem>()).Select(h => h.ItemSpec)) + "'");
return;
}

Expand Down Expand Up @@ -78,8 +82,6 @@ static bool isMatchingHostUri(Uri hostUri, Uri uri)
return;
}

TranslatedSourceRoots = SourceRoots;

if (TranslatedSourceRoots != null)
{
foreach (var sourceRoot in TranslatedSourceRoots)
Expand Down Expand Up @@ -120,6 +122,10 @@ private IEnumerable<Uri> GetHostUris()
{
yield return hostUri;
}
else
{
Log.LogWarning(CommonResources.IgnoringInvalidHostName, item.ItemSpec);
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">Skupina položek {0} je prázdná. Kvůli generování zdrojového odkazu se vyžaduje alespoň jeden hostitel úložiště {1}.</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">Položka {0} ve skupině položek {1} musí uvádět metadata {2}.</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">Nejde určit adresu URL úložiště. Zdrojový kód nebude k dispozici přes odkaz na zdroj.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">Die Elementgruppe "{0}" ist leer. Mindestens ein {1}-Repositoryhost wird benötigt, um SourceLink zu generieren.</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">Das Element "{0}" der Elementgruppe "{1}" muss die Metadaten "{2}" angeben.</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">Die URL für das Repository konnte nicht ermittelt werden. Daher ist der Quellcode nicht über die Quellverknüpfung verfügbar.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">El grupo de elementos {0} está vacío. Se requiere al menos un repositorio {1} a fin de generar SourceLink.</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">El elemento "{0}" del grupo de elementos "{1}" debe especificar los metadatos "{2}"</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">No se puede determinar la URL del repositorio, el código fuente no estará disponible a través del vínculo de origen.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">Le groupe d'éléments {0} est vide. Au moins un hôte de dépôt {1} est nécessaire pour générer SourceLink.</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">L'élément '{0}' du groupe d'éléments '{1}' doit spécifier les métadonnées '{2}'</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">Impossible de déterminer l'URL du dépôt, le code source n'est pas disponible via Source Link.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">Il gruppo di elementi {0} è vuoto. Per generare SourceLink, è necessario almeno un host di repository di {1}.</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">L'elemento '{0}' del gruppo di elementi '{1}' deve specificare i metadati '{2}'</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">Non è possibile determinare l'URL del repository. Il codice sorgente non sarà disponibile tramite il collegamento all'origine.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">{0} 項目グループが空です。SourceLink を生成するには、少なくとも 1 つの {1} リポジトリ ホストが必要です。</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">項目グループ '{1}' の項目 '{0}' には、メタデータ '{2}' を指定する必要があります</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">リポジトリのURLを特定できません。ソース リンクを使用してソース コードを利用できません。</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">{0} 항목 그룹이 비어 있습니다. SourceLink를 생성하려면 {1} 리포지토리 호스트가 하나 이상 필요합니다.</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">항목 그룹 '{1}'의 '{0}' 항목은 '{2}' 메타데이터를 지정해야 합니다.</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">리포지토리 URL을 확인할 수 없으며, 소스 링크를 통해 소스 코드를 사용할 수 없습니다.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">Grupa elementów {0} jest pusta. Wymagany jest co najmniej jeden host repozytorium {1} w celu wygenerowania elementu SourceLink.</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">Element „{0}” grupy elementów „{1}” musi określać metadane „{2}”.</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">Nie można określić adresu URL repozytorium, kod źródłowy nie będzie dostępny za pośrednictwem linku do źródła.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">O grupo de itens {0} está vazio. Pelo menos um host de repositório {1} é necessário para gerar o SourceLink.</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">Item '{0}' do grupo de item '{1}' deve especificar metadados '{2}'</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">Não é possível determinar a URL do repositório, o código-fonte não estará disponível através do source link.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">Группа элементов {0} пуста. Для создания SourceLink нужно указать хотя бы один хост репозитория {1}.</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">Необходимо указать метаданные '{2}' для элемента '{0}' в группе элементов '{1}'</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">Не удается определить URL-адрес репозитория, исходный код не будет доступен по исходной ссылке.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">{0} öğe grubu boş. SourceLink oluşturmak için en az bir {1} depo konağı gereklidir.</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">'{1}' öğe grubunun '{0}' öğesi, '{2}' meta verilerini belirtmelidir</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">Depo URL'si belirlenemiyor. Kaynak kod, kaynak bağlantısı aracılığıyla kullanılamayacak.</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Common/xlf/CommonResources.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
<target state="translated">{0} 项目组为空。至少需要一个 {1} 存储库主机才能生成 SourceLink。</target>
<note />
</trans-unit>
<trans-unit id="IgnoringInvalidHostName">
<source>Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</source>
<target state="new">Ignoring invalid host name: '{0}' -- expected 'domain[:port]'.</target>
<note />
</trans-unit>
<trans-unit id="ItemOfItemGroupMustSpecifyMetadata">
<source>Item '{0}' of item group '{1}' must specify metadata '{2}'</source>
<target state="translated">项组 "{1}" 的项 "{0}" 必须指定元数据 "{2}"</target>
<note />
</trans-unit>
<trans-unit id="NoWellFormedHostUrisSpecified">
<source>No well-formed host URIs specified: {0}.</source>
<target state="new">No well-formed host URIs specified: {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnableToDetermineRepositoryUrl">
<source>Unable to determine repository url, the source code won't be available via source link.</source>
<target state="translated">无法确定仓库 URL,源代码将无法通过源链接获得。</target>
Expand Down
Loading