[Xamarin.Android.Build.Tasks] Allow the cache'ing of the dex/jack compilation for support libraries. [DO NOT MERGE WIP]#299
Closed
dellis1972 wants to merge 1 commit intodotnet:masterfrom
Closed
Conversation
…pilation for support libraries. Support libraries mostly contain classes.jar which needs to be converted to a .dex format (or the .jack format). This can take some time. If we pre convert the support libraries and cache the results we can cut down the build time. dx.jar has the capability to merge in other .jar files which contain classes.dex instead of .class files.
radical
pushed a commit
that referenced
this pull request
May 8, 2018
Context: 4ec5d4e In improving our support for "package-private" classes, we added a check to compare if two methods have the same signature. The expression was of the form: m.Name == baseMethod.Name && m.Parameters.JavaSignature == baseMethod.Parameters.JavaSignature The problem with this is that the `JavaSignature` property can throw a `NullReferenceException` if one of the parameter types is unknown, or only becomes valid later on in generator's process: System.NullReferenceException: Object reference not set to an instance of an object at MonoDroid.Generation.Parameter.get_JavaType () at MonoDroid.Generation.ParameterList.get_JavaSignature () at MonoDroid.Generation.ClassGen+<>c__DisplayClass29_0.<FixupAccessModifiers>b__0 (MonoDroid.Generation.Method m) at System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate, System.Boolean& found) at System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) at MonoDroid.Generation.ClassGen.FixupAccessModifiers () at Xamarin.Android.Binder.CodeGenerator.Validate (System.Collections.Generic.List`1[T] gens, MonoDroid.Generation.CodeGenerationOptions opt) at Xamarin.Android.Binder.CodeGenerator.Run (Xamarin.Android.Binder.CodeGeneratorOptions options, Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver) at Xamarin.Android.Binder.CodeGenerator.Run (Xamarin.Android.Binder.CodeGeneratorOptions options) at Xamarin.Android.Binder.CodeGenerator.Main (System.String[] args) Instead of using `JavaSignature`, we need to rely *only* on the original Java information, and loop over the parameters individually. To fix this: - Create a `bool Matches (MethodBase other)` method in `MethodBase` - Override `Matches()` in `Method`, also check the return type - Add some unit tests for these scenarios for both `XmlMethod` and `ManagedMethod`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support libraries mostly contain classes.jar which needs to be converted to
a .dex format (or the .jack format). This can take some time. If we
pre convert the support libraries and cache the results we can cut down
the build time. dx.jar has the capability to merge in other .jar files
which contain classes.dex instead of .class files.