objectionary / ineo-maven-plugin

Maven plugin that inlines and specializes objects in EO programs
http://www.objectionary.com/ineo-maven-plugin/
MIT License
4 stars 2 forks source link

logs are not clear #37

Open yegor256 opened 10 months ago

yegor256 commented 10 months ago

I'm getting this log:

[INFO] --- ineo:0.1.2:fuse (default-cli) @ benchmark ---
[INFO] Processing files in /Volumes/sec/code/o/benchmark/target/generated-sources/xmir
[INFO] Processing /Volumes/sec/code/o/benchmark/target/generated-sources/xmir/org/eolang/benchmark/App.xmir
[INFO] Processing /Volumes/sec/code/o/benchmark/target/generated-sources/xmir/org/eolang/benchmark/B.xmir
[INFO] Processing /Volumes/sec/code/o/benchmark/target/generated-sources/xmir/org/eolang/benchmark/A.xmir
[INFO] Processing /Volumes/sec/code/o/benchmark/target/generated-sources/xmir/org/eolang/benchmark/Main.xmir
[INFO] Processing /Volumes/sec/code/o/benchmark/target/generated-sources/xmir/org/eolang/benchmark/F.xmir
[INFO] Fused 1 files
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

It's not clear, what exactly happened. What files were read? What files were saved? How much they were changed? What changes were applied?

Would be great to have something like this (reading from one directory, saving into another one!):

[INFO] --- ineo:0.1.2:fuse (default-cli) @ benchmark ---
[INFO] Processing files in target/generated-sources/xmir
[INFO] Saving file to target/generated-sources/xmir-after
[DEBUG] Processing target/generated-sources/xmir/org/eolang/benchmark/App.xmir (434 bytes)
[INFO] Optimized XMIR saved to target/generated-sources/xmir-after/App.xmir (554 bytes)
...
[INFO] Fused 1 file(s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

IMPORTANT: we should read files from one directory and save new versions of them (after optimization) into another directory!

maxonfjvipon commented 10 months ago

@yegor256 are you sure we should rewrite all files in OTHER directory? For example we optimized org/eolang/benchmark/App.xmir and saved it in org/eolang/xmir-after/App.xmir. It means that we should replace all fqns of the first object with the second one. Otherwise the second object won't be used at all. Current version does not move App.xmir and adds new BA.xmir to the current package

yegor256 commented 10 months ago

@maxonfjvipon we should take everything from inputDirectory, save to outputDirectory, and then modify the content inside the outputDirectory. Modifying the sources is a very bad idea, since it will confuse the user.