Skip to content

Conversation

dellis1972
Copy link
Contributor

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59651

We were passing ALL the .class files in as parameters to the
dx.jar invocation. Turns out we can just pass the top level
directory. In this case $(IntermediateOutputPath)android\bin\classes
will do fine. Because its a directory dx will pick up any
.class file it finds in any subdirectory.

I did try this with the .jar files as well, but because allot
of the libraries have a lib folder which contain a internal .jar
file it causes problems. This is because it produces dupicate types.
So rather than specificly ignore the lib folder (which migth change)
we will just stick to the current system.

@dellis1972
Copy link
Contributor Author

build

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=59651

We were passing ALL the .class files in as parameters to the
dx.jar invocation. Turns out we can just pass the top level
directory. In this case `$(IntermediateOutputPath)android\bin\classes`
will do fine. Because its a directory dx will pick up any
.class file it finds in any subdirectory.

I did try this with the .jar files as well, but because allot
of the libraries have a `lib` folder which contain a internal .jar
file it causes problems. This is because it produces dupicate types.
So rather than specificly ignore the lib folder (which migth change)
we will just stick to the current system.
@jonpryor jonpryor merged commit 2d23a27 into dotnet:master Sep 25, 2017
@atsushieno
Copy link
Contributor

Nooooooo. You broke the core part of the changes.

It does NOT work with d8.jar while it does work with dx.jar.

@dellis1972
Copy link
Contributor Author

@atsushieno then we need a different fix. since providing a huge command line breaks a simple XF app on windows.

@kingces95
Copy link

Well, it breaks building Xamarin.Forms itself on VS2017, yep. That'll block XF from upgrading from VS2015.

@dellis1972
Copy link
Contributor Author

@atsushieno what we probably need to do is zip all the .class files up and pass the zip file to dx.jar or d8.jar both seem to support zips

@jonpryor
Copy link
Contributor

Sounds like we need tests which use both dx.jar and d8.jar! :-D

@kingces95
Copy link

Did the zip work fix move forward?

@jonpryor
Copy link
Contributor

@kingces95: I do not understand the question.

@kingces95
Copy link

kingces95 commented Sep 29, 2017

The PR broke something and the proposed work around was to zip up the files passed to the tool instead of enumerating them one by one. So I was wondering if any progress was made on that solution. I ask because we're cutting a VS2017 solution for forms and without this fix then we'll fail to build when we upgrade.

xamarin/Xamarin.Forms#1171

@dellis1972
Copy link
Contributor Author

@kingces95 I am looking at the zip solution, its just an idea at this point. I should have some time to work on it next week though.

@dellis1972
Copy link
Contributor Author

@kingces95 PR is up for the zip solution. #911

dellis1972 added a commit that referenced this pull request Oct 6, 2017
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=59651

We were passing ALL the `.class` files in as parameters to the
`dx.jar` invocation. Turns out we can just pass the top level
directory. In this case `$(IntermediateOutputPath)android\bin\classes`
will do fine. Because it's a directory `dx` will pick up any
`.class` file it finds in any subdirectory.

I did try this with the `.jar` files as well, but because a lot
of the libraries have a `lib` folder which contain an internal `.jar`
file it causes problems. This is because it produces duplicate types.
So rather than specifically ignore the `lib` folder (which might change)
we will just stick to the current system.
jonpryor pushed a commit that referenced this pull request Oct 15, 2021
Context: dotnet/java-interop@846f211

Changes: dotnet/java-interop@c936d09...7c8d463

  * dotnet/java-interop@7c8d4638: [build] Fix -t:Prepare on Linux (#892)
  * dotnet/java-interop@41ba3485: [tests] Add net6.0 TargetFramework. (#888)
  * dotnet/java-interop@403dd37a: [class-parse] Ignore .jnilib files within .jar files (#890)
  * dotnet/java-interop@bda6be43: [class-parse] Add support for some JDK-11 constant pool types (#889)
  * dotnet/java-interop@4277ac96: Bump to xamarin/xamarin-android-tools/main@34e98e2b (#887)
  * dotnet/java-interop@846f2116: [generator] Remove buggy annotation loose match (#886)

Commit dotnet/java-interop@846f2116 made our annotation support more
accurate, which had a side-effect of introducing changes to generated
custom attributes.

Update `tests/api-compatibility/acceptable-breakages*.txt` to deal
with the fallout from dotnet/java-interop@846f2116.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants