build.xml modifications for nightbuilds. Added cleanup, compile, upload.

Semantics of the original jar and build command is not changed, it can be used
as before.
the ant-lib will probrably stay here and will be removed from OsmAnd project.



git-svn-id: https://osmand.googlecode.com/svn/trunk@836 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
pavol.zibrita 2010-12-17 11:53:05 +00:00
parent ca6755718e
commit 12e69de000
9 changed files with 82 additions and 16 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,14 +1,46 @@
<!-- build JAR libraty -->
<project name="DataExtractionOSM" default="build" basedir=".">
<target name="jar">
<path id="build-classpath">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<property name="file.to.upload" value="OsmAndMapCreator-nightbuild.zip"/>
<property name="src.dir" value="src"/>
<property name="src.absolute.dir" location="${src.dir}" />
<property name="bin.dir" value="bin"/>
<property name="bin.absolute.dir" location="${bin.dir}" />
<property name="lib.dir" value="lib"/>
<property name="lib.absolute.dir" location="${lib.dir}" />
<path id="ant.lib.path">
<fileset dir="ant-lib" includes="*.jar" />
</path>
<path id="build.path">
<fileset dir="${lib.absolute.dir}">
<include name="*.jar"/>
</fileset>
</path>
<property file="local.properties" />
<target name="-dirs">
<mkdir dir="${bin.absolute.dir}"/>
</target>
<target name="clean">
<delete dir="${bin.absolute.dir}"/>
</target>
<target name="compile" depends="-dirs">
<javac srcdir="${src.absolute.dir}"
destdir="${bin.absolute.dir}"
classpathref="build.path"
debug="on"
source="1.6"
/>
</target>
<target name="jar" depends="-dirs">
<manifestclasspath property="lib.list" jarfile="OsmAndMapCreator.jar">
<classpath refid="build-classpath"/>
<classpath refid="build.path"/>
</manifestclasspath>
<echo>list is ${lib.list}</echo>
@ -21,10 +53,10 @@
</manifest>
<jar destfile="OsmAndMapCreator.jar" manifest="MANIFEST.MF">
<fileset dir="bin">
<fileset dir="${bin.absolute.dir}">
<include name="**/*" />
</fileset>
<fileset dir="src">
<fileset dir="${src.absolute.dir}">
<include name="**/*.java" />
</fileset>
</jar>
@ -63,5 +95,29 @@
<delete file="OsmAndMapCreator.jar" />
</target>
</project>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="ant.lib.path" />
<target name="update">
<svn svnkit="true">
<update dir="." revision="HEAD" />
<info target="." />
</svn>
<echo>Updated to revision: ${svn.info.rev}</echo>
</target>
<target name="nightbuild" depends="clean,update,compile,build">
<move file="build.zip" tofile="${file.to.upload}"/>
<ftp action="del" server="download.osmand.net" userid="${ftp.user}" password="${ftp.password}">
<fileset>
<include name="night-builds/${file.to.upload}" />
</fileset>
</ftp>
<ftp server="download.osmand.net" remotedir="night-builds" userid="${ftp.user}" password="${ftp.password}" depends="yes">
<fileset dir=".">
<include name="${file.to.upload}" />
</fileset>
</ftp>
</target>
</project>

View file

@ -0,0 +1,11 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked in Version Control Systems,
# as it contains information specific to your local configuration.
# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
ftp.user=osmand
ftp.password=

View file

@ -24,6 +24,7 @@ import static net.osmand.osm.io.OsmBaseStorage.ELEM_WAY;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@ -33,6 +34,7 @@ import java.util.Map.Entry;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.stream.XMLOutputFactory;
import net.osmand.Algoritms;
import net.osmand.data.MapObject;
@ -43,9 +45,6 @@ import net.osmand.osm.Relation;
import net.osmand.osm.Way;
import net.osmand.osm.Entity.EntityId;
import com.sun.org.apache.xerces.internal.impl.PropertyManager;
import com.sun.xml.internal.stream.writers.XMLStreamWriterImpl;
public class OsmStorageWriter {
private final String INDENT = " ";
@ -59,12 +58,12 @@ public class OsmStorageWriter {
public void saveStorage(OutputStream output, OsmBaseStorage storage, Collection<EntityId> interestedObjects, boolean includeLinks) throws XMLStreamException, IOException {
Map<EntityId, Entity> entities = storage.getRegisteredEntities();
Map<EntityId, EntityInfo> entityInfo = storage.getRegisteredEntityInfo();
PropertyManager propertyManager = new PropertyManager(PropertyManager.CONTEXT_WRITER);
// transformer.setOutputProperty(OutputKeys.INDENT, "yes");
// String indent = "{http://xml.apache.org/xslt}indent-amount";
// transformer.setOutputProperty(indent, "4");
XMLStreamWriter streamWriter = new XMLStreamWriterImpl(output, propertyManager);
XMLOutputFactory xof = XMLOutputFactory.newInstance();
XMLStreamWriter streamWriter = xof.createXMLStreamWriter(new OutputStreamWriter(output));
List<Node> nodes = new ArrayList<Node>();
List<Way> ways = new ArrayList<Way>();
List<Relation> relations = new ArrayList<Relation>();