Share My Creation (Tool) (B4X) ZipperWm - based on Erel's Zipper tool, with additional functionality - source included

Objective:
Add some additional flexibility to @Erel's Zipper utility (https://www.b4x.com/android/forum/threads/comment-links-with-date-and-time.132262/#post-834930)

That utility enables us to have this in our B4XPages projects:
B4X:
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project.zip

This version introduces something like this, which can be used in traditional (i.e. non-B4XPages) projects as well:
B4X:
'Ctrl + click to export as zip: ide://run?File=%ADDITIONAL%\ZipperWm.jar&Args=|target|%PROJECT_NAME%_%YYYY%-%MM%-%DD%.zip|exclude|%ADDITIONAL%\zipperwmexclusions.txt|movedown|explorerwine|/usr/bin/nemo

Usage:
- create an exclusions file if desired (see below)
- put ZipperWm.jar and the exclusions file (if desired; it can be stored anywhere you like) in the relevant (B4A/B4I/B4J) additional libraries directories
- add the IDE comment link to your project - see above for an example ("ide://...")

Arguments:
- just one string, starting with the delimiter character between the different arguments you're passing (see above for an example)
- valid arguments are: target <file name or path> exclude <exclusions file path> explorerwine <path to file manager executable> movedown
- defaults: target file name 'Project.zip', no exclusions file, no explorer for wine specified, no 'movedown'
- 'movedown': moves the zip file into the project's top-level directory (as opposed to letting it stay in the parent directory); a B4XPages project is detected by the presence of the 'Shared Files' directory
- 'explorerwine': when running the IDE on Linux under wine, this one can be used to open the containing directory after processing; that environment is detected by having a non-empty-string environment variable 'WINEPREFIX'; otherwise it is ignored
- additional argument substitutions (case-SENSITIVE): %DD%, %MM%, %YYYY% for date parts; %HH%, %mm%, %SS% for time parts

Exclusions file (a text file):
- contents are case-insensitive
- lines without a valid prefix or without a value after the '=' are ignored
- multiple lines may exist for each of the 4 types
- directory name (only the name, not the full path): 'D=...' (e.g.: D=archive)
- file extension (with or without a leading '.'): 'E=...' (e.g.: E=exe)
- file name (only the name, not the full path; including extension): 'F=...' (e.g.: F=notneeded.txt)
- full path (file or directory): 'P=...' (e.g.: P=C:\Users\Me\Documents\MyProject\skipthis)

I'll attach the project in a minute.

Enjoy!
 

Attachments

  • ZipperWm.zip
    4.5 KB · Views: 52
Last edited:
Top