Contributing to mkgmap

Hello, I am looking to contribute a feature to mkgamp - see other post on DEM tile naming - but I have a few questions. First of all I didn't really find a description on how to contribute properly - provided I manage to get it implemented. :-) What did I miss there? Second, I am at a stage where I managed to sucessfully build mkgmap locally and I would like to start it in IntelliJ a debugging session, using the included IntelliJ configuration. This fails. mkgmap does not recognize any command line options as they are loaded from a resource file with Main.class.getResourceAsStream("/help/en/options")). Naturally this fails when running it in the IDE as the function wants to load from a .jar file. How do you start a debug session in the IDE properly? bye, Nop

Hi Nop, the easiest way to contribute is to attach a patch to your post. I don't know about IntelliJ, I can only help with Eclipse, but the resource /help/en/options just tells mkgmap which options are documented. If you experiment with a new option you can use the prefix "x-". So, if you want to use a new option --my-opt before documenting it you use --x-my-opt. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Nop <nop@wanderreitkarte.de> Gesendet: Samstag, 9. Oktober 2021 09:44 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Contributing to mkgmap Hello, I am looking to contribute a feature to mkgamp - see other post on DEM tile naming - but I have a few questions. First of all I didn't really find a description on how to contribute properly - provided I manage to get it implemented. :-) What did I miss there? Second, I am at a stage where I managed to sucessfully build mkgmap locally and I would like to start it in IntelliJ a debugging session, using the included IntelliJ configuration. This fails. mkgmap does not recognize any command line options as they are loaded from a resource file with Main.class.getResourceAsStream("/help/en/options")). Naturally this fails when running it in the IDE as the function wants to load from a .jar file. How do you start a debug session in the IDE properly? bye, Nop _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Peter, I'm just trying to start it with some regular parameters to examine the workflow. If the /help/en/options file cannot be read, the member "validOptions" remains empty. mkgmap then rejects any parameter as invalid. if (validOptions != null && !validOptions.contains(option) && opt.isExperimental()) { throw new ExitException(String.format("Invalid option: '%s'", option)); So how do you start it from class files for debugging in the IDE? bye, Nop

Hi Peter, thinking about what you wrote, is it possible that this is a bug in mkgmap? If Main.getValidOptions() would return null if unable to read, it would work. But as it returns an empty Set, all normal options are rejected. And of course those are required to control mkgmap. bye, Nop

Hi Nop, a missing resource file is caused by a wrong build. I don't know how to fix that in IntelliJ. In Eclipse I just have to rebuild. Maybe try to build with ant on the command line first. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Nop <nop@wanderreitkarte.de> Gesendet: Samstag, 9. Oktober 2021 18:38 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Contributing to mkgmap Hi Peter, thinking about what you wrote, is it possible that this is a bug in mkgmap? If Main.getValidOptions() would return null if unable to read, it would work. But as it returns an empty Set, all normal options are rejected. And of course those are required to control mkgmap. bye, Nop _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Peter, I know the phenomenon from other applications. Main.class.getResourceAsStream("/help/en/options") works via the classloader. If running from a .jar, the resources have been packaged with the classes during build. But when launching from the IDE, the classes are located in ./classes while the resource file is still in a different path ./resources/help. Manually copying the resource files into classes/ allowed mkgmap to run, but as mkgmap includes an IntelliJ Run/Debug configuration I was amazed that it did not work. Well, let's concentrate on the feature. bye, Nop Am 09.10.2021 um 18:54 schrieb Gerd Petermann:
Hi Nop,
a missing resource file is caused by a wrong build. I don't know how to fix that in IntelliJ. In Eclipse I just have to rebuild. Maybe try to build with ant on the command line first.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Nop <nop@wanderreitkarte.de> Gesendet: Samstag, 9. Oktober 2021 18:38 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Contributing to mkgmap
Hi Peter,
thinking about what you wrote, is it possible that this is a bug in mkgmap?
If Main.getValidOptions() would return null if unable to read, it would work. But as it returns an empty Set, all normal options are rejected. And of course those are required to control mkgmap.
bye, Nop
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (2)
-
Gerd Petermann
-
Nop