Skip to content

Commit

Permalink
Add workaround for dotnet/sdk#2337 into the Extras
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny committed Aug 17, 2018
1 parent bcc5cee commit bc948cc
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Common.targets
Expand Up @@ -25,4 +25,15 @@
<_SdkEmbeddedResourceCodeGeneratorTool Condition="'$(ExtrasEmbeddedResourceGeneratedCodeIsPublic)' == 'true'">PublicVbMyResourcesResXFileCodeGenerator</_SdkEmbeddedResourceCodeGeneratorTool>
</PropertyGroup>


<!-- Workaround for https://github.com/dotnet/sdk/issues/2337 -->
<!-- Fix will be in https://github.com/dotnet/project-system/issues/935 -->
<PropertyGroup>
<_SdkMinVersionWithNoneIssue>2.1.300</_SdkMinVersionWithNoneIssue>
</PropertyGroup>

<ItemGroup Condition="'$([System.Version]::Parse($(_SdkNETCoreSdkVersion)))' >= '$([System.Version]::Parse($(_SdkMinVersionWithNoneIssue)))'">
<None Include="**\*$(DefaultLanguageSourceExtension)" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions Tests/ClasslibraryAsSdk/Class.monoandroid.cs
@@ -0,0 +1,9 @@
using System;

namespace MSBuild.Sdk.Extras.Tests
{
public class ClassMono
{
int SomeMethod(int a, int b) => a + b;
}
}
File renamed without changes.
12 changes: 11 additions & 1 deletion Tests/ClasslibraryAsSdk/ClasslibraryAsSdk.csproj
Expand Up @@ -10,16 +10,26 @@
<ExtrasBuildEachRuntimeIdentifier Condition="'$(TargetFramework)' == 'netstandard2.0'">true</ExtrasBuildEachRuntimeIdentifier>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>


<ItemGroup>
<ReferenceAssemblyProjectReference Include="..\ClasslibraryAsSdk.Ref\ClasslibraryAsSdk.Ref.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="*.shared.cs" />
<Compile Include="*.Designer.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<Compile Include="*.monoandroid.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'xamarin.mac20'">
<Reference Include="System.Xml" />
</ItemGroup>
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\Source\MSBuild.Sdk.Extras\Sdk\Sdk.targets" />
<Import Project="..\Test.targets" />
Expand Down

0 comments on commit bc948cc

Please sign in to comment.