Skip to content

Commit

Permalink
feat: Add support for C# 9.0 source generators
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Oct 14, 2020
1 parent 86a9169 commit 560e9b3
Show file tree
Hide file tree
Showing 50 changed files with 959 additions and 519 deletions.
4 changes: 4 additions & 0 deletions .vsts-ci.yml
Expand Up @@ -65,6 +65,10 @@ jobs:
parameters:
vmImage: '$(linuxVMImage)'

- template: build/ci/.azure-devops-wasm-cs9-preview-validation.yml
parameters:
vmImage: '$(linuxVMImage)'

- template: build/ci/.azure-devops-macos.yml
parameters:
vmImage: '$(macOSVMImage)'
Expand Down
45 changes: 30 additions & 15 deletions build/Uno.WinUI.nuspec
Expand Up @@ -22,7 +22,7 @@
<dependency id="Xamarin.AndroidX.AppCompat" version="1.1.0" />
<dependency id="Xamarin.AndroidX.RecyclerView" version="1.1.0" />
<dependency id="Xamarin.AndroidX.Fragment" version="1.1.0" />
<dependency id="Uno.SourceGenerationTasks" version="2.0.13" />
<dependency id="Uno.SourceGenerationTasks" version="3.0.0-dev.16" />
<dependency id="Uno.Core" version="2.0.0" />
<dependency id="Uno.Core.Build" version="2.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="1.0.4" />
Expand All @@ -33,31 +33,31 @@
<dependency id="Xamarin.AndroidX.Legacy.Support.V4" version="1.0.0" />
<dependency id="Xamarin.AndroidX.AppCompat" version="1.1.0" />
<dependency id="Xamarin.AndroidX.RecyclerView" version="1.1.0" />
<dependency id="Uno.SourceGenerationTasks" version="2.0.13" />
<dependency id="Uno.SourceGenerationTasks" version="3.0.0-dev.16" />
<dependency id="Uno.Core" version="2.0.0" />
<dependency id="Uno.Core.Build" version="2.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="1.0.4" />
</group>

<!-- iOS -->
<group targetFramework="xamarinios10">
<dependency id="Uno.SourceGenerationTasks" version="2.0.13" />
<dependency id="Uno.SourceGenerationTasks" version="3.0.0-dev.16" />
<dependency id="Uno.Core" version="2.0.0" />
<dependency id="Uno.Core.Build" version="2.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="1.0.4" />
</group>

<!-- macOS -->
<group targetFramework="xamarinmac20">
<dependency id="Uno.SourceGenerationTasks" version="2.0.13" />
<dependency id="Uno.SourceGenerationTasks" version="3.0.0-dev.16" />
<dependency id="Uno.Core" version="2.0.0" />
<dependency id="Uno.Core.Build" version="2.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="1.0.4" />
</group>

<!-- .NET Standard 2.0 -->
<group targetFramework="netstandard2.0">
<dependency id="Uno.SourceGenerationTasks" version="2.0.13" />
<dependency id="Uno.SourceGenerationTasks" version="3.0.0-dev.16" />
<dependency id="Uno.Core" version="2.0.0" />
<dependency id="Uno.Core.Build" version="2.0.0" />
<dependency id="System.Numerics.Vectors" version="4.5.0" />
Expand Down Expand Up @@ -248,16 +248,31 @@
<file src="..\src\Uno.Analyzers\Bin\Release\Uno.Analyzers.dll" target="analyzers" />
<file src="..\src\Uno.Analyzers\Bin\Release\Uno.Analyzers.pdb" target="analyzers" />

