Skip to content

Commit 9a50c66

Browse files
jonpryoratsushieno
authored andcommitted
[Mono.Posix] Mono.Posix.csproj fixes. (#64)
Building xamarin-android/master with Mono 4.4.0 [0] would result in a build error within `src/Mono.Posix`: CSC: error CS1703: An assembly `System.Runtime' with the same identity has already been imported. Consider removing one of the references. This was introduced by commit f2fed37, which added `System.Runtime` as a `@(Reference)` to `Mono.Posix.csproj`. `Mono.Posix.csproj` `<Import/>`s `Xamarin.Android.CSharp.targets`, which indirectly adds `System.Runtime`, so there is no need for `Mono.Posix.csproj` to directly refernce `System.Runtime`. Additionally, `msbuild` is more stringent regarding property functions and quoting: this resulted in an MSBuild error: Condition="$(AndroidSupportedAbisForConditionalChecks.Contains (:x86:'))"> The fix is to properly quote the `.Contains()` method parameters. Finally, re-order various elements to increase consistency with other projects, e.g. `@(Reference)` should go with other `@(Reference)` entries, `Configuration.props` should be imported as early as possible, `$(TargetFrameworkVersion)` should be set to `$(AndroidFrameworkVersion)` (which requires the earlirer `Configuration.props` import), etc. [0]: mono-4.4.0-branch-c7-baseline/5995f74
1 parent 8d1aca3 commit 9a50c66

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/Mono.Posix/Mono.Posix.csproj

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
<AndroidResgenClass>Resource</AndroidResgenClass>
1313
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
1414
<AssemblyName>Mono.Posix</AssemblyName>
15-
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
15+
<SignAssembly>true</SignAssembly>
16+
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
17+
</PropertyGroup>
18+
<Import Project="..\..\Configuration.props" />
19+
<PropertyGroup>
20+
<TargetFrameworkVersion>$(AndroidFrameworkVersion)</TargetFrameworkVersion>
1621
</PropertyGroup>
1722
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1823
<DebugSymbols>true</DebugSymbols>
@@ -53,8 +58,11 @@
5358
<HintPath>$(OutputPath)..\v1.0\System.Xml.dll</HintPath>
5459
<Private>False</Private>
5560
</Reference>
61+
<Reference Include="Java.Interop">
62+
<HintPath>$(OutputPath)..\v1.0\Java.Interop.dll</HintPath>
63+
<Private>False</Private>
64+
</Reference>
5665
</ItemGroup>
57-
<Import Project="..\..\Configuration.props" />
5866
<ItemGroup>
5967
<Compile Include="$(XamarinAndroidSourcePath)\src\Mono.Posix\Mono.Unix.Native\NativeConvert.Android.cs" />
6068
<Compile Include="$(XamarinAndroidSourcePath)\src\Mono.Posix\Mono.Unix.Android\AndroidUtils.cs" />
@@ -237,14 +245,6 @@
237245
<Name>Mono.Android</Name>
238246
<Private>False</Private>
239247
</ProjectReference>
240-
<Reference Include="Java.Interop">
241-
<HintPath>$(OutputPath)..\v1.0\Java.Interop.dll</HintPath>
242-
<Private>False</Private>
243-
</Reference>
244-
<Reference Include="System.Runtime">
245-
<HintPath>$(OutputPath)..\v1.0\Facades\System.Runtime.dll</HintPath>
246-
<Private>False</Private>
247-
</Reference>
248248
</ItemGroup>
249249
<PropertyGroup>
250250
<XANativeLibsDir>$(OutputPath)\..\..\..\xbuild\Xamarin\Android\lib</XANativeLibsDir>
@@ -259,7 +259,7 @@
259259
<EmbeddedNativeLibrary Include="$(XANativeLibsDir)\armeabi-v7a\libMonoPosixHelper.so" Condition="$(AndroidSupportedAbisForConditionalChecks.Contains (':armeabi-v7a:'))">
260260
<Link>MonoPosixHelper\armeabi-v7a\libMonoPosixHelper.so</Link>
261261
</EmbeddedNativeLibrary>
262-
<EmbeddedNativeLibrary Include="$(XANativeLibsDir)\x86\libMonoPosixHelper.so" Condition="$(AndroidSupportedAbisForConditionalChecks.Contains (:x86:'))">
262+
<EmbeddedNativeLibrary Include="$(XANativeLibsDir)\x86\libMonoPosixHelper.so" Condition="$(AndroidSupportedAbisForConditionalChecks.Contains (':x86:'))">
263263
<Link>MonoPosixHelper\x86\libMonoPosixHelper.so</Link>
264264
</EmbeddedNativeLibrary>
265265
<EmbeddedNativeLibrary Include="$(XANativeLibsDir)\x86_64\libMonoPosixHelper.so" Condition="$(AndroidSupportedAbisForConditionalChecks.Contains (':x86_64:'))">

0 commit comments

Comments
 (0)