B4J Tutorial [AI] B4JBuilder: Building your projects via AI

Hi Fam

So im debuging SithasoDaisy5, so I was curious as to how the thing can build my project after debugging without me having to open the b4j IDE.

I referred CodeX to this b4x post and it figured out how to do it and built my project.


My b4xlib and my demo projects are in different folders, so all I had to do was indicate to it the source of my b4xlib, it compiled it after fixing syntax errors and fixing some bugs I picked up were available across my custom components.

Well, i'm impressed. This is helping with my productivity a great deal.


B4X:
Both projects built successfully via `B4JBuilder`:

- `C:\VisualStudio\BJL\SithasoDaisy5DemoCode\B4J\SithasoDaisy5DemoCode.b4j`
  - Output: `C:\VisualStudio\BJL\SithasoDaisy5DemoCode\B4J\Objects\SithasoDaisy5DemoCode.jar`
- `C:\b4j\workspace\SithasoDaisy5\SithasoDaisy5.b4j`
  - Output: `C:\b4j\workspace\SithasoDaisy5\Objects\SithasoDaisy5.jar`

No compile errors.

#SharingTheGoodness.
 

Mashiane

Expert
Licensed User
Longtime User
Building a BANano b4xlib i.e. SithasoDaisy5

I'm editing SithasoDaisy5 via vscode as Im automating some stuff with AI.

So this llm text is an example of how the b4xlib is build by the Codex

B4X:
Build `SithasoDaisy5.b4xlib` from scratch using CLI and BANano.

Goal:
- Rebuild `C:\b4j\libraries\SithasoDaisy5.b4xlib` and confirm timestamp changed.

Rules:
1. Use these exact paths:
   - Project: `C:\b4j\workspace\SithasoDaisy5\SithasoDaisy5.b4j`
   - Base folder: `C:\b4j\workspace\SithasoDaisy5`
   - Builder: `C:\Program Files\Anywhere Software\B4J\B4JBuilder.exe`
   - Java: `C:\b4j\java\bin\java.exe`
   - JavaFX libs: `C:\b4j\java\javafx\lib`
   - Output lib: `C:\b4j\libraries\SithasoDaisy5.b4xlib`

