ikvm
ikvm copied to clipboard
Enable Source Link for IkvmReference
Enable Source Link for generated assemblies from IkvmReference. IkvmReference can point to a JAR, but can also be augmented with some source information (such as a companion source JAR, or a URL prefix, or something), and embed the appropriate information into the generated assembly. Probably need our Portable PDB support for this.
There are two ways to provide source information: Source Link, and embedded source. Eventually ikvm should support both modes for different scenarios.
Thinking of use experience from ikvmc
's interface, we can add new parameters to it to support Source Link:
-
srcpath:<string>
- this is an existing parameter to locate the sources. This will affect the document name in PDB, as well as the source key in the Source Link document entry. -
sourcelink:<boolean>
- this will be a new parameter that will automatically identify a source link provider based on git information on local sources -
sourcelinkurl:<string>
- this will be a new parameter to explicitly specify the URL prefix of sources used by source link. This is useful when CSM enabled local source is not available, such as from a Maven repository, but embedded source is not preferred. This cannot be used together withsourcelink
parameter. -
embeduntrackedsources:<boolean>
- this will be a new parameter to embed sources not tracked by any CSM (when eithersourcelink
is not provided or the source file is not tracked in the local git repository). This cannot be used together withsourcelinkurl
parameter.
Speaking of the order of implementation, I propose:
-
embeduntrackedsources
- this should be the easiest implementation, and will unblock Maven integration. -
sourcelinkurl
- this is a nice to have feature to reduce the size of PDB. I believe this can be useful for libraries withMavenReference
. -
sourcelink
- this requires integration with CSM (git
/GitHub as a starting point), and provides the least use cases.