1# HostStubGen 2 3## Overview 4 5HostStubGen is a tool built for ravenwood. It can read an Android framework jar file 6(such as `framework-minus-apex.jar` or `framework-all.jar`) and 7converts them, so that they can be used on the Ravenwood environment. 8 9This directory contains the HostStubGen source code, tests and some library source files 10used at runtime. 11 12- HostStubGen itself is design to be agnostic to Android. It doesn't use any Android APIs 13(hidden or not). But it may use Android specific knowledge -- e.g. as of now, 14AndroidHeuristicsFilter has hardcoded heuristics to detect AIDL generated classes. 15 16- `test-tiny-framework/` contains basic tests that are agnostic to Android. 17 18- More Android specific build files and code are stored in `frameworks/base/Ravenwood.bp` 19 `frameworks/base/ravenwood`. 20 21## Directories and files 22 23- `hoststubgen/` 24 Contains source code of the "hoststubgen" tool and relevant code 25 26 - `src/` 27 28 HostStubGen tool source code. 29 30 - `annotations-src/` See `Android.bp`. 31 - `helper-framework-buildtime-src/` See `Android.bp`. 32 - `helper-framework-runtime-src/` See `Android.bp`. 33 - `helper-runtime-src/` See `Android.bp`. 34 35 - `test-tiny-framework/` See `README.md` in it. 36 37- `scripts` 38 - `dump-jar.sh` 39 40 A script to dump the content of `*.class` and `*.jar` files. 41 42 - `run-all-tests.sh` 43 44 Run all tests. Many tests may fail, but at least this should run til the end. 45 (It should print `run-all-tests.sh finished` at the end) 46 47## Build and run 48 49### Building `HostStubGen` binary 50 51``` 52m hoststubgen 53``` 54 55### Run the tests 56 57- Run all relevant tests and test scripts. All of it is expected to pass, and it'll print 58 "Ready to submit" at the end. 59 60 However, because some of the script it executes depend on internal file paths to Soong's 61 intermediate directory, some of it might fail when something changes in the build system. 62 63 We need proper build system integration to fix them. 64``` 65$ ./scripts/run-all-tests.sh 66``` 67 68- See also `README.md` in `test-*` directories. 69 70## TODOs, etc 71 72 - Make sure the parent's visibility is not smaller than the member's. 73 74- @HostSideTestNativeSubstitutionClass should automatically add class-keep to the substitute class. 75 (or at least check it.) 76 77 - The `HostStubGenTest-framework-test-host-test-lib` jar somehow contain all ASM classes? Figure out where the dependency is coming from. 78 79- At some point, we can move or delete all Android specific code to `frameworks/base/ravenwood`. 80 - `helper-framework-*-src` should be moved to `frameworks/base/ravenwood` 81 - `test-framework` should be deleted.