Skip to content

Commit

Permalink
Setting Broker TargetFramework to netstandard2.0 (#3377)
Browse files Browse the repository at this point in the history
* initial commit

* update to TargetFramework

* CoreUIParent

* Fix

* fix

* Add netstandrd to normal build

* unit test fix

* Fix unit test project

Co-authored-by: Gladwin Johnson <gljohns@microsoft.com>
Co-authored-by: Bogdan Gavril <bogavril@microsoft.com>
  • Loading branch information
3 people committed Jun 17, 2022
1 parent a469e1c commit ff1d8c7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>

<TargetFrameworkNetDesktop>net462</TargetFrameworkNetDesktop>
<TargetFrameworkNetCore>netcoreapp3.1</TargetFrameworkNetCore>
<TargetFrameworkNetStandard>netstandard2.0</TargetFrameworkNetStandard>

<PlatformTarget>AnyCPU</PlatformTarget>
<TargetFrameworks Condition="$([MSBuild]::IsOsPlatform('Windows'))">$(TargetFrameworkNetDesktop);$(TargetFrameworkNetCore)</TargetFrameworks>
<TargetFramework Condition="$([MSBuild]::IsOsPlatform('OSX'))">$(TargetFrameworkNetCore)</TargetFramework>
<TargetFramework Condition="$([MSBuild]::IsOsPlatform('Linux')) ">$(TargetFrameworkNetCore)</TargetFramework>
<TargetFramework>$(TargetFrameworkNetStandard)</TargetFramework>

<PathToMsalSources>$(MSBuildThisFileDirectory)../Microsoft.Identity.Client/</PathToMsalSources>
</PropertyGroup>

<PropertyGroup Label="NuGet and AssemblyInfo metadata">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private AcquireTokenInteractiveParameterBuilder WithParentObject(object parent)
return this;
}
#endif
#if DESKTOP || NET5_WIN || NET_CORE
#if DESKTOP || NET5_WIN || NET_CORE || NETSTANDARD

if (parent is IntPtr intPtrWindow)
{
Expand Down Expand Up @@ -295,7 +295,7 @@ public AcquireTokenInteractiveParameterBuilder WithParentActivityOrWindow(IWin32
}
#endif

#if DESKTOP || NET5_WIN || NET_CORE
#if DESKTOP || NET5_WIN || NET_CORE || NETSTANDARD

/// <summary>
/// Sets a reference to the IntPtr to a window that triggers the browser to be shown.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<TargetFrameworkNetDesktop461>net461</TargetFrameworkNetDesktop461>
<TargetFrameworkNetCore>netcoreapp2.1</TargetFrameworkNetCore>
<TargetFrameworkNet5Win>net5.0-windows10.0.17763.0</TargetFrameworkNet5Win>
<TargetFrameworkNetStandard>netstandard1.3</TargetFrameworkNetStandard>
</PropertyGroup>

<!-- Mobile and legacy targets - comment these out or set env variable MSAL_DESKTOP_ONLY_DEV to speedup the build -->
<PropertyGroup Condition="'$(MSAL_DESKTOP_ONLY_DEV)' == ''">
<TargetFrameworkNetStandard>netstandard1.3</TargetFrameworkNetStandard>
<TargetFrameworkNetDesktop45>net45</TargetFrameworkNetDesktop45>
<TargetFrameworkUap>uap10.0</TargetFrameworkUap>
<TargetFrameworkIos>Xamarin.iOS10</TargetFrameworkIos>
Expand Down
2 changes: 1 addition & 1 deletion src/client/Microsoft.Identity.Client/UI/CoreUIParent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public CoreUIParent(Activity activity)
internal bool UseCorporateNetwork { get; set; }
#endif

#if DESKTOP || NET5_WIN || NET_CORE
#if DESKTOP || NET5_WIN || NET_CORE || NETSTANDARD
internal object OwnerWindow { get; set; }
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<None Update="Resources\**\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>


</ItemGroup>

<Import Project="../../build/platform_and_feature_flags.props" />
Expand All @@ -49,10 +51,6 @@
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
<ProjectReference Include="..\..\src\client\Microsoft.Identity.Client.Desktop\Microsoft.Identity.Client.Desktop.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
<ProjectReference Include="..\..\src\client\Microsoft.Identity.Client.Broker\Microsoft.Identity.Client.Broker.csproj" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' ">
<DefineConstants>$(DefineConstants);NET_CORE</DefineConstants>
</PropertyGroup>
Expand Down

0 comments on commit ff1d8c7

Please sign in to comment.