Other B4J v10.5 BETA with integrated Code Bundle tool has been released

Erel

B4X founder
Staff member
Licensed User
Longtime User
Code Bundle is a tool that packs your project together with additional relevant information into a single json file, that can be provided to AI assistants for debugging, learning, refactoring and other tasks.



The bundle is created with a click of a button (Ctrl + R). The bundle includes:
  • Project code + list of public APIs. Keys are sanitized based on heuristic templates.
  • (optional) Logs + compilation output + warnings and errors list. Compilation output is included when the dialog is visible.
  • (optional) Layouts + designer script.
  • (optional) Paths configuration.
  • List of files. Files content is not added.
  • List of libraries with additional information for each library.
  • Current caret location with the code around it - the AI knows where you are focused on right now.
  • Additional information about the IDE and useful links for the AI to find more information.
How to use:
- Click on Ctrl + R. A json file will be created and copied to the clipboard. Paste into the AI assistant and ask questions.

I tested it with several AI platforms and the results are quite good. The answers are mostly to the point. Not always so be cautious.

Other improvements:
  • Autocomplete in #If lines:


  • Fix for String.ToLower not explicitly setting the locale. Mainly fixes the Turkish I: https://www.b4x.com/android/forum/t...ctly-for-the-turkish-language.163961/#content
  • PyBridge template updated.
  • New #Macro / comment link options:
    • librariesrefresh - set to True to automatically refresh the libraries after the task runs.
    • codesync - set to True to force the IDE to synchronize the code modules with the files.
    • autosave - set to True to automatically save the project BEFORE running the task. Note that Tools - IDE Options - Auto Save should be enabled for this to have effect.
    • filessync (not new) - set to True to synchronize the Files tab after the task.
    • cleanproject (not new) - set to True to "clean project" after the task
    • %STATE1% - new variable that causes the IDE to create a temporary file with the IDE state based on the new options under Tools - IDE Options. The file path will be passed to the process. This is used by Code Bundle and can be used by other similar tools. Note that the format is not final and can be modified.
  • Objects\Temp folder is deleted when cleaning project.
  • Json library updated and maps now preserve order when writing or reading.
  • Other bug fixes and minor improvements.

Download link: https://www.b4x.com/b4j/files/beta.exe

Edit: a file is missing that causes non-ui apps to fail in debug mode. You can download it here: https://www.b4x.com/android/forum/t...e-tool-has-been-released.170433/#post-1043406
 
Last edited:

Swissmade

Well-Known Member
Licensed User
Longtime User
Top this Erel and Team many thanks.
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
I mostly work with ChatGPT (plus) but I can't say that it is better than others with regards to B4X code.
I use ChatGPT many times and it can do a good job for B4X.
But also if the question is not really clear then you will get a mess.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Awesome, thanks for the heads up. My concerns though about putting our code bases to AI is that it goes to the public domain and it gets used for Ai training. I could be wrong. Is there an option to keep your content local and not use it for training?

I think there were cases where users fed these models code and in later responses it gave back their code as responses. I think I read that in passing I could be wrong too.

Is there some protection for not open source code bases with AI tools? Restrictions etc?
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
I tried on Copilot - this is what is said.


I think that's a thumbs up from Copilot.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Hello Erel,
Hmm, error in debug mode, using all version of Java with a background worker app.


Error:
B4J Version: 10.50 BETA #1
Parsing code.    (0.03s)
    Java Version: 19
