Wish [XUI] Autocomposition of B4XLib

Star-Dust

Expert
Licensed User
Longtime User
The new versions allow you to create B4XLib which are class modules compressed in ZIP format and optionally a manifest.

Why not have a Compiler option in B4XLib?
Thus automatically creates the compressed B4XLib file with the class and the manifest

upload_2019-3-6_7-34-1.png
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
It might be added though the interface you are suggesting is not enough in many cases. For example it doesn't let you select which files will be included in the library.

It is very simple to create a batch file that will build the library and copy it to wherever you want.

Example of batch file used to build B4XFormatter:
B4X:
del B4XFormatter.b4xlib
jar cfM B4XFormatter.b4xlib *.bas manifest.txt

jar is part of Java JDK: https://docs.oracle.com/javase/tutorial/deployment/jar/build.html
 

Star-Dust

Expert
Licensed User
Longtime User
It might be added though the interface you are suggesting is not enough in many cases. For example it doesn't let you select which files will be included in the library.

It is very simple to create a batch file that will build the library and copy it to wherever you want.

Example of batch file used to build B4XFormatter:
B4X:
del B4XFormatter.b4xlib
jar cfM B4XFormatter.b4xlib *.bas manifest.txt

jar is part of Java JDK: https://docs.oracle.com/javase/tutorial/deployment/jar/build.html
It is true, but where there were no files to be added it would save a lot of time.

Also I suppose you can open a fileList of choice that you choose to choose among the resources that you would like to include.

Anyway it was my thought, because I'm lazy and I would like to save effort :p
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is true, but where there were no files to be added it would save a lot of time.
It will take you less than a minute to put the script I posted in a batch file and use it. Try it.
You can also modify it as needed and add more steps. For example to copy the created library to the additional libraries folder.
 

AnandGupta

Expert
Licensed User
Longtime User
Just to keep both happy and have the two cakes, I suggest to create a menu option "Run Custom Batch/Exe" which will shellrun/call a .bat/.exe with parameters given in some ini file.

This way Erel will just add a custom menu and StarDust and we also just have to add our batch/exe file to run.
(I am using such feature in a Text Editor)

Well just my two cent, for the cakes :)

Regards,

Anand
 

Star-Dust

Expert
Licensed User
Longtime User
I would have many Bach to add, for example all the titles created in B4J to help me in the development :p
 

AnandGupta

Expert
Licensed User
Longtime User
I would have many Bach to add, for example all the titles created in B4J to help me in the development :p
No problem there.
I use a batch file with menus to accomplish my such requirement,

rem bc
rem E:\Util\
rem Anand K Gupta Fri, 04 Jan 2019

@echo off
color 17
CLS
:MENU
ECHO.
echo.
echo ²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²
echo ²²²²²²²²²²²²²² ²²²²²²²²²²²²²²
echo ²²²²²²²²²²²²²² COMPARE WITH ±±²²²²²²²²²²²²
echo ²²²²²²²²²²²²²² ±±²²²²²²²²²²²²
echo ²²²²²²²²²²²²²² 1 - Beyond Compare ±±²²²²²²²²²²²²
echo ²²²²²²²²²²²²²² 2 - Ultra Compare ±±²²²²²²²²²²²²
echo ²²²²²²²²²²²²²² 0 - EXIT ±±²²²²²²²²²²²²
echo ²²²²²²²²²²²²²² ±±²²²²²²²²²²²²
echo ²²²²²²²²²²²²²²²²±±±±±±±±±±±±±±±±±±±±±±±±±±±²²²²²²²²²²²²
echo ²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²
echo.
ECHO.
SET /P M=Type 1, 2, or 0 then press ENTER:
IF %M%==0 GOTO EOF
IF %M%==1 GOTO BEYO
IF %M%==2 GOTO ULTR
GOTO EOF
:BEYO
rem do not use "%1" as %1 already has "
"C:\Program Files\Beyond Compare 4\BCompare.exe" %1 %2
GOTO EOF
:ULTR
rem do not use "%1" as %1 already has "
"c:\Program Files\IDM Computer Solutions\UltraCompare\uc.exe" %1 %2
GOTO EOF
:EOF
echo BYE
Exit

The Text Editor call this single batch file, and the batch file shows menu to further choose which bat/exe to run :)

Regards,

Anand
 

Star-Dust

Expert
Licensed User
Longtime User
Add the batch file to the project and double click to run it:

SS-2019-03-06_14.27.48.png
Generating the file compressed by the IDE would also be better for protection.

The IDE could have the option to encode (encrypt) the source of the B4XLib library for those who want to keep the private source.

So it would be readable for the IDE when compiling but not accessible to third parties.
 

hatzisn

Well-Known Member
Licensed User
Longtime User
If we use the "Export as zip" and rename to ".b4xlib" and then open the new file and delete all the files we do not want, wouldn't be the same?
 
Top