B4i v3.50 adds support for library compilation. This is similar to the feature available in B4A and B4J: https://www.b4x.com/android/forum/t...pile-your-project-to-a-library.24750/#content
This makes it easier to build reusable components and share them in multiple projects or with other developers.
It also saves compilation time and allows splitting large projects.
Compiling to a library is simple:
1. Add #LibraryName and #LibraryVersion attributes to the main module.
2. Compile with Tools - Build Server - Compile To Library (Alt + 5)
All modules except of the main module (or any other module explicitly excluded with #ExcludeFromLibrary attribute) will be compiled as a static library.
As the main module is excluded, other modules cannot directly reference it or compilation will fail.
Note that you can use CallSub to call subs in excluded modules.
The output is made of three files:
- The XML file which will be created in the additional libraries folder.
- .a and .h files will be created in the Mac Libs folder.
This means that you can immediately use the libraries.
You can choose Tools - Build Server - Download Last Build to download a zip file with the three library files.
Note that if you are using the hosted builder then you need to first receive a permission to compile a specific library. Please contact [email protected] and send your hosted builder id and the library name.
This makes it easier to build reusable components and share them in multiple projects or with other developers.
It also saves compilation time and allows splitting large projects.
Compiling to a library is simple:
1. Add #LibraryName and #LibraryVersion attributes to the main module.
2. Compile with Tools - Build Server - Compile To Library (Alt + 5)
All modules except of the main module (or any other module explicitly excluded with #ExcludeFromLibrary attribute) will be compiled as a static library.
As the main module is excluded, other modules cannot directly reference it or compilation will fail.
Note that you can use CallSub to call subs in excluded modules.
The output is made of three files:
- The XML file which will be created in the additional libraries folder.
- .a and .h files will be created in the Mac Libs folder.
This means that you can immediately use the libraries.
You can choose Tools - Build Server - Download Last Build to download a zip file with the three library files.
Note that if you are using the hosted builder then you need to first receive a permission to compile a specific library. Please contact [email protected] and send your hosted builder id and the library name.