Skip to content

Commit

Permalink
[java-source-utils] Build one $(TargetFramework) (#1007)
Browse files Browse the repository at this point in the history
Context: dotnet/android#7157

Ever since commit 69e1b80, `java-source-utils.csproj` used the
`$(TargetFrameworks)` plural form, even though it only specified a
single framework.  I don't remember underlying reason for this, other
than "that's what I needed for it to build," which might have been
because the `_BuildJava` target was "wrong".

This arrangement was "fine", until dotnet/android@2197a459,
after which the xamarin-android/main CI builds started behaving
"weird": frequently `make all-tests` would fail, because
`make jenkins` would produce an invalid or corrupt
`java-source-utils.jar`, *apparently* because it was attempting to
*concurrently build* `java-source-utils.csproj` (?!).

One of these concurrent builds *appeared* to be an "outer build" from
`Xamarin.Android.sln`, while another one appeared to be an "inner
build" via `apksigner.csproj` and
`%(ProjectReference.AdditionalProperties)`:

	17:53:44.526 59:11>Target "_BuildJava: (TargetId:490)" in file "/Users/runner/work/1/s/xamarin-android/external/Java.Interop/tools/java-source-utils/java-source-utils.targets" from project "/Users/runner/work/1/s/xamarin-android/external/Java.Interop/tools/java-source-utils/java-source-utils.csproj" (entry point):
	17:53:44.526 59:11>Building target "_BuildJava" completely.
	  Output file "/Users/runner/work/1/s/xamarin-android/bin/Release/lib/packs/Microsoft.Android.Sdk.Darwin/33.0.0/tools/java-source-utils.jar" does not exist.
	…
	17:54:19.564 59:12>Target "DispatchToInnerBuilds: (TargetId:1637)" in file "/Users/runner/work/1/s/xamarin-android/bin/Release/dotnet/sdk/7.0.100-preview.7.22354.2/Microsoft.Common.CrossTargeting.targets" from project "/Users/runner/work/1/s/xamarin-android/external/Java.Interop/tools/java-source-utils/java-source-utils.csproj" (target "Build" depends on it):
	  Task "MSBuild" (TaskId:1099)
	    Task Parameter:BuildInParallel=True (TaskId:1099)
	    Task Parameter:Targets=Build (TaskId:1099)
	    Task Parameter:
	        Projects=
	            java-source-utils.csproj
	                    AdditionalProperties=TargetFramework=net7.0 (TaskId:1099)
	    Additional Properties for project "java-source-utils.csproj": (TaskId:1099)
	      TargetFramework=net7.0 (TaskId:1099)
	…
	17:54:19.592 59:12>Target "_BuildJava: (TargetId:1640)" in file "/Users/runner/work/1/s/xamarin-android/external/Java.Interop/tools/java-source-utils/java-source-utils.targets" from project "/Users/runner/work/1/s/xamarin-android/external/Java.Interop/tools/java-source-utils/java-source-utils.csproj" (entry point):
	  Building target "_BuildJava" completely.
	  Output file "/Users/runner/work/1/s/xamarin-android/external/Java.Interop/../../bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/java-source-utils.jar" does not exist.
	…
	17:54:41.034 59:11>Done building target "_BuildJava" in project "java-source-utils.csproj".: (TargetId:490)

We attempted to fix this by removing
`%(ProjectReference.AdditionalProperties)`, which only slightly
changed things: the "outer build via `Xamarin.Android.sln`" build was
removed, but we instead saw a scenario in which
`java-source-utils.csproj` was built "once", and as part of that
build the "outer" and "inner" builds were run concurrently.

A commonality here is `$(TargetFrameworks)` requires "outer" and
"inner" builds, and that is a complication that we should remove.

Update `java-source-utils.csproj` so that singular
`$(TargetFramework)` is used, not plural `$(TargetFrameworks)`.

Update the `_BuildJava` target so that it runs before the
`GetCopyToOutputDirectoryItems` target.  This is consistent with how
the [`_BuildGradle` target in `apksigner.csproj`][0] works.  Without
this change -- and the removal of the empty `Build` target -- the
`java-source-utils.csproj` build didn't behave correctly
(`gradlew` wasn't run).

Unfortunately, this seemingly simple change hits a little "snag":
`Directory.Build.props` is imported [very early][1]:

> *Directory.Build.props* is imported very early in
> *Microsoft.Common.props*, and properties defined later are
> unavailable to it.

"Properties defined later are unavailable to it." Properties such as
`$(TargetFramework)`.  Which means that every property we have in
`Directory.Build.props` which "depends" on `$(TargetFramework)`
*are not **actually** usable*.  They've only *appeared* to work
because they would default to "classic" paths, but as soon as you try
to build with `$(TargetFramework)`=net7.0 -- as was attempted with
`java-source-utils.csproj`, and previously with `Java.Base.csproj`
(bc5bcf4) -- you'll find that the "wrong" directories are used for
`$(OutputPath)`.

This has been a long-standing deficiency in my MSBuild understanding.

Fix this by adding a new `TargetFrameworkDependentValues.props` file,
and `<Import/>`ing this file in *every* `.csproj` which uses MSBuild
properties with values dependent upon `$(TargetFramework)` *before*
those properties are set.

Old and busted:

	<PropertyGroup>
	  <TargetFramework>net7.0</TargetFramework>
	  <OutputPath>$(UtilityOutputFullPath)</OutputPath>
	</PropertyGroup>

New hawtness:

	<PropertyGroup>
	  <TargetFramework>net7.0</TargetFramework>
	</PropertyGroup>
	<Import Project="..\..\TargetFrameworkDependentValues.props" />
	<PropertyGroup>
	  <OutputPath>$(UtilityOutputFullPath)</OutputPath>
	</PropertyGroup>

[0]: https://github.com/xamarin/xamarin-android/blob/c537dd28c30f482f365ef756214be35aa1553da2/src/apksigner/apksigner.targets#L3-L13
[1]: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2022#import-order
  • Loading branch information
jonpryor authored Jul 8, 2022
1 parent b7caa78 commit c942ab6
Show file tree
Hide file tree
Showing 50 changed files with 168 additions and 62 deletions.
44 changes: 1 addition & 43 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,7 @@
<AppendTargetFrameworkToOutputPath Condition=" '$(AppendTargetFrameworkToOutputPath)' == '' ">False</AppendTargetFrameworkToOutputPath>
<BaseIntermediateOutputPath Condition=" '$(BaseIntermediateOutputPath)' == '' ">obj\</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' != '' And (!$(TargetFramework.StartsWith('nets')) And !$(TargetFramework.StartsWith('net4')) And !$(TargetFramework.StartsWith('monoandroid'))) ">
<JIBuildingForNetCoreApp>True</JIBuildingForNetCoreApp>
</PropertyGroup>
<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">
<IntermediateOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)-$(TargetFramework.ToLowerInvariant())</IntermediateOutputPath>
<BuildToolOutputFullPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)-$(TargetFramework.ToLowerInvariant())\</BuildToolOutputFullPath>
<ToolOutputFullPath>$(MSBuildThisFileDirectory)bin\$(Configuration)-$(TargetFramework.ToLowerInvariant())\</ToolOutputFullPath>
<TestOutputFullPath>$(MSBuildThisFileDirectory)bin\Test$(Configuration)-$(TargetFramework.ToLowerInvariant())\</TestOutputFullPath>
<UtilityOutputFullPath Condition=" '$(UtilityOutputFullPathCoreApps)' != '' ">$(UtilityOutputFullPathCoreApps)</UtilityOutputFullPath>
<UtilityOutputFullPath Condition=" '$(UtilityOutputFullPathCoreApps)' == '' ">$(ToolOutputFullPath)</UtilityOutputFullPath>
<RollForward>Major</RollForward>
<JIUtilityVersion>$(JINetToolVersion)</JIUtilityVersion>
<JICoreLibVersion>$(JINetCoreLibVersion)</JICoreLibVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">
<IntermediateOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)</IntermediateOutputPath>
<BuildToolOutputFullPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\</BuildToolOutputFullPath>
<ToolOutputFullPath>$(MSBuildThisFileDirectory)bin\$(Configuration)\</ToolOutputFullPath>
<TestOutputFullPath>$(MSBuildThisFileDirectory)bin\Test$(Configuration)\</TestOutputFullPath>
<UtilityOutputFullPath Condition=" '$(UtilityOutputFullPath)' == '' ">$(ToolOutputFullPath)</UtilityOutputFullPath>
<JIUtilityVersion>$(JIOldToolVersion)</JIUtilityVersion>
<JICoreLibVersion>$(JIOldCoreLibVersion)</JICoreLibVersion>
</PropertyGroup>

