Wish IDE Shared+Files Path [Resolved, use %ADDITIONAL%]

swChef

Active Member
Licensed User
Longtime User
ref:
B4X:
#CustomBuildAction: folders ready, %JAVABIN%\java.exe, -jar C:\Users\H\Downloads\compiletime.jar

I would like to use an environment variable or IDE construct to access the compiletime.jar in the CustomBuildAction, so the same exact CBA line can be in any project on any computer I use despite installation/setup path differences.

Is there a mechanism to reference the IDE SharedFiles path in a CBA that isn't an absolute or relative path, that the IDE supports? I'd rather not implement my own environment variable, or pop it into JAVABIN.
B4X:
#CustomBuildAction: folders ready, %JAVABIN%\java.exe, -jar %Shared+Files%\Utils\compiletime.jar
or similar.
 

swChef

Active Member
Licensed User
Longtime User
The following does not work.
B4X:
#CustomBuildAction: 2, %JAVABIN%\java.exe, -jar %JAVABIN%\compiletime.jar

Error: Unable to access jarfile %JAVABIN%\compiletime.jar
Also tried running B4A as administrator.

Also tried
B4X:
#CustomBuildAction: 2, %JAVABIN%\java.exe, -jar %JAVABIN%\..\..\IDEJars\compiletime.jar
 
Last edited:

swChef

Active Member
Licensed User
Longtime User
Thanks. Given that, I found these, which list more %% vars.
https://www.b4x.com/android/forum/threads/b4x-comment-links.119897/
https://www.b4x.com/android/forum/threads/comment-links-with-date-and-time.132262/#post-834861

However when I tried %ADDITIONAL%
B4X:
#CustomBuildAction: 2, %JAVABIN%\java.exe, -jar %ADDITIONAL%\compiletime.jar
The compiler fails with
B4X:
Running custom action.    Error
Error: Unable to access jarfile %ADDITIONAL%\compiletime.jar
If I swap in the full path, it does work.
Going back to -jar %ADDITIONAL%\compiletime.jar; if I put the jar in the B4A subfolder of the additional libraries folder, it still errors.
Checking file properties on the jar there is a security notice, which I unblocked, but still doesn't work.
unblock.png

I also tried %B4X%, same error.
B4X:
-jar %B4X%\compiletime.jar
And even %PROJECT% gives the same error.
It would seem the environment variables do not work in that CBA parameter location, or I need more help. Only filesystem paths are working, including absolute and relative paths. The following does work, with the jar in the project folder, as does the full path.
B4X:
-jar ..\compiletime.jar
Using B4A 10.70.
 
Top