This repository has been archived by the owner on Aug 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
80 lines (68 loc) · 2.57 KB
/
build.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="protobuf-mobile" default="jar" basedir=".">
<dirname property="antfile.dir" file="${ant.file}"/>
<target name="install-generator">
<echo message="Note: This task needs to be run as root" />
<echo file="/usr/local/bin/protoc-gen-j2me">#!/bin/sh
cd ${antfile.dir}/generator
python j2megen.py
</echo>
<chmod perm="+rx" file="/usr/local/bin/protoc-gen-j2me" />
</target>
<target name="clean">
<delete failonerror="false" dir="dist" />
<delete failonerror="false" dir="build" />
<delete failonerror="false" dir="gen" />
</target>
<target name="build">
<mkdir dir="build/main" />
<javac srcdir="src"
destdir="build/main" target="1.4" />
</target>
<target name="jar" depends="build">
<mkdir dir="dist" />
<jar jarfile="dist/protobuf-mobile.jar">
<fileset dir="build/main"/>
</jar>
</target>
<target name="protoc-tests">
<delete failonerror="false" dir="test-generated"/>
<mkdir dir="gen/test"/>
<exec executable="protoc" failonerror="yes">
<arg value="--j2me_out=gen/test"/>
<arg value="-I"/>
<arg value="."/>
<arg value="unittest.proto"/>
</exec>
</target>
<target name="build-test-messages" depends="protoc-tests,build">
<mkdir dir="build/test-messages" />
<javac srcdir="gen/test"
destdir="build/test-messages" classpath="build/main"/>
</target>
<target name="build-tests" depends="build-test-messages,build">
<mkdir dir="build/tests" />
<javac srcdir="test"
destdir="build/tests" >
<classpath location="/usr/share/java/junit4.jar" />
<classpath location="build/main" />
<classpath location="build/test-messages" />
</javac>
</target>
<target name="test" depends="build-tests">
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<pathelement location="/usr/share/java/junit4.jar" />
<pathelement path="build/main"/>
<pathelement path="build/tests"/>
<pathelement path="build/test-messages"/>
</classpath>
<formatter type="plain" usefile="false"/>
<batchtest>
<fileset dir="test">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>