<PropertyGroup>
<XamarinAndroidToolsDirectory Condition=" '$(XamarinAndroidToolsDirectory)' == '' ">$(MSBuildThisFileDirectory)external\xamarin-android-tools</XamarinAndroidToolsDirectory>
</PropertyGroup>
Expand All @@ -102,13 +80,6 @@
<_XamarinAndroidCecilPath Condition=" '$(CecilSourceDirectory)' != '' And Exists('$(UtilityOutputFullPath)Xamarin.Android.Cecil.dll') ">$(UtilityOutputFullPath)Xamarin.Android.Cecil.dll</_XamarinAndroidCecilPath>
<XamarinAndroidToolsFullPath>$([System.IO.Path]::GetFullPath ('$(XamarinAndroidToolsDirectory)'))</XamarinAndroidToolsFullPath>
</PropertyGroup>
<PropertyGroup>
<Runtime Condition="'$(OS)' != 'Windows_NT'">mono</Runtime>
<_JNIEnvGenPath Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">$(BuildToolOutputFullPath)jnienv-gen.dll</_JNIEnvGenPath>
<_JNIEnvGenPath Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(BuildToolOutputFullPath)jnienv-gen.exe</_JNIEnvGenPath>
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">$(DotnetToolPath) "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(Runtime) "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
</PropertyGroup>

