Open Bug 1281900 Opened 3 years ago Updated 3 months ago

[meta] Improve the JNI preprocessing build experience


(Firefox Build System :: Android Studio and Gradle Integration, defect, P5)



(Not tracked)


(Reporter: nalexander, Unassigned)


(Depends on 2 open bugs)


(Keywords: meta)

Full disclosure: I don't really understand how this works and how it could be improved -- I just know it's pretty bad.

If I understand correctly, the C++ code built during the compile tier requires some generated code and headers to build.  We check that generated code into the tree and have a manual process to update it [1].  The generated code is produced by build/annotationProcessors, although this is a white lie -- it's not actually a Java Annotation Processor, it's just a Java program that we run.  That program processes the *compiled* Java JAR files; that is, it depends on having built the Java in mobile/android/base to complete.

To improve this, we might:

1) build the Java code before the compiled C++ code, potentially by adding a java tier, alternately by compiling Java during the compile tier and adding some cross directory dependencies.

2) generate the source and header files automatically each build, without checking them into the tree.

3) profit.

This is a fair amount of work.  In the glorious future, we might make the annotation processing code a real Java Annotation Processor so that it fits into the Gradle build system smoothly, in which case we'd really want to build the Java first.

One reason we might not want to do this: building the Java stuff is slow (1.5-2 minutes on my laptop) and largely serial.  Anything that delays getting to the long and highly-parallel compile tier is bad news.

Any other suggestions for improving this?

[1] See and
Making this a meta ticket to track multiple pieces.
Depends on: 918337, 839587, 794982
Keywords: meta
Summary: Improve the JNI preprocessing build experience → [meta] Improve the JNI preprocessing build experience
Product: Core → Firefox Build System
Component: General → Build Config & IDE Support
Product: Firefox Build System → Firefox for Android
Re-triaging per

Needinfo :susheel if you think this bug should be re-triaged.
Priority: -- → P5
Product: Firefox for Android → Firefox Build System
You need to log in before you can comment on or make changes to this bug.