From 152437d300464aaf9b1f6faae6aacad9563f6ade Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 8 Aug 2023 22:34:50 -0400 Subject: [PATCH 1/4] [workloads] Add telemetry for mobile and wasm workloads This change adds CLI telemetry for common mobile and wasm scenarios. --- ...ad.Mono.Toolchain.Current.Manifest.pkgproj | 2 + .../WorkloadManifest.targets.in | 3 ++ .../WorkloadTelemetry.targets | 45 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest.pkgproj b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest.pkgproj index 97cffee7065eb..e327fcf2635a2 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest.pkgproj +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest.pkgproj @@ -18,12 +18,14 @@ $(IntermediateOutputPath)WorkloadManifest.json $(IntermediateOutputPath)WorkloadManifest.targets $(IntermediateOutputPath)WorkloadManifest.Wasi.targets + $(MSBuildThisFileDirectory)WorkloadTelemetry.targets + diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in index 3a551a646e5cf..0a70b941fc1a2 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadManifest.targets.in @@ -191,4 +191,7 @@ BeforeTargets="Build"> + + diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets new file mode 100644 index 0000000000000..f8427c572e4c0 --- /dev/null +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + <_WorkloadUsesBlazorWasm>$(UsingMicrosoftNETSdkBlazorWebAssembly) + <_WorkloadUsesWasmSDK>$(UsingMicrosoftNETSdkWebAssembly) + <_WorkloadUsesMonoAOT>$(RunAOTCompilation) + <_WorkloadUsesMonoAOT Condition="'$(RunAOTCompilation)' == '' and '$(PublishAot)' != 'true' and ('$(TargetPlatformIdentifier)' == 'maccatalyst' or '$(TargetPlatformIdentifier)' == 'ios' or '$(TargetPlatformIdentifier)' == 'tvos')">$(_RunAotCompiler) + <_WorkloadUsesNativeAOT>$(PublishAot) + <_WorkloadUsesInterpreter>$(MonoForceInterpreter) + <_WorkloadUsesInterpreter Condition="'$(_WorkloadUsesInterpreter)' == '' and '$(UseInterpreter)' == 'true'">true + <_WorkloadUsesInterpreter Condition="'$(_WorkloadUsesInterpreter)' == '' and '$(RunAOTCompilation)' != 'true' and ('$(_WorkloadUsesBlazorWasm)' == 'true' or '$(_WorkloadUsesWasmSDK)' == 'true')">true + <_WorkloadUsesLibraryMode Condition="'$(NativeLib)' != '' and ('$(_WorkloadUsesMonoAOT)' == 'true' or '$(_WorkloadUsesNativeAOT)' == 'true')">true + + + + <_WorkloadUsesAvalonia Condition="'$([System.IO.Path]::GetFileName(%(ReferencePath.Identity)).ToLower())' == 'avalonia.dll'">true + <_WorkloadUsesUno Condition="'$([System.IO.Path]::GetFileName(%(ReferencePath.Identity)).ToLower())' == 'uno.dll'">true + + + \ No newline at end of file From 680311496ab659357308571c558198688713b141 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 8 Aug 2023 22:46:42 -0400 Subject: [PATCH 2/4] Space --- .../WorkloadTelemetry.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets index f8427c572e4c0..86569eccdc321 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets @@ -42,4 +42,4 @@ <_WorkloadUsesUno Condition="'$([System.IO.Path]::GetFileName(%(ReferencePath.Identity)).ToLower())' == 'uno.dll'">true - \ No newline at end of file + From 5aabde80317ae0da88235b074146052a9303fb3f Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 9 Aug 2023 10:07:05 -0400 Subject: [PATCH 3/4] Use TargetsCurrent as a check instead of TargetsNet8 --- .../WorkloadTelemetry.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets index 86569eccdc321..d142c805abf96 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets @@ -1,7 +1,7 @@ From 651a8ec5fc62d6f76bd7181eb79a3184d1946928 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Fri, 11 Aug 2023 13:36:36 -0400 Subject: [PATCH 4/4] Use other instead of being explicit about external app frameworks --- .../WorkloadTelemetry.targets | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets index d142c805abf96..f9cd6efe170a2 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets @@ -8,11 +8,11 @@ - - - + + + @@ -38,8 +38,9 @@ - <_WorkloadUsesAvalonia Condition="'$([System.IO.Path]::GetFileName(%(ReferencePath.Identity)).ToLower())' == 'avalonia.dll'">true - <_WorkloadUsesUno Condition="'$([System.IO.Path]::GetFileName(%(ReferencePath.Identity)).ToLower())' == 'uno.dll'">true + <_WorkloadUsesOther Condition="'$([System.IO.Path]::GetFileName(%(ReferencePath.Identity)).ToLower())' == 'avalonia.dll'">true + <_WorkloadUsesOther Condition="'$([System.IO.Path]::GetFileName(%(ReferencePath.Identity)).ToLower())' == 'uno.dll'">true + <_WorkloadUsesMobileSDKOnly Condition="'$(RuntimeIdentifier)' != 'browser-wasm' and '$(UseMaui)' != 'true' and '$(_WorkloadUsesOther)' != 'true'">true