Rationalize the handling of the native lib, and the plugin to manage native resources, like this icu dat file, needed by icu in sqlite in the libandroid_native.so used by robolectic (in some configurations or robolectric tests). Test: atest NexusLauncherRoboTests; atest NativeGraphicsRoboTest Bug: 393164499 Flag: TEST_ONLY Change-Id: I5a5a39389d4c508347db6a4e975aae0bf093e349
diff --git a/icu4c/source/stubdata/Android.bp b/icu4c/source/stubdata/Android.bp index 6e78c00..13a93db 100644 --- a/icu4c/source/stubdata/Android.bp +++ b/icu4c/source/stubdata/Android.bp
@@ -48,3 +48,18 @@ dir: "layoutlib_native/icu", }, } + +java_library { + name: "icu-data_host_robolectric", + host_supported: true, + device_supported: false, + java_resources: [ + dat_file, + ], + // Robolectric expects the .dat file to be in a specific location. + // This jarjar rule renames the .dat file to the expected name. + jarjar_rules: "robo-jarjar-rules.txt", + visibility: [ + "//external/robolectric", + ], +}
diff --git a/icu4c/source/stubdata/robo-jarjar-rules.txt b/icu4c/source/stubdata/robo-jarjar-rules.txt new file mode 100644 index 0000000..19c3d00 --- /dev/null +++ b/icu4c/source/stubdata/robo-jarjar-rules.txt
@@ -0,0 +1 @@ +rule * icu.@1