Changes between Version 78 and Version 79 of InstallNotes


Ignore:
Timestamp:
2016-01-16T17:05:07+01:00 (10 years ago)
Author:
simon04
Comment:

Compiling → DevelopersGuide/Compiling

Legend:

Unmodified
Added
Removed
Modified
  • InstallNotes

    v78 v79  
    121121
    122122== Getting the Source ==
    123 JOSM is available under GPL, and so of course you can get the sources and compile, modify or redistribute it by yourself. You can grab the sources via [https://subversion.apache.org subversion]
    124 {{{
    125 #!sh
    126 svn co https://josm.openstreetmap.de/svn/trunk josm
    127 }}}
    128 Or you can inspect single files over the web frontend at [/svn] (or [/browser]).
     123→ [[Download#Source]]
    129124
    130125== Compiling ==
    131 === Using ant ===
    132 The easiest way to compile JOSM, provided [https://www.java.com/en/download/faq/develop.xml Java JDK] and [https://ant.apache.org/ Ant] on your machine are properly set up, is to go to the josm directory and type:
    133 
    134 {{{
    135 #!sh
    136 ant
    137 }}}
    138 
    139 That will create a `dist/josm-custom.jar` file if successful.
    140 
    141 === Using eclipse ===
    142 
    143 Use eclipse and the provided `.project` and `.classpath` file. Just add a new Java Project using the JOSM source folder as existing path.
    144 
    145 As of Eclipse 3.5.2 and the latest JOSM (August 10, 2011), you will have problems compiling, due to problems compiling Mappaint MapCSS with a fresh install of Eclipse. First you will need the [http://www.engr.mun.ca/~theo/JavaCC-FAQ/javacc-faq-moz.htm JavaCC] [http://eclipse-javacc.sourceforge.net/ plugin for Eclipse]. To install it in Eclipse, go to Help->New Software... then add the site [http://eclipse-javacc.sourceforge.net/] as a source, and install the JavaCC Eclipse Plug-in. Then in the Package Explorer, expand org.openstreetmap.josm.gui.mappaint.mapcss, right-click on MapCSSParser.jj, and "Compile with JavaCC". This should put new java files in a package called org.openstreetmap.josm.gui.mappaint.mapcss.parsergen, but if it doesn't, you will have to create the package manually (right-click and create package), then drag the new files into the package you just created (they should be easy to identify based on the light gray text that denotes it was compiled from MapCSSParser.jj). This should resolve any import issues in MapCSSStyleSource.java, and you should now be able to compile JOSM.
    146 
    147 If you try to compile the JOSM sources in Eclipse and get errors like "The method marktr(String) is undefined for the type SomeType" look at [https://lists.openstreetmap.org/pipermail/josm-dev/2008-August/001585.html solution suggested at mailing list].
    148 
    149 There are also two Videos available at youtube, which show [https://www.youtube.com/watch?v=-LoWGf-hqiQ how to checkout JOSM into Eclipse] and [https://www.youtube.com/watch?v=Z3OjG3nDvzA how to checkout a JOSM plugin into Eclipse].
    150 
    151 == Unit Tests ==
    152 
    153 It is most convenient, to run tests from an IDE like Eclipse or Netbeans. There is also an ant task to run all tests (but you cannot rerun individual tests).
    154 
    155 All unit tests can be run in headless mode (i.e, without a graphic display), allowing them to be run in continuous integration projects.
    156 
    157 === Running Test from Command line ===
    158 
    159 You can run tests from the command line, as well. Include all libraries in the class path like this:
    160 {{{
    161 #!sh
    162 export TESTCP=".:test/unit:test/functional:dist/josm-custom.jar:test/lib/fest/fest-assert-1.0.jar:test/lib/fest/MRJToolkitStubs-1.0.jar:test/lib/fest/jcip-annotations-1.0.jar:test/lib/fest/fest-swing-1.1.jar:test/lib/fest/fest-reflect-1.1.jar:test/lib/fest/fest-util-1.0.jar:test/lib/fest/debug-1.0.jar:test/lib/junit/junit-4.11.jar:test/lib/jfcunit.jar:test/lib/unitils-core/ognl-2.6.9.jar:test/lib/unitils-core/commons-lang-2.3.jar:test/lib/unitils-core/unitils-core-3.3.jar:test/lib/unitils-core/commons-logging-1.1.jar:test/lib/unitils-core/commons-collections-3.2.jar"
    163 }}}
    164 Then run for example
    165 {{{
    166 #!sh
    167 javac -cp $TESTCP test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
    168 java -cp $TESTCP org.junit.runner.JUnitCore org.openstreetmap.josm.data.projection.ProjectionRefTest
    169 }}}
     126→ [[DevelopersGuide/Compiling]]
    170127
    171128== See also ==