B4J Question [BANano] How not to clear the whole publish folder?

alwaysbusy

Expert
Licensed User
Longtime User
You can use this to prevent deletion of a folder:

B4X:
BANano.TranspilerOptions.DoNotDeleteFolderOnCompilation("FullPathToTheFolder")

It is however strongly advised NOT to put the 'root' there, but use subfolders. Setting it on the root will prevent deletion of the whole project and this can give unexpected results, versioning problems and lots of very hard to debug bugs.

So for example if my Webapp has a subfolder /jsons

C:\myApp\Objects\MyApp\
C:\myApp\Objects\MyApp\scripts\
C:\myApp\Objects\MyApp\assets\
C:\myApp\Objects\MyApp\styles\
C:\myApp\Objects\MyApp\jsons\

I could add a line in AppStart:

B4X:
BANano.TranspilerOptions.DoNotDeleteFolderOnCompilation(File.Combine(File.DirApp, "MyApp/jsons/")

Alwaysbusy
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
this can give unexpected results, versioning problems and lots of very hard to debug bugs.
Ohh, thanks for the clarity, I thought it would be easy as over-writing files it finds duplicated, perhaps it is more than just that.

Is it possible perhaps to have DoNotDeleteFileOnCompilation? This perhaps can help with this use case.

Thanks
 
Upvote 0
Top