<!-- Source generators -->
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\Uno.UI.SourceGenerators.dll" target="tools" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\Uno.Xaml.dll" target="tools" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\Uno.Xaml.pdb" target="tools" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\Uno.UI.SourceGenerators.pdb" target="tools" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\Mono.Cecil*.dll" target="tools" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\Mono.Cecil*.pdb" target="tools" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\Microsoft.ApplicationInsights.dll" target="tools" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\System.Diagnostics.DiagnosticSource.dll" target="tools" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\Microsoft.DotNet.PlatformAbstractions.dll" target="tools" />
<!-- Uno Source generators -->
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\net461\Uno.UI.SourceGenerators.dll" target="tools/uno-sourcegen" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\net461\Uno.UI.SourceGenerators.pdb" target="tools/uno-sourcegen" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\net461\Uno.Xaml.dll" target="tools/uno-sourcegen" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\net461\Uno.Xaml.pdb" target="tools/uno-sourcegen" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\net461\Mono.Cecil*.dll" target="tools/uno-sourcegen" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\net461\Mono.Cecil*.pdb" target="tools/uno-sourcegen" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\net461\Microsoft.ApplicationInsights.dll" target="tools/uno-sourcegen" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\net461\System.Diagnostics.DiagnosticSource.dll" target="tools/uno-sourcegen" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\net461\Microsoft.DotNet.PlatformAbstractions.dll" target="tools/uno-sourcegen" />

<!-- Roslyn Source generators -->
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Uno.UI.SourceGenerators.dll" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Uno.UI.SourceGenerators.pdb" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Uno.Core.dll" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Uno.Xaml.dll" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Uno.Xaml.pdb" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Mono.Cecil*.dll" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Mono.Cecil*.pdb" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Microsoft.Extensions.Logging.dll" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\CommonServiceLocator.dll" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Microsoft.ApplicationInsights.dll" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\System.Diagnostics.DiagnosticSource.dll" target="analyzers/dotnet/cs" />
<file src="..\src\SourceGenerators\Uno.UI.SourceGenerators\Bin\Release\netstandard2.0\Microsoft.DotNet.PlatformAbstractions.dll" target="analyzers/dotnet/cs" />

<file src="..\src\SourceGenerators\Uno.UI.Tasks\Bin\Release\*.dll" target="buildTransitive\Uno.UI.Tasks" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Bin\Release\*.pdb" target="buildTransitive\Uno.UI.Tasks" />
Expand Down
39 changes: 39 additions & 0 deletions build/ci/.azure-devops-wasm-cs9-preview-validation.yml
@@ -0,0 +1,39 @@
parameters:
vmImage: ''

jobs:
- job: Wasm_cs9_preview_Build
container: nv-bionic-wasm

pool:
vmImage: ${{ parameters.vmImage }}

variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget

steps:
- checkout: self
clean: true

- bash: |
msbuild /r /p:Configuration=Release /p:LangVersion=preview /p:UnoUIUseRoslynSourceGenerators=true /p:MicrosoftNetCompilerVersionOverride=3.8.0-3.final src/SamplesApp/SamplesApp.Wasm/SamplesApp.Wasm.csproj /bl:$(build.artifactstagingdirectory)/build-cs9-preview-$(GitVersion.FullSemVer).binlog
displayName: 'Build sample app'
- task: CopyFiles@2
displayName: 'Publish Wasm Site'
condition: always()
inputs:
SourceFolder: $(build.sourcesdirectory)/src/SamplesApp/SamplesApp.Wasm/bin/Release/netstandard2.0/dist
Contents: '**/*.*'
TargetFolder: $(build.artifactstagingdirectory)/site-cs9-preview
CleanTargetFolder: false
OverWrite: false
flattenFolders: false

- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: wasm-uitest-binaries
ArtifactType: Container
6 changes: 1 addition & 5 deletions src/AddIns/Uno.UI.Lottie/Uno.UI.Lottie.Skia.csproj
Expand Up @@ -15,7 +15,7 @@

<ItemGroup>
<PackageReference Include="Uno.MonoAnalyzers" Version="1.0.0" />
<PackageReference Include="Uno.SourceGenerationTasks" Version="2.0.6" />
<PackageReference Include="Uno.SourceGenerationTasks" />
</ItemGroup>

<Import Project="..\..\Common.targets" />
Expand All @@ -25,10 +25,6 @@
<ProjectReference Include="..\..\Uno.UI\Uno.UI.Skia.csproj" />
</ItemGroup>

<PropertyGroup>
<UnoUIGeneratorsBinPath>..\..\SourceGenerators\Uno.UI.SourceGenerators\bin\$(Configuration)</UnoUIGeneratorsBinPath>
</PropertyGroup>

<Import Project="..\..\SourceGenerators\Uno.UI.SourceGenerators\Content\Uno.UI.SourceGenerators.props" />

