Unused Include files finder

This is where you can post about tools related specifically to the POL Server itself

Moderator: POL Developer

Post Reply
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am
Location: Livorno, Italy
Contact:

Unused Include files finder

Post by Gnafu » Sat Aug 01, 2009 7:02 am

Hi everyone, I needed to know which .inc files are not used by my scripts so I wrote this little java tool to find them.
This program is to be used by experts, don't blame me if you delete some important .inc file :P
It works using the ecompile generated .dep file and checking if all the .inc files in the specified directories are all used by that .dep files.

The correct steps for spotting unused files are:
- place in a folder only the scripts you want to be check
- make sure ecompile generates dependencies files ("GenerateDependencyInfo 1" in ecompile.cfg)
- start ecompile in that folder
- move into that folder and type:
java -jar inc2trash.jar

That's all!
Help page:

Code: Select all

Unused Includes Finder v0.1
Author: Gnafu

This program will search the POL includes files (.inc) in all
subdirectories and will check if they are used by any compiled
script by looking into the dependencies files (.dep) found.

Usage: java -jar <thisfilename>.jar [args]

-?       :  This help
-v       :  Verbose
-s       :  Shows all the paths found
-p path  :  The root path to look into
By default if looks into its folder and subdirectories and shows the .inc files unused and the .inc files used but not found.
False positives cases:
- you are running the tool into the includes folder: it will list ALL of them as unused because there are no dep files in there
- you disabled some pkgs or they are not compiled: it will list all the .inc files in that pkgs as unused because there are no dep files in there

I hope it will be usefull to you too!!! :D

Please let me know how can I improve it (default behaviour, functions, etc..)
Attachments
inc2trash.zip
Unused Include Files v0.1
(3.39 KiB) Downloaded 106 times
Gnafu
DRL freelance scripter :D

Post Reply