<!--
When building on a bot w/ VS2019:
Expand All @@ -126,17 +97,4 @@
<NoWarn>$(NoWarn);CS8032;CS8981</NoWarn>
</PropertyGroup>

<!-- The net6.0 versions of these are stricter and require overloads not available in .NET Framework, so start with just .NET Framework -->
<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<WarningsAsErrors>$(WarningsAsErrors);CA1307;CA1309;CA1310</WarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">
<NoWarn>$(NoWarn);CA1307;CA1309;CA1310</NoWarn>
</PropertyGroup>

<PropertyGroup>
<Version>$(JIUtilityVersion)</Version>
</PropertyGroup>

</Project>
52 changes: 52 additions & 0 deletions TargetFrameworkDependentValues.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>

<PropertyGroup Condition=" '$(TargetFramework)' != '' And (!$(TargetFramework.StartsWith('nets')) And !$(TargetFramework.StartsWith('net4')) And !$(TargetFramework.StartsWith('monoandroid'))) ">
<JIBuildingForNetCoreApp>True</JIBuildingForNetCoreApp>
</PropertyGroup>

<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">
<IntermediateOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)-$(TargetFramework.ToLowerInvariant())\</IntermediateOutputPath>
<BuildToolOutputFullPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)-$(TargetFramework.ToLowerInvariant())\</BuildToolOutputFullPath>
<ToolOutputFullPath>$(MSBuildThisFileDirectory)bin\$(Configuration)-$(TargetFramework.ToLowerInvariant())\</ToolOutputFullPath>
<TestOutputFullPath>$(MSBuildThisFileDirectory)bin\Test$(Configuration)-$(TargetFramework.ToLowerInvariant())\</TestOutputFullPath>
<UtilityOutputFullPath Condition=" '$(UtilityOutputFullPathCoreApps)' != '' ">$(UtilityOutputFullPathCoreApps)</UtilityOutputFullPath>
<UtilityOutputFullPath Condition=" '$(UtilityOutputFullPathCoreApps)' == '' ">$(ToolOutputFullPath)</UtilityOutputFullPath>
<RollForward>Major</RollForward>
<JIUtilityVersion>$(JINetToolVersion)</JIUtilityVersion>
<JICoreLibVersion>$(JINetCoreLibVersion)</JICoreLibVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">
<IntermediateOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)</IntermediateOutputPath>
<BuildToolOutputFullPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\</BuildToolOutputFullPath>
<ToolOutputFullPath>$(MSBuildThisFileDirectory)bin\$(Configuration)\</ToolOutputFullPath>
<TestOutputFullPath>$(MSBuildThisFileDirectory)bin\Test$(Configuration)\</TestOutputFullPath>
<UtilityOutputFullPath Condition=" '$(UtilityOutputFullPath)' == '' ">$(ToolOutputFullPath)</UtilityOutputFullPath>
<JIUtilityVersion>$(JIOldToolVersion)</JIUtilityVersion>
<JICoreLibVersion>$(JIOldCoreLibVersion)</JICoreLibVersion>
</PropertyGroup>

