Tuesday, April 8, 2025

Re: Possible to access list of included methods from Linker?

Depending on what exactly you're after, you're right Craig. After a fashion, the existing symbolmaps and sourcemaps also have this information.

Linkers aren't the right place to _collect_ what you need here Alex - unlike a conventional C linker, GWT linkers are more about taking already "linked" (using C's definition) application code and packaging it (and other required strings/bytes) into files for use at runtime. With that said, the SymbolMapLinker shows how to _read_ the symbol map data from the compiler - you could consider customizing this to do additional logic at link time, or you could read the existing symbol data after the compile+link is complete.

If all you need is the java method names and their corresponding js name, that data is probably enough - take a look at CompilationResult.getSymbolMap() (or the generated symbolMap output). If you want call tree info, I think the compiler report output will have what you need (in giant gzipped files), and if you want more detail about the class or methods themselves and what was pruned from the original, the sourcemap should be able to help here by letting you read which lines were actually retained from a given source file.


On Monday, April 7, 2025 at 8:33:01 PM UTC-5 ma...@craig-mitchell.com wrote:
Isn't that what the SoycReportLinker does?  Ie. It creates a report telling you what has been used:  https://www.gwtproject.org/doc/latest/DevGuideCompileReport.html

On Sunday, 6 April 2025 at 6:29:05 am UTC+10 Alexander Bertram wrote:
Hi all,

I'm implementing a custom linker as a subclass of AbstractLinker. Is it possible to determine from the set of Artifacts, or other information, if specific Java methods were included in the final emitted build?

Thanks!

Alex

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/4a8121d4-6031-42dc-8e8b-e3e35172996bn%40googlegroups.com.

No comments:

Post a Comment