<Target Name="_UnoUILottieOverrideNuget" AfterTargets="AfterBuild" DependsOnTargets="BuiltProjectOutputGroup" Condition="'$(UnoNugetOverrideVersion)'!=''">
Expand Down
6 changes: 1 addition & 5 deletions src/AddIns/Uno.UI.Lottie/Uno.UI.Lottie.Wasm.csproj
Expand Up @@ -25,7 +25,7 @@

<ItemGroup>
<PackageReference Include="Uno.MonoAnalyzers" Version="1.0.0" />
<PackageReference Include="Uno.SourceGenerationTasks" Version="2.0.6" />
<PackageReference Include="Uno.SourceGenerationTasks" />
</ItemGroup>

<Import Project="..\..\Common.targets" />
Expand All @@ -37,10 +37,6 @@
<ProjectReference Include="..\..\Uno.UI\Uno.UI.Wasm.csproj" />
</ItemGroup>

<PropertyGroup>
<UnoUIGeneratorsBinPath>..\..\SourceGenerators\Uno.UI.SourceGenerators\bin\$(Configuration)</UnoUIGeneratorsBinPath>
</PropertyGroup>

<Import Project="..\..\SourceGenerators\Uno.UI.SourceGenerators\Content\Uno.UI.SourceGenerators.props" />

<Target Name="_UnoUILottieOverrideNuget" AfterTargets="AfterBuild" DependsOnTargets="BuiltProjectOutputGroup" Condition="'$(UnoNugetOverrideVersion)'!=''">
Expand Down
6 changes: 1 addition & 5 deletions src/AddIns/Uno.UI.Lottie/Uno.UI.Lottie.csproj
Expand Up @@ -34,7 +34,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Uno.MonoAnalyzers" Version="1.0.0" />
<PackageReference Include="Uno.SourceGenerationTasks" Version="2.0.6" />
<PackageReference Include="Uno.SourceGenerationTasks" />
</ItemGroup>

<ItemGroup Condition=" $(IsMonoAndroid) or $(IsXamarinIOS) or $(IsXamarinMac) ">
Expand All @@ -57,10 +57,6 @@
<PackageReference Include="Com.Airbnb.iOS.Lottie" Version="2.5.11" PrivateAssets="none" />
</ItemGroup>

<PropertyGroup>
<UnoUIGeneratorsBinPath>..\..\SourceGenerators\Uno.UI.SourceGenerators\bin\$(Configuration)</UnoUIGeneratorsBinPath>
</PropertyGroup>

<Import Project="..\..\SourceGenerators\Uno.UI.SourceGenerators\Content\Uno.UI.SourceGenerators.props" />

<Target Name="_UnoToolkitOverrideNuget" AfterTargets="AfterBuild" DependsOnTargets="BuiltProjectOutputGroup" Condition="'$(UnoNugetOverrideVersion)'!=''">
Expand Down
13 changes: 11 additions & 2 deletions src/Directory.Build.props
Expand Up @@ -21,8 +21,6 @@
<CreateHardLinksForAdditionalFilesIfPossible>true</CreateHardLinksForAdditionalFilesIfPossible>
<CreateHardLinksForPublishFilesIfPossible>true</CreateHardLinksForPublishFilesIfPossible>

<LangVersion>8.0</LangVersion>

<!-- Version management is now done through NuGet, this avoids issues related version mismatch -->
<Version>255.255.255.255</Version>

Expand All @@ -42,6 +40,17 @@
<DefineConstants Condition="'$(UNO_UWP_BUILD)'!='true'">$(DefineConstants);HAS_UNO_WINUI</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<LangVersion>8.0</LangVersion>

<!--
Use this property to use either the Uno.SourceGeneration framework, or Roslyn's C# 9.0 generators.
If UnoUIUseRoslynSourceGenerators is not defined, the environment defines if Roslyn is used or not, see
Uno.UI.SourceGenerators.props for more details. Note that Roslyn generators required VS 16.8 Pre 3 or later.
-->
<UnoUIUseRoslynSourceGenerators>false</UnoUIUseRoslynSourceGenerators>
</PropertyGroup>

