Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Possible to access list of included methods from Linker?

52 views
Skip to first unread message

Alexander Bertram

unread,
Apr 5, 2025, 4:29:05 PMApr 5
to GWT Users
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

Craig Mitchell

unread,
Apr 7, 2025, 9:33:01 PMApr 7
to GWT Users
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

Colin Alworth

unread,
Apr 8, 2025, 7:22:32 AMApr 8
to GWT Users
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.
Reply all
Reply to author
Forward
0 new messages