Commit 6af0a5d
authored
[java-runtime] simplify
We currently have code that loads `MonoRuntimeProvider.Bundled.java`
and parses Java code comments between:
// Mono Runtime Initialization {{{
android.content.pm.ApplicationInfo applicationInfo = context.getApplicationInfo ();
String[] apks = null;
String[] splitApks = applicationInfo.splitSourceDirs;
if (splitApks != null && splitApks.length > 0) {
apks = new String[splitApks.length + 1];
apks [0] = applicationInfo.sourceDir;
System.arraycopy (splitApks, 0, apks, 1, splitApks.length);
} else {
apks = new String[] { applicationInfo.sourceDir };
}
mono.MonoPackageManager.LoadApplication (context, applicationInfo, apks);
// }}}
These lines are used for any `Instrumentation` type, such as:
https://github.com/dotnet/java-interop/blob/2c06b3c2a11833aea0e9b51aac2a72195bd64539/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.CallableWrapperMembers/CallableWrapperType.cs#L238-L241
To refactor and cleanup, we can:
* Make `mono.MonoPackageManager.LoadApplication()` only take in a
single `Context context` parameter.
* Move the Java code that looks at `applicationInfo.splitSourceDirs`
inside `mono.MonoPackageManager.LoadApplication()`.
* Reduce the code in the `// Mono Runtime Initialization {{{` block
to a single line.
* Now we no longer need to load the
`MonoRuntimeProvider.Bundled.java` file during a build, we can
simply declare the one line of Java code as a C# string.
This will make refactoring `<GenerateJavaStubs/>` easier in future PRs.mono.MonoPackageManager.LoadApplication() (#9655)1 parent e0bf801 commit 6af0a5d
File tree
3 files changed
+14
-53
lines changed- src
- Xamarin.Android.Build.Tasks
- Resources
- Utilities
- java-runtime/java/mono/android
3 files changed
+14
-53
lines changedLines changed: 1 addition & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 21 | + | |
34 | 22 | | |
35 | 23 | | |
36 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | 188 | | |
227 | 189 | | |
228 | 190 | | |
| |||
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
32 | 43 | | |
33 | 44 | | |
34 | 45 | | |
| |||
0 commit comments