<!--
Adjust the output paths for runtime project in order for those
projects to stay in the same folder as the original reference one.
Expand Down
12 changes: 10 additions & 2 deletions src/Directory.Build.targets
Expand Up @@ -18,8 +18,8 @@
<ItemGroup>
<PackageReference Update="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.9" />
<!-- Keep aligned with MSBuild extras' default ExtrasUwpMetaPackageVersion -->
<PackageReference Update="Uno.SourceGenerationTasks" Version="2.0.13" />
<PackageReference Update="Uno.SourceGeneration" Version="2.0.13" />
<PackageReference Update="Uno.SourceGenerationTasks" Version="3.0.0-dev.16" />
<PackageReference Update="Uno.SourceGeneration" Version="3.0.0-dev.16" />
<PackageReference Update="Uno.Core" Version="2.0.0" />
<PackageReference Update="Uno.Core.Build" Version="2.0.0" />
<PackageReference Update="Uno.Diagnostics.Eventing" Version="1.0.4" />
Expand Down Expand Up @@ -48,6 +48,14 @@
<PackageReference Update="GtkSharp" Version="3.22.25.128" />
</ItemGroup>

<ItemGroup Condition="'$(MicrosoftNetCompilerVersionOverride)'!=''">
<!-- This override is used to validate the user of specific version of the C# Compiler -->
<PackageReference Include="Microsoft.Net.Compilers" Version="$(MicrosoftNetCompilerVersionOverride)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'MonoAndroid90'">
<PackageReference Update="Xamarin.AndroidX.Legacy.Support.v4" Version="1.0.0" />
<PackageReference Update="Xamarin.AndroidX.AppCompat" Version="1.1.0" />
Expand Down
Expand Up @@ -5,7 +5,6 @@
<TargetFramework>tizen50</TargetFramework>
<OutputType>Exe</OutputType>
<DefineConstants>$(DefineConstants);__TIZEN__;</DefineConstants>
<LangVersion>8.0</LangVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
1 change: 0 additions & 1 deletion src/SamplesApp/SamplesApp.Skia/SamplesApp.Skia.csproj
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<DefineConstants>$(DefineConstants);__SKIA__;HAS_UNO;UNO_REFERENCE_API</DefineConstants>
<IsUnoHead>true</IsUnoHead>
<UnoRuntimeIdentifier>Skia</UnoRuntimeIdentifier>
Expand Down
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<TargetFramework>net47</TargetFramework>
<LangVersion>8.0</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/SamplesApp/SamplesApp.Wasm/SamplesApp.Wasm.csproj
Expand Up @@ -5,7 +5,6 @@
<TargetFramework>netstandard2.0</TargetFramework>
<DefineConstants>$(DefineConstants);__WASM__;HAS_UNO;UNO_REFERENCE_API</DefineConstants>
<NoWarn>NU1701,CS1998</NoWarn>
<LangVersion>8.0</LangVersion>
<IsUiAutomationMappingEnabled>true</IsUiAutomationMappingEnabled>
<UseUnoXamlParser>true</UseUnoXamlParser>
<UnoRuntimeIdentifier>WebAssembly</UnoRuntimeIdentifier>
Expand Down
Expand Up @@ -9,18 +9,26 @@
using System.Xml.Serialization;
using System.Collections;
using System.Diagnostics;
using Uno.SourceGeneration;
using Microsoft.CodeAnalysis;
using Microsoft.Build.Execution;
using Uno.UI.SourceGenerators.XamlGenerator;
using Microsoft.CodeAnalysis.FindSymbols;
using Microsoft.CodeAnalysis.Text;
using Uno.Roslyn;
using Uno.UI.SourceGenerators.XamlGenerator;
using Microsoft.CodeAnalysis.CSharp;
using System.Reflection.Metadata.Ecma335;
using Uno.UI.SourceGenerators.Helpers;

#if NETFRAMEWORK
using Uno.SourceGeneration;
#endif

