diff --git a/eng/targets/Npm.Common.props b/eng/targets/Npm.Common.props index 6caffd7d56d4df2623d34039b1dce363b8a34ce2..fc5390a3344be39ebeafecdbbc5e6c9a251a150a 100644 --- a/eng/targets/Npm.Common.props +++ b/eng/targets/Npm.Common.props @@ -5,4 +5,10 @@ <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> <PackOnBuild>false</PackOnBuild> </PropertyGroup> + + <!-- Properties to control how we handle warnings when using the tasks provided by the Yarn MSBuild SDK --> + <PropertyGroup> + <IgnoreYarnWarnings>false</IgnoreYarnWarnings> + <IgnoreYarnWarnings Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</IgnoreYarnWarnings> + </PropertyGroup> </Project> diff --git a/eng/targets/Npm.Common.targets b/eng/targets/Npm.Common.targets index f216bf5f9c0e6d2ec9040042135223f9b0f73036..10ff37ab61e3f4617e6b4ff4182b901314dcfff9 100644 --- a/eng/targets/Npm.Common.targets +++ b/eng/targets/Npm.Common.targets @@ -76,7 +76,7 @@ DependsOnTargets="GetBuildInputCacheFile" Inputs="@(TSFiles);$(BaseIntermediateOutputPath)tsfiles.cache" Outputs="@(BuildOutputFiles)"> - <Yarn Command="$(NpmBuildArgs)" StandardOutputImportance="High" StandardErrorImportance="High" /> + <Yarn Command="$(NpmBuildArgs)" StandardOutputImportance="High" StandardErrorImportance="High" IgnoreStandardErrorWarningFormat="$(IgnoreYarnWarnings)" /> <WriteLinesToFile Overwrite="true" File="$(BaseIntermediateOutputPath)build-sentinel" /> </Target> @@ -102,9 +102,9 @@ <Copy SourceFiles="$(PackageJson)" DestinationFiles="$(_BackupPackageJson)" /> - <Yarn Command="version --no-git-tag-version --new-version $(PackageVersion)" /> + <Yarn Command="version --no-git-tag-version --new-version $(PackageVersion)" IgnoreStandardErrorWarningFormat="$(IgnoreYarnWarnings)" /> <Exec Command="node "$(MSBuildThisFileDirectory)..\scripts\update-packagejson-links.js" "$(PackageJson)" $(PackageVersion)" /> - <Yarn Command="pack --filename $(PackageFileName)" /> + <Yarn Command="pack --filename $(PackageFileName)" IgnoreStandardErrorWarningFormat="$(IgnoreYarnWarnings)" /> <Move SourceFiles="$(_PackageTargetPath)" DestinationFolder="$(PackageOutputPath)" /> <Message Importance="High" Text="$(MSBuildProjectName) -> $(_PackageTargetPath)" /> @@ -122,7 +122,7 @@ <Target Name="Test" Condition="'$(IsTestProject)' == 'true' AND '$(SkipTests)' != 'true'"> <Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Test" /> <Message Importance="High" Text="Running npm tests for $(MSBuildProjectName)" /> - <Yarn Command="$(NpmTestArgs)" StandardOutputImportance="High" StandardErrorImportance="High" /> + <Yarn Command="$(NpmTestArgs)" StandardOutputImportance="High" StandardErrorImportance="High" IgnoreStandardErrorWarningFormat="$(IgnoreYarnWarnings)" /> </Target> </Project>