Description
Currently, TeaVM has a mechanism to replace packages as well as individual classes with kind of cumbersome mechanism based on property file (i.e. META-INF/teavm.properties
). Properties file was chosen initially for very simple use cases and then evolved without switching format to something more advanced. These mappings hard to maintain and they aren't well documentented.
Instead, a new mechanism should be developed to declare these mappings. I suggest to use most flexible approach available, i.e. to add API to add mappings, and register user-defined mapping logic using ServiceLoader convention. Another, more simple, approach could be implemented in addition to it to describe mappings declaratively, e.g. with JSON format. All this should be also carefully documented on TeaVM site.
Additionally, TeaVM lacks mechanism to map individual methods.