Android Question How can I change the generated Java code?

wonder

Expert
Licensed User
Longtime User
In B4x (B4A / B4J), I would like to apply some of my own optimizations. In order to do so, I'd like to use a command line find and replace tool (similar to sed in linux).

So far, I have no problems altering the generated Java file from the command line, but I'm unable to do so using the #CustomBuildAction attribute.

So, my question is, how can I alter the B4x generated Java code, just before it gets compiled?

EDIT: I want to alter the Java code BEFORE it gets compiled, not after.
 
Last edited:

wonder

Expert
Licensed User
Longtime User
Step 6 happens after Java compilation... not before.

Ok, so after reading what I wrote once again, I see that I might not have explained myself properly in the first post, so I'll try again...

To my understanding, B4x parses the user code (BASIC style) into B4x Java code. Once the parsing is complete, the Java code is compiled. Correct?



I would like to know, is is possible to introduce changes to the parsed Java code, right before it gets compiled?
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…