[patch] mkgmap-add-eclipse-support

Hi, I've been studying the mkgmap source for the past couple of days using eclipse and I needed this patch to get it work. Any chance this could be committed? Comments are appreciated. Cheers, Ben

Ben Konrath wrote:
Hi,
I've been studying the mkgmap source for the past couple of days using eclipse and I needed this patch to get it work. Any chance this could be committed? Comments are appreciated.
It seems my patch didn't go through. I've reattached it. Cheers, Ben Index: /home/ben/workspace/mkgmap/.project =================================================================== --- /home/ben/workspace/mkgmap/.project (revision 0) +++ /home/ben/workspace/mkgmap/.project (revision 0) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>mkgmap</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Index: /home/ben/workspace/mkgmap/src/uk/me/parabola/mkgmap/osmstyle/StyleFileLoader.java =================================================================== --- /home/ben/workspace/mkgmap/src/uk/me/parabola/mkgmap/osmstyle/StyleFileLoader.java (revision 856) +++ /home/ben/workspace/mkgmap/src/uk/me/parabola/mkgmap/osmstyle/StyleFileLoader.java (working copy) @@ -19,6 +19,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.Reader; +import java.net.MalformedURLException; import java.net.URL; import uk.me.parabola.log.Logger; @@ -146,6 +147,13 @@ // all style files must be in the same directory or zip URL url = classLoader.getResource(path); + if (url == null) { + try { + url = new File(System.getProperty("user.dir") + "/resources/" + path).toURI().toURL(); + } catch (MalformedURLException e) { + url = null; + } + } if (url == null) throw new FileNotFoundException("Could not find style " + path); Index: /home/ben/workspace/mkgmap/.classpath =================================================================== --- /home/ben/workspace/mkgmap/.classpath (revision 0) +++ /home/ben/workspace/mkgmap/.classpath (revision 0) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath>

Hi Ben
I've been studying the mkgmap source for the past couple of days using eclipse and I needed this patch to get it work. Any chance this could be committed? Comments are appreciated.
I will commit a modified version that does not make any java changes that I believe will work. I don't use eclipse though, so can everyone that does use it, please give me feedback. ..Steve

Hi Steve, On Sat, Jan 31, 2009 at 9:23 AM, Steve Ratcliffe <steve@parabola.demon.co.uk> wrote:
Hi Ben
I've been studying the mkgmap source for the past couple of days using eclipse and I needed this patch to get it work. Any chance this could be committed? Comments are appreciated.
I will commit a modified version that does not make any java changes that I believe will work. I don't use eclipse though, so can everyone that does use it, please give me feedback.
Thanks, that eclipse config did the trick. Cheers, Ben
participants (2)
-
Ben Konrath
-
Steve Ratcliffe