Skip to content

Commit

Permalink
Merge pull request #186 from jeromelaban/dev/jela/linux-fix
Browse files Browse the repository at this point in the history
Fix non-existing language targets restore
  • Loading branch information
Oren Novotny committed Sep 27, 2019
2 parents ba58051 + 3273038 commit 6fc4cc6
Show file tree
Hide file tree
Showing 15 changed files with 321 additions and 56 deletions.
2 changes: 1 addition & 1 deletion Source/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup Condition="'$(IsCloudBuild)' == 'true'">
<ItemGroup Condition="'$(IsCloudBuild)' == 'true' and '$(DisableNerdBank)'!='true'">
<PackageReference Include="Nerdbank.GitVersioning" Version="3.0.26" PrivateAssets="All"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
<_SdkLanguageTargetsMissing Condition="'$(_SdkLanguageTargetsMissing)' == ''">true</_SdkLanguageTargetsMissing>
</PropertyGroup>

<!-- Check if the Common targets have been loaded, see https://github.com/onovotny/MSBuildSdkExtras/pull/186 -->
<!-- https://github.com/microsoft/msbuild/blob/d42d3504057ef2b88dd4f68c4bfc5591371bd6fe/src/Tasks/Microsoft.Common.targets#L32-L43 -->
<PropertyGroup Condition=" '$(CommonTargetsPath)' == '' Or '$(MSBuildVersion)' &gt;= '16.0' ">
<_SdkLanguageTargetsMissing Condition="'$(CommonTargetsPath)'!=''">false</_SdkLanguageTargetsMissing>
<_SdkLanguageTargetsMissing Condition="'$(_SdkLanguageTargetsMissing)' == ''">true</_SdkLanguageTargetsMissing>
</PropertyGroup>

<!-- Check to see if the Lang targets exist and if not, trigger an error on Compile -->
<!-- We clear out the lang targets so the defaults are used for the error to show -->
<PropertyGroup Condition="'$(_ExtrasSkipTargetsCheck)' != 'true' and '$(_SdkLanguageTargetsMissing)' == 'true' ">
Expand All @@ -30,7 +37,7 @@

<!-- Import common targets so NuGet restore succeeds -->
<!-- https://github.com/dotnet/sdk/blob/979eed136b786b6e2d77f567eb5a368952982740/src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.targets#L33 -->
<Import Condition="'$(_SdkLanguageTargetsMissing)' == 'true' " Project="$(LanguageTargets)" />
<Import Condition=" '$(_SdkLanguageTargetsMissing)' == 'true' " Project="$(LanguageTargets)" />


<Target Name="_ShowMissingLanguageTargetsError" BeforeTargets="_CheckForUnsupportedTargetFramework" Condition="'$(_SdkLanguageTargetsMissing)' == 'true' and '$(_SdkIgnoreMissingLanguageTargetsError)' != 'true' ">
Expand Down
9 changes: 9 additions & 0 deletions TestProjects/Linux-C#/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)</SolutionDir>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\$(MSBuildThisFile)"/>

</Project>
31 changes: 31 additions & 0 deletions TestProjects/Linux-C#/Linux-CS.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29230.61
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "netstd2Library", "netstd2Library\netstd2Library.csproj", "{ED027E36-643F-44C0-A297-34D565859D16}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cross-ios-netstd2", "cross-ios-netstd2\cross-ios-netstd2.csproj", "{C87855F6-314C-4BA6-AFA9-F979D8850050}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ED027E36-643F-44C0-A297-34D565859D16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED027E36-643F-44C0-A297-34D565859D16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED027E36-643F-44C0-A297-34D565859D16}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED027E36-643F-44C0-A297-34D565859D16}.Release|Any CPU.Build.0 = Release|Any CPU
{C87855F6-314C-4BA6-AFA9-F979D8850050}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C87855F6-314C-4BA6-AFA9-F979D8850050}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C87855F6-314C-4BA6-AFA9-F979D8850050}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C87855F6-314C-4BA6-AFA9-F979D8850050}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {59FA0C61-E338-40D3-BBB4-966BC1CDB464}
EndGlobalSection
EndGlobal
31 changes: 31 additions & 0 deletions TestProjects/Linux-C#/Linux-CS/Linux-CS.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29230.61
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "netstd2Library", "netstd2Library\netstd2Library.csproj", "{ED027E36-643F-44C0-A297-34D565859D16}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cross-ios-netstd2", "cross-ios-netstd2\cross-ios-netstd2.csproj", "{C87855F6-314C-4BA6-AFA9-F979D8850050}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ED027E36-643F-44C0-A297-34D565859D16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED027E36-643F-44C0-A297-34D565859D16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED027E36-643F-44C0-A297-34D565859D16}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED027E36-643F-44C0-A297-34D565859D16}.Release|Any CPU.Build.0 = Release|Any CPU
{C87855F6-314C-4BA6-AFA9-F979D8850050}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C87855F6-314C-4BA6-AFA9-F979D8850050}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C87855F6-314C-4BA6-AFA9-F979D8850050}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C87855F6-314C-4BA6-AFA9-F979D8850050}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {59FA0C61-E338-40D3-BBB4-966BC1CDB464}
EndGlobalSection
EndGlobal
8 changes: 8 additions & 0 deletions TestProjects/Linux-C#/Linux-CS/cross-ios-netstd2/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace cross_ios_netstd2
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;xamarinios10</TargetFrameworks>
<RootNamespace>cross_ios_netstd2</RootNamespace>
</PropertyGroup>

</Project>
8 changes: 8 additions & 0 deletions TestProjects/Linux-C#/Linux-CS/netstd2Library/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace netstd2Library
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

</Project>
8 changes: 8 additions & 0 deletions TestProjects/Linux-C#/cross-ios-netstd2/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace cross_ios_netstd2
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;xamarinios10;uap10.0.16299</TargetFrameworks>
</PropertyGroup>

</Project>
8 changes: 8 additions & 0 deletions TestProjects/Linux-C#/netstd2Library/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace netstd2Library
{
public class Class1
{
}
}
11 changes: 11 additions & 0 deletions TestProjects/Linux-C#/netstd2Library/netstd2Library.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\cross-ios-netstd2\cross-ios-netstd2.csproj" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions TestProjects/NuGet.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<configuration>
<configuration>
<packageSources>
<add key="Local" value="%temp%\Packages"/>
<add key="CI Builds" value="https://myget.org/F/msbuildsdkextras/api/v3/index.json"/>
<add key="Local" value="%TMPDIR%/Packages"/>
<!--<add key="CI Builds" value="https://myget.org/F/msbuildsdkextras/api/v3/index.json"/>-->
</packageSources>
</configuration>
Loading

0 comments on commit 6fc4cc6

Please sign in to comment.