<PropertyGroup>
<Runtime Condition="'$(OS)' != 'Windows_NT'">mono</Runtime>
<_JNIEnvGenPath Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">$(BuildToolOutputFullPath)jnienv-gen.dll</_JNIEnvGenPath>
<_JNIEnvGenPath Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(BuildToolOutputFullPath)jnienv-gen.exe</_JNIEnvGenPath>
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">$(DotnetToolPath) "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(Runtime) "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
</PropertyGroup>

<!-- The net6.0 versions of these are stricter and require overloads not available in .NET Framework, so start with just .NET Framework -->
<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<WarningsAsErrors>$(WarningsAsErrors);CA1307;CA1309;CA1310</WarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">
<NoWarn>$(NoWarn);CA1307;CA1309;CA1310</NoWarn>
</PropertyGroup>

<PropertyGroup>
<Version>$(JIUtilityVersion)</Version>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(BuildToolOutputFullPath)</OutputPath>
</PropertyGroup>

<PropertyGroup>
<OutputPath>$(BuildToolOutputFullPath)</OutputPath>
<GitDefaultBranch>main</GitDefaultBranch>
<GitThisAssembly>false</GitThisAssembly>
</PropertyGroup>
Expand Down
4 changes: 3 additions & 1 deletion build-tools/jnienv-gen/jnienv-gen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
<OutputType>Exe</OutputType>
<TargetFrameworks>net472;$(DotNetTargetFramework)</TargetFrameworks>
<IsPackable>false</IsPackable>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\</IntermediateOutputPath>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\</IntermediateOutputPath>
<OutputPath>$(BuildToolOutputFullPath)</OutputPath>
</PropertyGroup>

Expand Down
7 changes: 6 additions & 1 deletion src/Java.Base/Java.Base.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(DotNetTargetFramework)</TargetFrameworks>
<TargetFramework>$(DotNetTargetFramework)</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<!-- TODO: CS0108 is due to e.g. interfaces re-abstracting default interface methods -->
<NoWarn>$(NoWarn);8764;CS0108</NoWarn>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<Version>$(JICoreLibVersion)</Version>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<AssemblyTitle>Java.Interop.Dynamic</AssemblyTitle>
<Version>$(JICoreLibVersion)</Version>
</PropertyGroup>
<Import Project="..\..\TargetFrameworkDependentValues.props" />
<PropertyGroup>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Java.Interop.Export/Java.Interop.Export.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
<AssemblyTitle>Java.Interop.Export</AssemblyTitle>
<Version>$(JICoreLibVersion)</Version>
</PropertyGroup>
<Import Project="..\..\TargetFrameworkDependentValues.props" />
<PropertyGroup>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
<Version>$(JICoreLibVersion)</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Java.Interop\Java.Interop.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
<AssemblyTitle>Java.Interop.GenericMarshaler</AssemblyTitle>
</PropertyGroup>
<Import Project="..\..\TargetFrameworkDependentValues.props" />
<PropertyGroup>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
<Version>$(JICoreLibVersion)</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<ItemGroup>
<PackageReference Include="XliffTasks" />
</ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<Import Project="..\..\build-tools\scripts\cecil.projitems" />
<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
</PropertyGroup>

<Import Project="..\..\build-tools\scripts\cecil.projitems" />

<ItemGroup>
<Compile Include="..\utils\NullableAttributes.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<Import Project="..\..\build-tools\scripts\cecil.projitems" />
<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
</PropertyGroup>

