Wish Cross Platform Library Generation

Roycefer

Well-Known Member
Licensed User
Longtime User
If I write a bunch of pure B4X code in a bunch of modules, I can choose "Compile to Library" in the B4J IDE and that resulting library will run on B4A (with a little hacking), provided there's no JVM-specific code. It won't run on B4i. However, there's no reason why it can't run on B4i. It is, after all, pure B4X code. I could import all those modules individually into a B4i project and run them. But this is cumbersome and error-prone.

A better solution would be to create a new compilation option called "Compile to B4X Library" that will compile a bunch of B4X class or static code modules into a zipped package that can then be distributed, stored in B4J/A/i Additional Libraries folders and read by the B4J/A/i IDEs where it will be treated just like a normal library for that platform.
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Compiled code will never be cross platform as it is compiled to the native platform.
2. With the relatively new support for linked modules it is quite simple to share modules between projects. This is how I manage all the cross platform modules (HttpUtils2, DBUtils, all the XUI views and many others).
3. If possible then it is better to distribute the source code instead of a compiled library. It is more future proof and also allows developers to modify if needed.

With that said it is possible that in the future there will be a new package type that will hold uncompiled code.
 

Roycefer

Well-Known Member
Licensed User
Longtime User
My "Compile to B4X Library" was inelegantly phrased. That should be "Package to B4X Library". It's not compiling code, of course. Just packaging it into (probably) a zip file. Distributing and updating this zip file library would be a lot easier than trying to manage, say, 30 class modules, each with their own version numbers and intertwined dependencies and such. And for developers who want to modify the uncompiled code, they can just unzip the package and do so.
 
Top