Is it possible to run only the preprocessor?

0 votes
asked Jul 18 in To be sorted by andreas.kagedal (250 points)

Hi,

Iis it possible to just run the preprocessor and get back a new plantuml file without any macros, !include or !define etc

I guess that this would be very useful for testing when implementing the preprocessor features and therefor should already be implemented internally and hidden from use by normal users.

If so, would it be possible to enable this also for users?

The reason I need this is that I need to do a SHA checksum on my the plantuml files and they need to get different checksum depending on what is !included etc. So I need to do the checksum after the preprocessor has been applied.

/Andreas

related to an answer for: View results of preprocessor

1 Answer

+2 votes
answered Jul 18 by plantuml (189,260 points)

WIth last beta http://beta.plantuml.net/plantuml.jar you can have :

java -jar /path/to/plantuml.jar -preproc foo.txt

Is this what you are looking for ?

commented Jul 24 by albert (2,690 points)
Would also be nice to have the time for 1 and e.g. 5 files. Why? It takes some time to start the plantuml task (jar has to be loaded, initialized etc.) and after this the code can be processed. I don't know if for each file a new thread is started (@plantuml?  some insights) or not. It also has to do with how plantuml handles the 'preproc'.
commented Jul 24 by plantuml (189,260 points)
Could you add -verbose flag and send us the result ?

java -jar <path-to-jar>/plantuml.jar -verbose -preproc <path-to-pu>/tmp_pu
containing around 20 pu-files and
java -jar <path-to-jar>/plantuml.jar -verbose -preproc <path-to-pu>/tmp_pu/ex1.pu <path-to-pu>/tmp_pu/ex2.pu <path-to-pu>/tmp_pu/ex3.pu
etc up to around 20 files.

Thanks!
commented Jul 24 by andreas.kagedal (250 points)
Just to clarify, I am the original poster for this question, but chrhe894 is my colleague and has taken over this from me. :-)

Great comunication! Thanks!
commented Jul 24 by chrhe894 (100 points)
Running with:

java -jar plantuml.jar -preproc -verbose svg

where svg is the folder with .pu-files.


The log with -verbose and for each file (of 23 or something):

(18.996 - 401 Mo) 351 Mo - Setting current dir: <path_to_svg>/svg

(18.996 - 401 Mo) 351 Mo - Using default charset

(18.996 - 401 Mo) 351 Mo - Setting current dir: <path_to_svg>/svg

(18.996 - 401 Mo) 351 Mo - Using default charset

(18.997 - 401 Mo) 350 Mo - Using default charset
 

Then repeats pattern of around 10 times:

(18.997 - 401 Mo) 350 Mo - Setting current dir: <path_to_macros>/plantuml_macros

(18.997 - 401 Mo) 350 Mo - Using default charset

(18.998 - 401 Mo) 349 Mo - Using default charset

(18.998 - 401 Mo) 349 Mo - Setting current dir: <path_to_macros>/plantuml_macros

(18.998 - 401 Mo) 347 Mo - Setting current dir: <path_to_macros>/plantuml_macros

(18.999 - 401 Mo) 347 Mo - Using default charset

(18.999 - 401 Mo) 347 Mo - Using default charset

Then finishes with:

(20.247 - 389 Mo) 346 Mo - Export preprocessing source to <path_to_svg>/svg/<name>.preproc
Duration 25.036 seconds.
commented Jul 24 by albert (2,690 points)
@chrhe894 I was looking for the times of a run with 1, 5 and 20 files to see whether or not I see any pattern. I think the question from @plantuml is better regarding the required information in respect to '-verbose'.
...