Changeset 9357 in josm


Ignore:
Timestamp:
2016-01-09T19:05:20+01:00 (3 years ago)
Author:
simon04
Message:

fix #12321 - Allow JOSM to be compiled outside of repository root directory

Regression of r9133.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r9330 r9357  
    648648    <target name="epsg-compile" depends="compile">
    649649        <mkdir dir="build2"/>
    650         <javac sourcepath="" srcdir="scripts"
     650        <javac sourcepath="" srcdir="scripts" failonerror="true"
    651651            destdir="build2" target="1.7" source="1.7" debug="on" includeantruntime="false" createMissingPackageInfoClass="false" encoding="UTF-8" classpath="build">
    652652        </javac>
     
    655655    <target name="epsg" depends="epsg-compile">
    656656        <touch file="${epsg.output}"/>
    657         <java classname="BuildProjectionDefinitions">
     657        <java classname="BuildProjectionDefinitions" failonerror="true">
    658658            <classpath>
    659659                <pathelement path="."/>
     
    661661                <pathelement path="build2"/>
    662662            </classpath>
     663            <arg value="${basedir}"/>
    663664        </java>
    664665    </target>
  • trunk/scripts/BuildProjectionDefinitions.java

    r9231 r9357  
    22
    33import java.io.BufferedWriter;
     4import java.io.File;
    45import java.io.FileOutputStream;
    56import java.io.IOException;
     
    4849     */
    4950    public static void main(String[] args) throws IOException {
    50         buildList();
     51        buildList(args[0]);
    5152    }
    5253
    53     static void buildList() throws IOException {
    54         List<ProjectionDefinition> pdJosm = Projections.loadProjectionDefinitions(JOSM_EPSG_FILE);
     54    static void buildList(String baseDir) throws IOException {
     55        List<ProjectionDefinition> pdJosm = Projections.loadProjectionDefinitions(baseDir + File.separator + JOSM_EPSG_FILE);
    5556        for (ProjectionDefinition pd : pdJosm) {
    5657            epsgJosm.put(pd.code, pd);
    5758        }
    58         List<ProjectionDefinition> pdProj4 = Projections.loadProjectionDefinitions(PROJ4_EPSG_FILE);
     59        List<ProjectionDefinition> pdProj4 = Projections.loadProjectionDefinitions(baseDir + File.separator + PROJ4_EPSG_FILE);
    5960        for (ProjectionDefinition pd : pdProj4) {
    6061            epsgProj4.put(pd.code, pd);
     
    6263
    6364        try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
    64                 new FileOutputStream(OUTPUT_EPSG_FILE), StandardCharsets.UTF_8))) {
     65                new FileOutputStream(baseDir + File.separator + OUTPUT_EPSG_FILE), StandardCharsets.UTF_8))) {
    6566            out.write("## This file is autogenerated, do not edit!\n");
    6667            out.write("## Run ant task \"epsg\" to rebuild.\n");
Note: See TracChangeset for help on using the changeset viewer.