<Import Project="..\..\build-tools\scripts\cecil.projitems" />

<ItemGroup>
<Compile Include="..\utils\NullableAttributes.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<DefineConstants>INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(UtilityOutputFullPath)</OutputPath>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<ProjectGuid>{5C0B3562-8DA0-4726-9762-75B9709ED6B7}</ProjectGuid>
<AssemblyTitle>Java.Interop.Tools.JavaSource</AssemblyTitle>
</PropertyGroup>
<Import Project="..\..\TargetFrameworkDependentValues.props" />
<PropertyGroup>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<LangVersion>8.0</LangVersion>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(TestOutputFullPath)</OutputPath>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Java.Interop/Java.Interop-MonoAndroid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>
<Import Project="..\..\Directory.Build.props" />
<Import Project="..\..\TargetFrameworkDependentValues.props" />
<PropertyGroup>
<Version>0.1.0.0</Version>
<XAConfigPath>..\..\bin\Build$(Configuration)\XAConfig.props</XAConfigPath>
Expand Down
15 changes: 9 additions & 6 deletions src/Java.Interop/Java.Interop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
<DefineConstants>INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS;INTERNAL_NULLABLE_ATTRIBUTES;$(JavaInteropDefineConstants)</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<MSBuildWarningsAsMessages>NU1702</MSBuildWarningsAsMessages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>DEBUG;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Import Project="..\..\TargetFrameworkDependentValues.props" />
<PropertyGroup>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\</IntermediateOutputPath>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
<DocumentationFile>$(ToolOutputFullPath)Java.Interop.xml</DocumentationFile>
<JNIEnvGenPath>$(BuildToolOutputFullPath)</JNIEnvGenPath>
<LangVersion Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">9.0</LangVersion>
<LangVersion Condition=" '$(LangVersion)' == '' ">8.0</LangVersion>
<Nullable>enable</Nullable>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<MSBuildWarningsAsMessages>NU1702</MSBuildWarningsAsMessages>
<Version>$(JICoreLibVersion)</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineConstants>DEBUG;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Condition=" '$(TargetFramework)' == 'netstandard2.0' " Include="..\utils\NullableAttributes.cs" />
<Compile Remove="Java.Interop\JniLocationException.cs" />
Expand Down
2 changes: 1 addition & 1 deletion src/Java.Interop/Java.Interop.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<ItemGroup>
<CompileJavaInteropJar Include="java\com\xamarin\java_interop\internal\JavaProxyObject.java" />
<CompileJavaInteropJar Include="java\com\xamarin\java_interop\internal\JavaProxyThrowable.java" />
Expand Down
2 changes: 2 additions & 0 deletions src/Java.Runtime.Environment/Java.Runtime.Environment.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<MSBuildWarningsAsMessages>NU1702</MSBuildWarningsAsMessages>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(TestOutputFullPath)</OutputPath>
<Version>$(JICoreLibVersion)</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(TestOutputFullPath)</OutputPath>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(TestOutputFullPath)</OutputPath>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<DefineConstants>INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(TestOutputFullPath)</OutputPath>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(TestOutputFullPath)</OutputPath>
</PropertyGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Xamarin.SourceWriter/Xamarin.SourceWriter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

</Project>
9 changes: 7 additions & 2 deletions src/java-interop/java-interop.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFrameworks>net472;$(DotNetTargetFramework)</TargetFrameworks>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
<JNIEnvGenPath>$(BuildToolOutputFullPath)</JNIEnvGenPath>
<OutputName>java-interop</OutputName>
<DefineSymbols>JI_DLL_EXPORT MONODEVELOP JAVA_INTEROP_DLL_EXPORT</DefineSymbols>
<SourceDirectory>.</SourceDirectory>
</PropertyGroup>

<Import Project="..\..\TargetFrameworkDependentValues.props" />

<PropertyGroup>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
<JNIEnvGenPath>$(BuildToolOutputFullPath)</JNIEnvGenPath>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineConstants>DEBUG $(DefineConstants)</DefineConstants>
</PropertyGroup>
Expand Down
Loading

0 comments on commit c942ab6

Please # to comment.