namespace Uno.UI.SourceGenerators.BindableTypeProviders
{
#if NETFRAMEWORK
[GenerateAfter("Uno.ImmutableGenerator")]
public class BindableTypeProvidersSourceGenerator : SourceGenerator
#endif
[Generator]
public class BindableTypeProvidersSourceGenerator : ISourceGenerator
{
private const string TypeMetadataConfigFile = "TypeMetadataConfig.xml";

Expand All @@ -40,17 +48,23 @@ public class BindableTypeProvidersSourceGenerator : SourceGenerator

public INamedTypeSymbol _stringSymbol { get; private set; }

public override void Execute(SourceGeneratorContext context)
public void Initialize(GeneratorInitializationContext context)
{
}

public void Execute(GeneratorExecutionContext context)
{
DependenciesInitializer.Init(context);

try
{
if (PlatformHelper.IsValidPlatform(context))
{
var project = context.GetProjectInstance();

if (IsApplication(project))
if (PlatformHelper.IsValidPlatform(context)
&& !DesignTimeHelper.IsDesignTime(context))
{
if (IsApplication(context))
{
_defaultNamespace = project.GetPropertyValue("RootNamespace");
_defaultNamespace = context.GetMSBuildPropertyValue("RootNamespace");

_bindableAttributeSymbol = FindBindableAttributes(context);
_dependencyPropertySymbol = context.Compilation.GetTypeByMetadataName(XamlConstants.Types.DependencyProperty);
Expand All @@ -73,7 +87,7 @@ public override void Execute(SourceGeneratorContext context)

modules = modules.Concat(context.Compilation.SourceModule);

context.AddCompilationUnit("BindableMetadata", GenerateTypeProviders(modules));
context.AddSource("BindableMetadata", GenerateTypeProviders(modules));
}
}
}
Expand All @@ -90,16 +104,16 @@ public override void Execute(SourceGeneratorContext context)
}
}

private static INamedTypeSymbol[] FindBindableAttributes(SourceGeneratorContext context) =>
SymbolFinder.FindDeclarationsAsync(context.Project, "BindableAttribute", false).Result.OfType<INamedTypeSymbol>().ToArray();
private static INamedTypeSymbol[] FindBindableAttributes(GeneratorExecutionContext context) =>
context.Compilation.GetSymbolsWithName("BindableAttribute", SymbolFilter.Type).OfType<INamedTypeSymbol>().ToArray();

private bool IsApplication(ProjectInstance projectInstance)
private bool IsApplication(GeneratorExecutionContext context)
{
var isAndroidApp = projectInstance.GetPropertyValue("AndroidApplication")?.Equals("true", StringComparison.OrdinalIgnoreCase) ?? false;
var isiOSApp = projectInstance.GetPropertyValue("ProjectTypeGuids")?.Equals("{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", StringComparison.OrdinalIgnoreCase) ?? false;
var ismacOSApp = projectInstance.GetPropertyValue("ProjectTypeGuids")?.Equals("{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", StringComparison.OrdinalIgnoreCase) ?? false;
var isExe = projectInstance.GetPropertyValue("OutputType")?.Equals("Exe", StringComparison.OrdinalIgnoreCase) ?? false;
var isUnoHead = projectInstance.GetPropertyValue("IsUnoHead")?.Equals("true", StringComparison.OrdinalIgnoreCase) ?? false;
var isAndroidApp = context.GetMSBuildPropertyValue("AndroidApplication")?.Equals("true", StringComparison.OrdinalIgnoreCase) ?? false;
var isiOSApp = context.GetMSBuildPropertyValue("ProjectTypeGuidsProperty")?.Equals("{FEACFBD2-3405-455C-9665-78FE426C6842},{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", StringComparison.OrdinalIgnoreCase) ?? false;
var ismacOSApp = context.GetMSBuildPropertyValue("ProjectTypeGuidsProperty")?.Equals("{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1},{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", StringComparison.OrdinalIgnoreCase) ?? false;
var isExe = context.GetMSBuildPropertyValue("OutputType")?.Equals("Exe", StringComparison.OrdinalIgnoreCase) ?? false;
var isUnoHead = context.GetMSBuildPropertyValue("IsUnoHead")?.Equals("true", StringComparison.OrdinalIgnoreCase) ?? false;

return isAndroidApp
|| (isiOSApp && isExe)
Expand Down

0 comments on commit 560e9b3

Please sign in to comment.