-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.xml
More file actions
99 lines (87 loc) · 3.5 KB
/
build.xml
File metadata and controls
99 lines (87 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<project name="nanomaps-server-dist" default="instance">
<property name="instance.dir" location="instance"/>
<!--
Prepare development dependencies. Builds sub-projects and
compiles native libraries
-->
<target name="depend" unless="depend.skip">
<ant dir="sources/common" target="depend" inheritall="false"/>
</target>
<!--
Clean dependencies.
-->
<target name="depend-clean">
<ant dir="sources/common" target="clean" inheritall="false"/>
</target>
<target name="depend-check">
<available file="sources/common/depend/mapnik-jni.jar" property="depend.skip"/>
</target>
<target name="depend-message" if="depend.skip">
<echo>Not rebuilding dependencies. To force rebuilding dependencies run 'ant depend-clean depend'</echo>
</target>
<target name="depend-conditional" depends="depend-check,depend,depend-message"/>
<!--
Build the instance
-->
<target name="instance" depends="depend-conditional">
<!-- Copy libraries -->
<mkdir dir="${instance.dir}/lib"/>
<copy todir="${instance.dir}/lib">
<fileset dir="sources/common/depend"/>
</copy>
<!-- Compile -->
<ant dir="sources/nanomaps-server" target="jar" inheritall="false"/>
<copy todir="${instance.dir}/lib" file="sources/nanomaps-server/build/nanomaps-server.jar"/>
</target>
<!-- Clean local sources -->
<target name="clean">
<ant dir="sources/nanomaps-server" target="clean" inheritall="false"/>
<delete dir="${instance.dir}/lib"/>
<echo>Not cleaning dependencies. To clean dependencies run 'ant depend-clean'</echo>
</target>
<target name="report-ulimit">
<exec executable="sh" outputproperty="report.ulimit" osfamily="unix">
<arg value="-c"/>
<arg value="ulimit -n"/>
</exec>
<property name="report.ulimit" value="unknown"/>
<echo>I'd like to take this chance to point out what your limit</echo>
<echo>on open file descriptors is.</echo>
<echo></echo>
<echo> File descriptor limit=${report.ulimit}</echo>
<echo></echo>
<echo>You can take this information for what its worth but be aware that</echo>
<echo>this is a non-blocking http server that caches mapnik map instances.</echo>
<echo>Depending on the complexity of your maps, this can easily be hundreds</echo>
<echo>of file descriptors per worker thread (default to the number of cpus).</echo>
<echo>In addition, each http connection, persistent or otherwise, uses one.</echo>
<echo>You may want to increase this to an astronomical value. Just sayin.</echo>
</target>
<!-- Run -->
<target name="run" depends="instance,report-ulimit">
<property name="run.options" value="-Xmx128m"/>
<mkdir dir="${instance.dir}/logs"/>
<java classname="net.rcode.nanomaps.server.ServerMain"
fork="true"
dir="${instance.dir}"
>
<sysproperty key="log4j.configuration" value="file:etc/log4j-console.properties"/>
<sysproperty key="java.library.path" value="lib"/>
<jvmarg line="${run.options}"/>
<arg value="etc/server-defaults.properties"/>
<arg value="etc/server-local.properties"/>
<classpath>
<fileset dir="${instance.dir}/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</java>
</target>
<target name="-debug-setup">
<property name="debug.suspend" value="n"/>
<property name="debug.port" value="1044"/>
<echo>Launching process with debug.suspend=${debug.suspend} and debug.port=${debug.port}</echo>
<property name="run.options" value="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=${debug.suspend},address=${debug.port}"/>
</target>
<target name="debug" depends="-debug-setup,run"/>
</project>