diff --git a/src/Microsoft.TestPlatform.Build/Microsoft.TestPlatform.targets b/src/Microsoft.TestPlatform.Build/Microsoft.TestPlatform.targets index caf0e409cc..b8540e13c9 100644 --- a/src/Microsoft.TestPlatform.Build/Microsoft.TestPlatform.targets +++ b/src/Microsoft.TestPlatform.Build/Microsoft.TestPlatform.targets @@ -17,7 +17,7 @@ Copyright (c) .NET Foundation. All rights reserved. $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - + - - + + @@ -48,15 +48,20 @@ Copyright (c) .NET Foundation. All rights reserved. VSTestBlame="$(VSTestBlame)" VSTestTraceDataCollectorDirectoryPath="$(TraceDataCollectorDirectoryPath)" VSTestNoLogo="$(VSTestNoLogo)" + Condition="'$(IsTestProject)' == 'true'" /> + + + + - + - + diff --git a/src/Microsoft.TestPlatform.Build/Resources/Resources.Designer.cs b/src/Microsoft.TestPlatform.Build/Resources/Resources.Designer.cs index d58f7be295..f897fa84d0 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/Resources.Designer.cs +++ b/src/Microsoft.TestPlatform.Build/Resources/Resources.Designer.cs @@ -79,6 +79,15 @@ internal static string BuildStarted { } } + /// + /// Looks up a localized string similar to Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file.. + /// + internal static string NoIsTestProjectProperty { + get { + return ResourceManager.GetString("NoIsTestProjectProperty", resourceCulture); + } + } + /// /// Looks up a localized string similar to Test run for {0}({1}). /// @@ -87,7 +96,7 @@ internal static string TestRunningSummary { return ResourceManager.GetString("TestRunningSummary", resourceCulture); } } - + /// /// Looks up a localized string similar to Warning: Update the Microsoft.NET.Test.Sdk package reference to version 15.8.0 or later to collect code coverage.. /// diff --git a/src/Microsoft.TestPlatform.Build/Resources/Resources.resx b/src/Microsoft.TestPlatform.Build/Resources/Resources.resx index 9503166ec9..1ccc902438 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/Resources.resx +++ b/src/Microsoft.TestPlatform.Build/Resources/Resources.resx @@ -123,6 +123,9 @@ Build started, please wait... + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Test run for {0}({1}) diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.cs.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.cs.xlf index 3dbe6537a8..73e4b62697 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.cs.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.cs.xlf @@ -40,6 +40,11 @@ Upozornění: Aktualizujte odkaz na balíček Microsoft.NET.Test.Sdk na verzi 15.8.0 nebo novější, aby se získalo pokrytí kódu. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.de.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.de.xlf index 771800110e..3918481d28 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.de.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.de.xlf @@ -40,6 +40,11 @@ Warnung: Aktualisieren Sie die Microsoft.NET.Test.Sdk-Paketreferenz auf Version 15.8.0 oder höher, um von Code Coverage zu profitieren. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.es.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.es.xlf index d3b18a4c59..e5be7eb818 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.es.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.es.xlf @@ -40,6 +40,11 @@ Advertencia: Actualice la referencia del paquete Microsoft.NET.Test.Sdk a la versión 15.8.0 o posterior para recopilar la cobertura de código. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.fr.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.fr.xlf index 18ad2a61ad..c4e40ba7dc 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.fr.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.fr.xlf @@ -40,6 +40,11 @@ Avertissement : mettez à jour la référence de package Microsoft.NET.Test.Sdk vers la version 15.8.0 ou ultérieure pour collecter la couverture du code. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.it.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.it.xlf index d943932602..1911510647 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.it.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.it.xlf @@ -40,6 +40,11 @@ Avviso: per raccogliere i dati di code coverage, aggiornare il riferimento al pacchetto Microsoft.NET.Test.Sdk alla versione 15.8.0 o successiva. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ja.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ja.xlf index 8f8c051492..bd4e75f13e 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ja.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ja.xlf @@ -40,6 +40,11 @@ 警告: コード カバレッジを収集するには、Microsoft.NET.Test.Sdk パッケージ参照をバージョン 15.8.0 以降に更新してください。 + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ko.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ko.xlf index 51031157d8..581facc787 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ko.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ko.xlf @@ -40,6 +40,11 @@ 경고: 코드 검사를 수집하려면 Microsoft.NET.Test.Sdk 패키지 참조를 버전 15.8.0 이상으로 업데이트하세요. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pl.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pl.xlf index fdd1e55cf7..fbe4f19cd5 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pl.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pl.xlf @@ -40,6 +40,11 @@ Ostrzeżenie: zaktualizuj odwołanie do pakietu Microsoft.NET.Test.Sdk do wersji 15.8.0 lub nowszej w celu zbierania danych dotyczących pokrycia kodu. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pt-BR.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pt-BR.xlf index d9273161de..b4ae6bd3a2 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pt-BR.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.pt-BR.xlf @@ -40,6 +40,11 @@ Aviso: Atualize a referência do pacote Microsoft.NET.Test.Sdk para a versão 15.8.0 ou posterior para coletar a cobertura do código. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ru.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ru.xlf index bd65c10507..97158ae58a 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ru.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.ru.xlf @@ -40,6 +40,11 @@ Внимание. Для сбора данных об объеме протестированного кода обновите пакет Microsoft.NET.Test.Sdk по ссылке как минимум до версии 15.8.0. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.tr.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.tr.xlf index 45641d6b8a..dbff2a3e7e 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.tr.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.tr.xlf @@ -40,6 +40,11 @@ Uyarı: Kod kapsamını toplamak için Microsoft.NET.Test.Sdk paketinin başvurusunu 15.8.0 veya üzeri bir sürüme güncelleştirin. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.xlf index 95c5fe5932..c614274805 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.xlf @@ -22,6 +22,11 @@ To collect code coverage update Microsoft.NET.Test.Sdk package version to latest. + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hans.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hans.xlf index cf0ed2964c..ca670cdcc6 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hans.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hans.xlf @@ -40,6 +40,11 @@ 警告: 将 Microsoft.NET.Test.Sdk 包引用更新为版本 15.8.0 或更高版本,以便收集代码覆盖率。 + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hant.xlf b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hant.xlf index c45edb39b8..33d43a74c2 100644 --- a/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hant.xlf +++ b/src/Microsoft.TestPlatform.Build/Resources/xlf/Resources.zh-Hant.xlf @@ -40,6 +40,11 @@ 警告: 將 Microsoft.NET.Test.Sdk 套件參考更新至版本 15.8.0 或更新版本,才可收集程式碼涵蓋範圍。 + + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + Skipping running test for project {0}. To run tests with dotnet test add "<IsTestProject>true<IsTestProject>" property to project file. + + \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.Build/Tasks/BuildLogTask.cs b/src/Microsoft.TestPlatform.Build/Tasks/VSTestLogsTask.cs similarity index 52% rename from src/Microsoft.TestPlatform.Build/Tasks/BuildLogTask.cs rename to src/Microsoft.TestPlatform.Build/Tasks/VSTestLogsTask.cs index a740000315..d7878367dd 100644 --- a/src/Microsoft.TestPlatform.Build/Tasks/BuildLogTask.cs +++ b/src/Microsoft.TestPlatform.Build/Tasks/VSTestLogsTask.cs @@ -7,9 +7,15 @@ namespace Microsoft.TestPlatform.Build.Tasks using Microsoft.Build.Utilities; using Microsoft.TestPlatform.Build.Resources; - public class BuildLogTask : Task + public class VSTestLogsTask : Task { - public bool BuildStarted + public string LogType + { + get; + set; + } + + public string ProjectFilePath { get; set; @@ -17,15 +23,24 @@ public bool BuildStarted public override bool Execute() { - if (BuildStarted) + if (string.Equals(LogType, "BuildStarted", StringComparison.OrdinalIgnoreCase)) { Console.WriteLine(Resources.BuildStarted); } - else + else if (string.Equals(LogType, "BuildCompleted", StringComparison.OrdinalIgnoreCase)) { Console.WriteLine(Resources.BuildCompleted); Console.WriteLine(); } + else if (string.Equals(LogType, "NoIsTestProjectProperty", StringComparison.OrdinalIgnoreCase)) + { + Console.WriteLine(Resources.NoIsTestProjectProperty, ProjectFilePath); + } + else + { + return false; + } + return true; } }