-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump to xamarin/Java.Interop/main@8898bc14 #6229
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks OK if it builds. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if a lot of test projects fail to build with:
MainActivity.cs(13,3): error CS1705: Assembly 'Xamarin.Forms.Platform.Android' with identity 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' which has a higher version than referenced assembly 'Java.Interop' with identity 'Java.Interop, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'
Does that mean we shouldn't version Java.Interop.dll
? It's actually used by apps, while some of the other assemblies are only used at build time.
I suspect that things are nominally more confusing than that! The current version of
…yet we have a compiler error showing that one of the Where is 0.0.0.0 coming from?! I believe that it's coming from: https://github.com/xamarin/java.interop/blob/8898bc1402953fdf3a1e1066dd2542fc1818aadf/src/Java.Interop/Java.Interop-MonoAndroid.csproj which doesn't use the I also see that the …and behold?
So! Hack up my local diff --git a/src/Java.Interop/Directory.Build.targets b/src/Java.Interop/Directory.Build.targets
index c91706ab..483b1fe2 100644
--- a/src/Java.Interop/Directory.Build.targets
+++ b/src/Java.Interop/Directory.Build.targets
@@ -31,4 +31,23 @@
<Exec Command=""$(JavaCPath)" $(_JavacSourceOptions) -d "$(IntermediateOutputPath)ji-classes" @(CompileJavaInteropJar -> '%(Identity)', ' ')" />
<Exec Command=""$(JarPath)" cf "$(OutputPath)java-interop.jar" -C "$(IntermediateOutputPath)ji-classes" ." />
</Target>
+ <Target Name="_GenerateAssemblyInfo_cs">
+ <PropertyGroup>
+ <Version>0.1.1.0</Version>
+ <_AssemblyInfoPath>$(IntermediateOutputPath)$(MSBuildProjectFile).cs</_AssemblyInfoPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <_AssemblyInfo Include="// <autogenerated />" />
+ <_AssemblyInfo Include="using System.Reflection%3b" />
+ <_AssemblyInfo Include="[assembly: AssemblyTitle ("Java.Interop")]" />
+ <_AssemblyInfo Include="[assembly: AssemblyCompany ("Microsoft Corporation")]" />
+ <_AssemblyInfo Include="[assembly: AssemblyCopyright ("Microsoft Corporation")]" />
+ <_AssemblyInfo Include="[assembly: AssemblyTrademark ("Microsoft Corporation")]" />
+ <_AssemblyInfo Include="[assembly: AssemblyVersion ("$(Version)")]" />
+ </ItemGroup>
+ <WriteLinesToFile File="$(_AssemblyInfoPath)" Lines="@(_AssemblyInfo)" Overwrite="True" />
+ <ItemGroup>
+ <Compile Include="$(_AssemblyInfoPath)" />
+ </ItemGroup>
+ </Target>
</Project>
\ No newline at end of file
diff --git a/src/Java.Interop/Java.Interop-MonoAndroid.csproj b/src/Java.Interop/Java.Interop-MonoAndroid.csproj
index 9061a960..0a5d10f8 100644
--- a/src/Java.Interop/Java.Interop-MonoAndroid.csproj
+++ b/src/Java.Interop/Java.Interop-MonoAndroid.csproj
@@ -16,6 +16,7 @@
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
<LangVersion>8.0</LangVersion>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
+ <GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>
<Import Project="..\..\Directory.Build.props" />
<PropertyGroup>
@@ -85,6 +86,7 @@
<Import Project="Directory.Build.targets" />
<PropertyGroup>
<BuildDependsOn>
+ _GenerateAssemblyInfo_cs;
BuildJniEnvironment_g_cs;
BuildInteropJar;
$(BuildDependsOn)
@@ -111,4 +113,5 @@
<None Include="Documentation\Java.Interop\JniManagedPeerStates.xml" />
<None Include="Documentation\Java.Interop\JniEnvironment.References.xml" />
</ItemGroup>
+
</Project> and when I replace |
@dellis1972: would you be able to take over the above |
@jonpryor this might do the trick https://github.com/xamarin/java.interop/pull/871/files#diff-8b9952a7fb800961cf74521dd45afaa88095a4e68a641841dbff1b68c789dcc5R20 |
@dellis1972: tried your patch locally, and...i'm uncertain. Somehow it produced a
Meanwhile, the net6 version has a more reasonable 0.1.3.0:
This doesn't make sense to me. Furthermore, when I try to "manually" build via
I'm thus really not sure what to make of this. |
3a48cb1
to
d9da10c
Compare
Cleaned my repo, re-applied dotnet/java-interop#871 locally, and I just get a different set of errors.
Some files are created, but not the MonoAndroid-profile
Running If I take matters into my own hands and manually build
Which is likewise not encouraging. A manual |
I'm able to build this branch on Windows, but I get a similar failure as CI when I build the test
So I'm wondering... Should we only version the |
Context: dotnet/android#6229 Context: dotnet/android#6229 (comment) This reverts commit d16b1e5. The problem is `src/Java.Interop/Java.Interop-MonoAndroid.csproj`, which is [used by the xamarin-android build][0] to create a "MonoAndroid-profile" assembly (see also 85be94f). In a d16b1e5 world -- one in which `src/Java.Interop/Properties/AssemblyInfo.cs` doesn't contain an `[assembly: AssemblyVersion(…)]` custom attribute -- for reasons not yet known, the `SetVersion` target is never run, and/or *can't* run, when `Java.Interop-MonoAndroid.csproj` is built: % msbuild /v:diag Java.Interop-MonoAndroid.csproj /p:JavaInteropProfile=Net45 \ /p:XAInstallPrefix=…/xamarin-android/bin/Debug/lib/xamarin.android \ /p:TargetFrameworkIdentifier=MonoAndroid \ /p:TargetFrameworkVersion=v1.0 \ /p:TargetFrameworkRootPath=…/xamarin-android/bin/Debug/lib/xamarin.android/xbuild-frameworks Consequently, the "MonoAndroid-profile" `Java.Interop.dll` winds up with *no* version set, i.e. version 0.0.0.0, which breaks everything: MainActivity.cs(13,3): error CS1705: Assembly 'Xamarin.Forms.Platform.Android' with identity 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' which has a higher version than referenced assembly 'Java.Interop' with identity 'Java.Interop, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' In the interests of expediency -- we can't bump Java.Interop within xamarin-android so long as d16b1e5 is in place -- revert commit d16b1e5 so that we can un-block repo bumps. We'll try to figure out how to properly use the `GitInfo` NuGet package while supporting `Java.Interop-MonoAndroid.csproj` later. [0]: https://github.com/xamarin/xamarin-android/blob/bcc315857f2cd61351ba469973043d91c902c50e/src/Mono.Android/Mono.Android.targets#L10-L35
Changes: http://github.com/xamarin/Java.Interop/compare/ff2714200107fb616828b9d1013f69605791d2ba...b7982e423952a4c4afe0c33f36ac80eed7fa57a2 * dotnet/java-interop@b7982e42: Revert "[build] Use GitInfo to generate $(Version) (dotnet#865)" (dotnet#874) * dotnet/java-interop@9a878f21: [build] Properly implement "parent directory.override.props" (dotnet#300) (dotnet#873) * dotnet/java-interop@0c5d454c: [Java.Interop] fix .NET 6 linker warnings (dotnet#870) * dotnet/java-interop@8898bc14: [build] Import $(MSBuildProjectDirectory).override.props (dotnet#872) * dotnet/java-interop@d16b1e56: [build] Use GitInfo to generate $(Version) (dotnet#865) * dotnet/java-interop@2eb9ff26: [build] .NET 6 P7 Support (dotnet#869) Set `$(XamarinAndroidToolsDirectory)` for `external/Java.Interop` so that the Java.Interop build uses `external/xamarin-android-tools`.
d9da10c
to
b5066be
Compare
Context: dotnet/android#6229 Context: dotnet/android#6229 (comment) This reverts commit d16b1e5. The problem is `src/Java.Interop/Java.Interop-MonoAndroid.csproj`, which is [used by the xamarin-android build][0] to create a "MonoAndroid-profile" assembly (see also 85be94f). In a d16b1e5 world -- one in which `src/Java.Interop/Properties/AssemblyInfo.cs` doesn't contain an `[assembly: AssemblyVersion(…)]` custom attribute -- for reasons not yet known, the `SetVersion` target is never run, and/or *can't* run, when `Java.Interop-MonoAndroid.csproj` is built: % msbuild /v:diag Java.Interop-MonoAndroid.csproj /p:JavaInteropProfile=Net45 \ /p:XAInstallPrefix=…/xamarin-android/bin/Debug/lib/xamarin.android \ /p:TargetFrameworkIdentifier=MonoAndroid \ /p:TargetFrameworkVersion=v1.0 \ /p:TargetFrameworkRootPath=…/xamarin-android/bin/Debug/lib/xamarin.android/xbuild-frameworks Consequently, the "MonoAndroid-profile" `Java.Interop.dll` winds up with *no* version set, i.e. version 0.0.0.0, which breaks everything: MainActivity.cs(13,3): error CS1705: Assembly 'Xamarin.Forms.Platform.Android' with identity 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' which has a higher version than referenced assembly 'Java.Interop' with identity 'Java.Interop, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' In the interests of expediency -- we can't bump Java.Interop within xamarin-android so long as d16b1e5 is in place -- revert commit d16b1e5 so that we can un-block repo bumps. We'll try to figure out how to properly use the `GitInfo` NuGet package while supporting `Java.Interop-MonoAndroid.csproj` later. [0]: https://github.com/xamarin/xamarin-android/blob/bcc315857f2cd61351ba469973043d91c902c50e/src/Mono.Android/Mono.Android.targets#L10-L35
Changes: http://github.com/xamarin/Java.Interop/compare/ff2714200107fb616828b9d1013f69605791d2ba...9a878f211c86bdd37cb71c5c461f85a0c1a1480d
gradlew
needs JAVA_HOME set on Windows #870)Set
$(XamarinAndroidToolsDirectory)
forexternal/Java.Interop
so that the Java.Interop build uses
external/xamarin-android-tools
.