B2G icon indicating copy to clipboard operation
B2G copied to clipboard

Get rid of dependency on JDK/JRE

Open joneschrisg opened this issue 14 years ago • 7 comments

First step in Operation Decaf. I would hope we can achieve this with steps something like

  • make a no-op .java -> .class build rule
  • make a no-op .jar build rule
  • remove the remaining stuff that depends on JDK/JRE indirectly. I think some external projects did.

joneschrisg avatar Jan 12 '12 06:01 joneschrisg

Another solution is to override BUILD_XXX variables in build/core/config.mk. Content of these variables are pathes to makefiles in build/core/. We only need to create noop makefiles which creates noop module for Android, and assign their path to BUILD_XXX varaibles. Then, build system of android would do nothing for Java packages and libraries.

ThinkerYzu avatar Jan 15 '12 13:01 ThinkerYzu

It seems work to override BUILD_XXX variables fro me, but some modules would define rules by them-self. Most of modules having customized rules can be override by LOCAL_OVERRIDES_PACKAGES variable to stop them from being built. But, host tools that will not be installed to target system can not be override. I am finding another solution for host tools.

ThinkerYzu avatar Jan 16 '12 00:01 ThinkerYzu

https://github.com/ThinkerYzu/android-build/tree/decaf-noop-mk This is the branch for my efforts on decaf tasks. I have overrode BUILD_XXX variables in config.mk, and change attributes of some modules at run-time. It make |make gonk| faster by taking 1m35s. But, it does not boot correctly. Mediaserver does not run. Does mediaserver need dalvik to help him?

ThinkerYzu avatar Jan 16 '12 08:01 ThinkerYzu

After clobbering my working directory, the problem have been fixed. But, audio seems broken. Dialer does not play tones. After check logcat, I believe it is about audio_policy. I remember dialer does not play tones, too, at beginning. It is also about audio_policy. I think @philikon or @qdot may know what is happened.

ThinkerYzu avatar Jan 16 '12 09:01 ThinkerYzu

I have shifted to another more flexible and less impacted way (I think so). Instead of rewrote BUILD_XXX, I let building system works as normal. After building system having found all Android.mk and loaded them, the code that I have added would look into ALL_MODULES and relative variables. Building system decides what targets should be built according these variables. The code would remove all targets with Java to prevent them from being built. It seems works fine for me. The only one exception is droiddoc targets, they don't generate modules. They are handled by rewriting BUILD_XXX.

ThinkerYzu avatar Jan 17 '12 09:01 ThinkerYzu

It is very similar to #123 the audio policy issue that I have mentioned.

ThinkerYzu avatar Jan 17 '12 13:01 ThinkerYzu

@michaelwu found that a maguro fix for mediaserver broken the sgs2. So your patches didn't cause that.

joneschrisg avatar Jan 17 '12 18:01 joneschrisg