Mkgmap/dev/Building

From OpenStreetMap Wiki
< Mkgmap‎ | dev
Jump to navigation Jump to search

To build MKGMap yourself you'll need to do the following to download the install source, and build it using ant or an IDE editor.

The instructions below are one possible way of doing this. They were carried out on a Windows XP with the source code being place in c:\mkgmap

Prerequisites

TortoiseSVN

TortoiseSVN is a GUI front-end to svn (Subversion), the version control system used to manage the mkgmap source code.

You can download this program form its website: http://tortoisesvn.net/downloads

You may then be asked to restart your machine

Java Runtime

You will need a Java Runtime enviroment. This can be download form http://www.java.com/en/

If you have already run MKGMap then you should have Java install on your machine alrady.

Java Development Kit

Download the Java Platform (JDK) from http://java.sun.com/javase/downloads/index.jsp. Once download install it.

Eclipse Java IDE

Download the Eclipse Java IDE editor from: http://eclipse.org/downloads. You will need the "Eclipde IDE for Java developers". Once it has downloaded, unzip the file. Open the unzipped folder and run "eclipse.exe".


Download the source code

Create the folder (in this case c:\mkgmap)

In Windows Explorer right click on the folder and choose "SVN Checkout".

Set the URL of respository to be: http://svn.mkgmap.org.uk/mkgmap/trunk Leave the checkout diretory as "c:\MKGMap" Set Checkout Depth to "Full recursive" Set Revision to "Head Revision"

Click OK and mkgmap will be downloaded. Once it has been download click OK

If you wish to update the code in the future then right click on the folder and choose "SVN Update" to update your code.

Alternative Download

You can obtain a snapshot of the source code from the mkgmap website. This avoids the need to install Tortoise SVN but will require all the code to be downloaded again if you want to update the code. If you follow this approach then any patches to the code you make/install are not automatically added to the new download.

Open in Eclipse

Eclipse will ask to select a workspace. Stick with the default or change it. At the next screen click the curled arrow to enter the workbench.

Select File->Import->General->Existing Projects into Workspace. Click next and set the root directory to "C:\mkgmap". Click "Finish". A tree will appear on the left with the mkgmap files.

Next find the path of the JDK (installed above). Then choose Window->Prefernces->Java->Installed JREs. Add a new JRE and set the "JRE Home" to be the folder where the JDK is installed. Click finish and make sure the new JDK is ticked rather than any existing VMS.

Build mkgmap

In Eclipse

Right click on "build.xml" and select "Run As"->"Ant Build". MKGMAP can now be found under c:\mkgmap\dist

From the command line

All required external jar files can be obtained running ant resolve.

To build a complete distribution package run ant dist from the top of the mkgmap source tree, where the build.xml file is located.

To clean up run ant clean, remove dist and build directories.

Patches

To apply patches from the mkgmap-dev mailing list:

  • Right click on the mkgmap item in tree
  • Choose Team->Apply Patch
  • You then apply the patch as a file (detach from the newgroup), the clipboard (copy it from the newgroup) or a URL. Click Finish to apply the patch