2. Before running jar, copy project metadata into `Objects` so BANano can resolve project name:
   - Copy `SithasoDaisy5.b4j` to `C:\b4j\workspace\SithasoDaisy5\Objects\`
   - Copy `SithasoDaisy5.b4j.meta` to `C:\b4j\workspace\SithasoDaisy5\Objects\`

3. Build compile:
   - `B4JBuilder -Task=Build -BaseFolder=... -Project=... -ShowWarnings=True`

4. Run jar with JavaFX modules (from `Objects` working directory):
   - `java.exe --module-path "C:\b4j\java\javafx\lib" --add-modules=javafx.controls,javafx.fxml,javafx.web,javafx.media,javafx.swing -jar "C:\b4j\workspace\SithasoDaisy5\Objects\SithasoDaisy5.jar"`

5. Verify success:
   - Console should include `Building C:\b4j\libraries\SithasoDaisy5.b4xlib`
   - Console should include `C:\b4j\libraries/SithasoDaisy5.b4xlib created!`
   - Output should end with `BANano v9.11: conversion finished!`
   - File `C:\b4j\libraries\SithasoDaisy5.b4xlib` must have a fresh `LastWriteTime`.

6. Report:
   - Build command used
   - Run command used
   - Key BANano log lines
   - Final `.b4xlib` size and timestamp
 

Mashiane

Expert
Licensed User
Longtime User
Building SithasoDaisyDemoCode

This llm text will be rules to build the demo project using the newly compiled SithasoDaisy5.b4xlib.

B4X:
Build and run a BANano B4J project from CLI and verify web publish output.

Goal:
- Compile project jar.
- Run BANano transpile/build.
- Confirm published web files are updated.

Inputs (replace only if needed):
- Project file: `C:\b4j\workspace\SithasoDaisy5DemoCode\B4J\SithasoDaisy5DemoCode.b4j`
- Base folder: `C:\b4j\workspace\SithasoDaisy5DemoCode\B4J`
- Builder: `C:\Program Files\Anywhere Software\B4J\B4JBuilder.exe`
- Java: `C:\b4j\java\bin\java.exe`
- JavaFX libs: `C:\b4j\java\javafx\lib`
- Jar output: `C:\b4j\workspace\SithasoDaisy5DemoCode\B4J\Objects\SithasoDaisy5DemoCode.jar`
- Publish folder: `C:\laragon\www\sd5demo`

Process:
1. Copy project metadata into `Objects`:
   - Copy `SithasoDaisy5DemoCode.b4j` to `...\B4J\Objects\`
   - Copy `SithasoDaisy5DemoCode.b4j.meta` to `...\B4J\Objects\`

2. Build project:
   - `B4JBuilder -Task=Build -BaseFolder=... -Project=... -ShowWarnings=True`

3. Run project with JavaFX modules from `Objects` working directory:
   - `java.exe --module-path "C:\b4j\java\javafx\lib" --add-modules=javafx.controls,javafx.fxml,javafx.web,javafx.media,javafx.swing -jar "...\\SithasoDaisy5DemoCode.jar"`

4. Wait until BANano completes:
   - Must see `BANano v9.11: conversion finished!`

5. Verify publish output:
   - Check timestamps for:
     - `C:\laragon\www\sd5demo\index.html`
     - `C:\laragon\www\sd5demo\scripts\app.js`
   - These timestamps must match current run time.

6. Report:
   - Build result (success/fail)
   - Key BANano log milestones (start/build/copy/finish)
   - Final publish file timestamps
   - Any warnings (for example missing `...\files` folder)
 
  • Like
Reactions: byz

hatzisn

Expert
Licensed User
Longtime User
Hi Fam

So im debuging SithasoDaisy5, so I was curious as to how the thing can build my project after debugging without me having to open the b4j IDE.

I referred CodeX to this b4x post and it figured out how to do it and built my project.


My b4xlib and my demo projects are in different folders, so all I had to do was indicate to it the source of my b4xlib, it compiled it after fixing syntax errors and fixing some bugs I picked up were available across my custom components.

Well, i'm impressed. This is helping with my productivity a great deal.


B4X:
Both projects built successfully via `B4JBuilder`:

- `C:\VisualStudio\BJL\SithasoDaisy5DemoCode\B4J\SithasoDaisy5DemoCode.b4j`
  - Output: `C:\VisualStudio\BJL\SithasoDaisy5DemoCode\B4J\Objects\SithasoDaisy5DemoCode.jar`
- `C:\b4j\workspace\SithasoDaisy5\SithasoDaisy5.b4j`
  - Output: `C:\b4j\workspace\SithasoDaisy5\Objects\SithasoDaisy5.jar`

No compile errors.

#SharingTheGoodness.

Thanks for the link. I did not even know that this existed as when I begun with B4A in 2014 I had taken on a large VB.NET project and I had to set aside temporarily the B4X world. The result was that I had never read this message.
 

aeric

Expert
Licensed User
Longtime User
You mean the AI can read the compilation logs or error message straight away?
And then what it is going to do next?

I am still developing with the IDE with all it's features as a human.
Clicking the Macro and CustomBuildAction are still helpful and fast.
Linking other class or module from another project folder with relative or absolute path is very useful too.

I don't need AI or have to use B4JBuilder, to build my libraries, yet.
 

Mashiane

Expert
Licensed User
Longtime User
You mean the AI can read the compilation logs or error message straight away?
Yes, this other time it redirected everything to a log file because there was a bug it could not solve. Well, eventially claude from the llmarena solves my issue. b4xcanvas related.

Just to give you a background. My process flow is creating a native component based on DaisyUI at the moment. So it creates the UI (replicated offcourse from css styling). Creates a demo page for me to test the component, then update the .b4a file module count and name to ensure this component is 'known'.

In my agents.md file there are scripts to 'screenshot' - take a device screenshot, 'perfect' - takes a backup after i confirm latest iteration is perfect, and 'spec ?', where I indicate which component it should build a specifications documents for. 'install' builds the project and installs it on my device.

I am still developing with the IDE with all it's features as a human.
Clicking the Macro and CustomBuildAction are still helpful and fast.
Linking other class or module from another project folder with relative or absolute path is very useful too.
I completely agree. For my use case, I have just found it easier to follow this approach as I'm using a completely AI built process at the moment and dont want to move fro and to. It demands a lot of patience though, as 'AI can make mistakes'.. ;)
 
Top