Building folders structure.    (0.00s)
Compiling code.    (0.09s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
Compiling generated Java code.    (2.32s)
Compiling debugger engine code.    Error
error: file not found: C:\Program Files\Anywhere Software\B4J\debug_java_nonui_modules.txt

arguments: -J-Xmx4096m -d shell\bin\classes  @"C:\Program Files\Anywhere Software\B4J\debug_java_nonui_modules.txt"  -Xmaxerrs 1 -nowarn -Xlint:none  -target 9 -source 9 -version -encoding UTF-8 -cp "C:\Program Files\Anywhere Software\B4J\libraries\jdebugrapid.jar";shell\bin\classes\  shell\src\com\simplysoftware\mabackgroundworker\database.java shell\src\com\simplysoftware\mabackgroundworker\database_subs_0.java shell\src\com\simplysoftware\mabackgroundworker\ecwid.java shell\src\com\simplysoftware\mabackgroundworker\ecwid_subs_0.java shell\src\com\simplysoftware\mabackgroundworker\httpjob.java shell\src\com\simplysoftware\mabackgroundworker\httpjob_subs_0.java shell\src\com\simplysoftware\mabackgroundworker\httputils2service.java shell\src\com\simplysoftware\mabackgroundworker\httputils2service_subs_0.java shell\src\com\simplysoftware\mabackgroundworker\main.java shell\src\com\simplysoftware\mabackgroundworker\main_subs_0.java shell\src\com\simplysoftware\mabackgroundworker\optimoroute.java shell\src\com\simplysoftware\mabackgroundworker\optimoroute_subs_0.java shell\src\com\simplysoftware\mabackgroundworker\quartzscheduler.java shell\src\com\simplysoftware\mabackgroundworker\quartzscheduler_subs_0.java shell\src\com\simplysoftware\mabackgroundworker\sharedcode.java shell\src\com\simplysoftware\mabackgroundworker\sharedcode_subs_0.java shell\src\com\simplysoftware\mabackgroundworker\simplyinvoice.java shell\src\com\simplysoftware\mabackgroundworker\simplyinvoice_subs_0.java shell\src\com\simplysoftware\mabackgroundworker\syncstock.java shell\src\com\simplysoftware\mabackgroundworker\syncstock_subs_0.java


Tip: press Ctrl + R to export IDE state for AI assistants.

The only version that I can get this particular background worker app to compile with in debug mode is OpenJDK...\JDK_V25.0.2\bin\javac.exe, but even the compile windows says that it is infact Java Version: 8, which it isnt.
B4X:
B4J Version: 10.50 BETA #1
Parsing code.    (0.04s)
    Java Version: 8
Building folders structure.    (0.02s)
Compiling code.    (0.11s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
Compiling generated Java code.    (0.01s)
Compiling debugger engine code.    (0.01s)
Running application.    (0.00s)
Completed successfully.

Please note, that this is only happening in debug mode of a background worker app. In debug mode with every other desktop(JFX) app using my default java version which is Java Version: 19, all desktop apps work in both debug and also release mode.

i've gone back to using B4J V10.30 (x64).exe where the background worker app that i'm working on can be compiled and debugged using Java Version: 19, which 10.50 BETA #1 currently will not allow me to do.

I hope that this is enough information to help you clear up this issue. debug_java_modules.txt does clearly exist under B4J V10.30, but t appears that debug_java_nonui_modules.txt does not exist under B4J V10.50 BETA #1.

But saying that, I have absolutely no idea what I'm talking about...
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
I can only compile to java 19.0.2, and if you use the #JavaCompilerPath: 21, C:\Java\jdk-21.0.2\bin\javac.exe to override the path config, i get errors


B4J Version: 10.50 BETA #1
Parsing code. (0.30s)
Java Version: 21
Building folders structure. (0.05s)
Compiling code. (0.28s)
Compiling layouts code. (0.02s)
Organizing libraries. (0.00s)
Compiling generated Java code. Error
error: module not found: javafx.swing
1 error
only showing the first 1 errors, of 6 total; use -Xmaxerrs if you would like to see more

arguments: -J-Xmx2048m -d bin\classes @"C:\Program Files\Anywhere Software\B4J\release_java_modules.txt" -p "C:\Java\jdk-21.0.2\bin\..\javafx\lib" -Xmaxerrs 1 -nowarn -Xlint:none -target 9 -source 9 -version -encoding UTF-8 -cp "C:\B4X\B4J\Aditional Libraries\apachestringutilsb4j.jar";"C:\Program Files\Anywhere Software\B4J\libraries\byteconverter.jar";"C:\B4X\B4J\Aditional Libraries\jaudiorecord.jar";"C:\B4X\B4J\Aditional Libraries\jaudiotrack.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jb4xencryption.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jcontrolsfx9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jcore.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jfx.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jnetwork.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jrandomaccessfile.jar";"C:\Program Files\Anywhere Software\B4J\libraries\json.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jsql.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jstringutils.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jwebsocketclient.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jxui.jar";"C:\B4X\B4J\Aditional Libraries\threading.jar";"C:\B4X\B4J\Aditional Libraries\commons-strutils.jar";"C:\Program Files\Anywhere Software\B4J\libraries\controlsfx-9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/jetty-util-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/websocket-core-common-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/websocket-jetty-api-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/websocket-jetty-common-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/websocket-jetty-client-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/jetty-security-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/jetty-io-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/jetty-http-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/slf4j-api-2.0.0-alpha6.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/websocket-core-client-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/jetty-client-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jserver/jetty-slf4j-impl-11.0.9.jar";"C:\Program Files\Anywhere Software\B4J\libraries\okhttp.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jbitmapcreator.jar";"C:\Program Files\Anywhere Software\B4J\libraries\jdateutils.jar";"C:\Program Files\Anywhere Software\B4J\libraries\javaobject.jar";"C:\Program Files\Anywhere Software\B4J\libraries\xcustomlistview.jar";"C:\Program Files\Anywhere Software\B4J\libraries\okhttp-4.9.0.jar";"C:\Program Files\Anywhere Software\B4J\libraries\okio-2.8.0.jar";"C:\Program Files\Anywhere Software\B4J\libraries\okhttp-urlconnection-4.9.3.jar";"C:\Program Files\Anywhere Software\B4J\libraries\kotlin-stdlib-1.6.10.jar";"C:\Program Files\Anywhere Software\B4J\libraries\cssutils.jar";"v:\jdbc\sqljdbc_13.2\enu\jars\mssql-jdbc-13.2.1.jre11.jar";"C:\B4X\B4J\Aditional Libraries\bcprov-jdk15on-159.jar";"C:\B4X\B4J\Aditional Libraries\sqlite-jdbc-3.36.0.1.jar";"C:\Program Files\Anywhere Software\B4J\libraries\materialicons.jar";"C:\Program Files\Anywhere Software\B4J\libraries\fontawesome.jar";;bin\classes\ src\islesystems\aspect\ptt\dispatcher\animatedcounter.java src\islesystems\aspect\ptt\dispatcher\anotherprogressbar.java src\islesystems\aspect\ptt\dispatcher\b4jtextflow.java src\islesystems\aspect\ptt\dispatcher\b4xbitset.java src\islesystems\aspect\ptt\dispatcher\b4xbreadcrumb.java src\islesystems\aspect\ptt\dispatcher\b4xbytesbuilder.java src\islesystems\aspect\ptt\dispatcher\b4xcache.java src\islesystems\aspect\ptt\dispatcher\b4xcollections.java src\islesystems\aspect\ptt\dispatcher\b4xcolortemplate.java src\islesystems\aspect\ptt\dispatcher\b4xcombobox.java src\islesystems\aspect\ptt\dispatcher\b4xcomparatorsort.java src\islesystems\aspect\ptt\dispatcher\b4xdatetemplate.java src\islesystems\aspect\ptt\dispatcher\b4xdialog.java src\islesystems\aspect\ptt\dispatcher\b4xfloattextfield.java src\islesystems\aspect\ptt\dispatcher\b4xformatter.java src\islesystems\aspect\ptt\dispatcher\b4ximageview.java src\islesystems\aspect\ptt\dispatcher\b4xinputtemplate.java src\islesystems\aspect\ptt\dispatcher\b4xlisttemplate.java src\islesystems\aspect\ptt\dispatcher\b4xloadingindicator.java src\islesystems\aspect\ptt\dispatcher\b4xlongtexttemplate.java src\islesystems\aspect\ptt\dispatcher\b4xorderedmap.java src\islesystems\aspect\ptt\dispatcher\b4xplusminus.java src\islesystems\aspect\ptt\dispatcher\b4xprogressdialog.java src\islesystems\aspect\ptt\dispatcher\b4xradiobutton.java src\islesystems\aspect\ptt\dispatcher\b4xsearchtemplate.java src\islesystems\aspect\ptt\dispatcher\b4xseekbar.java src\islesystems\aspect\ptt\dispatcher\b4xset.java src\islesystems\aspect\ptt\dispatcher\b4xsignaturetemplate.java src\islesystems\aspect\ptt\dispatcher\b4xswitch.java src\islesystems\aspect\ptt\dispatcher\b4xtimedtemplate.java src\islesystems\aspect\ptt\dispatcher\cls_channel_groupchat.java src\islesystems\aspect\ptt\dispatcher\cls_channel_listen.java src\islesystems\aspect\ptt\dispatcher\cls_channel_request_freeslot.java src\islesystems\aspect\ptt\dispatcher\cls_channel_request_user_groupchat.java src\islesystems\aspect\ptt\dispatcher\cls_groupchat.java src\islesystems\aspect\ptt\dispatcher\cls_sql.java src\islesystems\aspect\ptt\dispatcher\copyonwritelist.java src\islesystems\aspect\ptt\dispatcher\copyonwritemap.java src\islesystems\aspect\ptt\dispatcher\dbutils.java src\islesystems\aspect\ptt\dispatcher\db_sqlite.java src\islesystems\aspect\ptt\dispatcher\httpjob.java src\islesystems\aspect\ptt\dispatcher\httputils2service.java src\islesystems\aspect\ptt\dispatcher\isac_g711_alaw.java src\islesystems\aspect\ptt\dispatcher\isac_g729b_decoder.java src\islesystems\aspect\ptt\dispatcher\isac_g729b_encoder.java src\islesystems\aspect\ptt\dispatcher\keygenerator.java src\islesystems\aspect\ptt\dispatcher\madewithlove.java src\islesystems\aspect\ptt\dispatcher\main.java src\islesystems\aspect\ptt\dispatcher\metro.java src\islesystems\aspect\ptt\dispatcher\mod_const.java src\islesystems\aspect\ptt\dispatcher\mod_functions.java src\islesystems\aspect\ptt\dispatcher\mod_ptt_channels.java src\islesystems\aspect\ptt\dispatcher\mod_security.java src\islesystems\aspect\ptt\dispatcher\mod_settings.java src\islesystems\aspect\ptt\dispatcher\roundslider.java src\islesystems\aspect\ptt\dispatcher\scrollinglabel.java src\islesystems\aspect\ptt\dispatcher\sf.java src\islesystems\aspect\ptt\dispatcher\swiftbutton.java src\islesystems\aspect\ptt\dispatcher\websockethandler.java src\islesystems\aspect\ptt\dispatcher\xuiviewsutils.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_acelp.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_bits.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_clsp.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_commonoperations.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_dec_ld8k.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_dtx.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_ld8k.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_ld8kshared.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_lpc.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_notes.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_pitch.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_postfilter.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_postprocess.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_pwf.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_quagain.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_util.java src\islesystems\aspect\ptt\dispatcher\zz_isac_g729b_vad.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_apnotes.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_channel.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_channel_activity_item.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_groupchat.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_login.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_main.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_settings.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_show_listen_channel_item.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_show_users_offline.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_show_user_channel_item.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_show_user_groupchat.java src\islesystems\aspect\ptt\dispatcher\designerscripts\\LS_show_user_presence.java
javac 21.0.2


Tip: press Ctrl + R to export IDE state for AI assistants.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Hey Manfred.
You've seen me, probably too much alcohol. Maybe I'm just going blind as I completely missed that post

Thank you
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is there some protection for not open source code bases with AI tools? Restrictions etc?
The code bundle tool doesn't do anything else except of creating the bundle file. It has no control over the AI behavior or terms. You can run a local LLM if you want.

Note that your code will not become public domain by uploading it to ChatGPT or similar services. In some cases it can be used to train the model.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I can only compile to java 19.0.2, and if you use the #JavaCompilerPath: 21, C:\Java\jdk-21.0.2\bin\javac.exe to override the path config, i get errors
I'm able to compile with Java 21.0.2:
B4X:
#JavaCompilerPath: 21, D:\java\jdk-21.0.2\bin\javac.exe
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private xui As XUI 
    Private Button1 As B4XView
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Layout1")
    MainForm.Show
    Log(GetSystemProperty("java.version", ""))
End Sub

Are you sure that you put JavaFX in the correct place?

 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Thanks for the clarity @Erel. Apparently, we just need to turn some settings off on the models so that ones conversations and code might not be used to "train models", I will also check on my side where that is set. ChatGPT is indicating that for business accounts, there is a somewhat protection from training, however any other account from pro and downwards, if the settings are not tuned off, stuff can be used for model traing.

My concern was mainly this.

So one just needs to be careful. I'm clear now, thanks again.
 
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
My concern was mainly this.
that's the issue with AI: your code may not become "public domain" but how can you be sure it won't show up as a suggestion for another user?
API keys may be masked-out but the code may contains sensitive data of other types.
AI business accounts may provide some "on-the-paper" "legal" protection against this, but data leaks are always possible.
AI usage with free accounts is the main issue here: if it's free, the payment is "you".

I'm not saying "do not use AI", rather than "use it wisely, not blindfolded"
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Yep, thats the problem javafx not included in jdk 20+
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
thanks for the knowledge update ! I am using javafx from jdk 19.0.2 with all jdk version newer the 19.0.2 to 25.0.2 and all compiles well, with the exception of 26 + 27 using javaFx19
 
Last edited:
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
@LucaMs Possibly because it's just one line in the file, that's what got rejected, not the file size.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Hello @Mashiane,
You should start a new thread regarding this matter, as this really isn't the place for it. You already have my personal response via pm

Cheers and enjoy

My concern was mainly this.


So one just needs to be careful. I'm clear now, thanks again.
My personal thoughts are simple:
I don't mind my B4X code being used to help train the LLM that I use now and again, especially on my account. Some people on here moan and complain that LLMs are not perfect with the B4X language (even though they scrapes the forum to learn from), yet those same people also say that they don't want their own fully working code on LLM to help it learn. And no, I'm not having a go at any one individual, I'm just saying.

Anyway:
Set Auto-Delete: All my accounts have this set either to not save data at all, or to save for only 3 months, except for my location data, that's on all the time for my history of holidays abroad.

You can tell Google to automatically wipe your data after a specific period. Obviously some B4X users on here are bound to say that Google don't really do that, preempt.

You have the setting:
In certain regions (like the UK and EU), you have more granular control over whether your data is used to improve the model.

You can always use "Incognito" or Guest Modes.
On some platforms, using a Guest mode or not signing in prevents the session from being linked to your permanent account history, though some basic logging for safety still occurs.

Sorry Erel for the hijack, I'm all for your Code Bundle tool and I will definitely be using it more and more in the future, thank you
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…