Skip to content

Commit f1a2b9d

Browse files
author
Ryan
committed
moved version to properties file.
1 parent a740e19 commit f1a2b9d

1 file changed

Lines changed: 39 additions & 18 deletions

File tree

build.xml

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
<?xml version='1.0'?>
2+
3+
<!--
4+
Copyright 2011, 10gen
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at:
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
219
<project name="MongoDB Java Driver" default="compile" basedir=".">
320

421
<property name="version" value="2.7.0-pre"/>
22+
<property file="build.properties" prefix="build.conf"/>
23+
524
<property name="targetdir" location="target"/>
625
<property name="testdir" location="${targetdir}/test"/>
726
<dirname property="javabase" file="${java.home}"/>
@@ -38,8 +57,8 @@
3857
destdir="build/main"
3958
optimize="off"
4059
deprecation="off"
41-
source="1.5"
42-
target="1.5"
60+
source="${build.conf.javac.source}"
61+
target="${build.conf.javac.source}"
4362
encoding="ISO-8859-1"
4463
memoryMaximumSize="256M"
4564
fork="true"
@@ -54,7 +73,7 @@
5473
destdir="build/test"
5574
optimize="off"
5675
deprecation="off"
57-
source="1.5"
76+
source="${build.conf.javac.source}"
5877
encoding="ISO-8859-1"
5978
fork="true"
6079
debug="on"
@@ -71,8 +90,8 @@
7190
destdir="build/util"
7291
optimize="off"
7392
deprecation="off"
74-
source="1.5"
75-
target="1.5"
93+
source="${build.conf.javac.source}"
94+
target="${build.conf.javac.source}"
7695
encoding="ISO-8859-1"
7796
memoryMaximumSize="256M"
7897
fork="true"
@@ -83,28 +102,30 @@
83102
</javac>
84103
</target>
85104

86-
87105
<target name="jar" depends="compile" description="Create driver jar">
88106

107+
<copy file="src/main/META-INF/MANIFEST.MF" tofile="build/MANIFEST.MF" filtering="true">
108+
<filterset><filter token="VERSION" value="${build.conf.lib.version}"/></filterset>
109+
</copy>
110+
89111
<exec executable="git" output="build/main/git-hash">
90112
<arg value="log" />
91113
<arg value="--pretty=format:%H" />
92114
<arg value="-1" />
93115
</exec>
94116

95-
<jar jarfile="mongo.jar" manifest="src/main/META-INF/MANIFEST.MF" >
117+
<jar jarfile="mongo.jar" manifest="build/MANIFEST.MF">
96118
<fileset dir="build/main" />
97119
</jar>
98120

99-
<jar jarfile="bson.jar" >
100-
<fileset dir="build/main" >
121+
<jar jarfile="bson.jar">
122+
<fileset dir="build/main">
101123
<not>
102124
<filename name="com/"/>
103125
</not>
104126
</fileset>
105127
</jar>
106128

107-
108129
</target>
109130

110131
<target name="javadocs" depends="compile,utilcompile" description="Generate API docs">
@@ -113,10 +134,10 @@
113134
<javadoc packagenames="com.mongodb,com.mongodb.gridfs,com.mongodb.util,org.bson,org.bson.types,org.bson.io,org.bson.util"
114135
sourcepath="src/main/"
115136
defaultexcludes="yes"
116-
destdir="docs/${version}"
137+
destdir="docs/${build.conf.lib.version}"
117138
author="true"
118139
version="true"
119-
source="1.5"
140+
source="${build.conf.javac.source}"
120141
use="true"
121142
access="protected"
122143
>
@@ -134,15 +155,15 @@
134155
</jar>
135156

136157
<jar jarfile="mongo-javadoc.jar" >
137-
<fileset dir="docs/${version}" />
158+
<fileset dir="docs/${build.conf.lib.version}" />
138159
</jar>
139160

140161
<jar jarfile="bson-sources.jar" >
141162
<fileset dir="src/main" />
142163
</jar>
143164

144165
<jar jarfile="bson-javadoc.jar" >
145-
<fileset dir="docs/${version}" />
166+
<fileset dir="docs/${build.conf.lib.version}" />
146167
</jar>
147168

148169
</target>
@@ -192,7 +213,7 @@
192213
destdir="build/test"
193214
optimize="off"
194215
deprecation="off"
195-
source="1.5"
216+
source="${build.conf.javac.source}"
196217
encoding="ISO-8859-1"
197218
debug="on"
198219
includeantruntime="false">
@@ -215,7 +236,7 @@
215236
destdir="build/test"
216237
optimize="off"
217238
deprecation="off"
218-
source="1.5"
239+
source="${build.conf.javac.source}"
219240
encoding="ISO-8859-1"
220241
debug="on"
221242
includeantruntime="false">
@@ -249,15 +270,15 @@
249270
<target name="publish">
250271
<exec dir="." executable="python">
251272
<arg value="mavenPush.py"/>
252-
<arg value="${version}"/>
273+
<arg value="${build.conf.lib.version}"/>
253274
<arg value="/ebs/maven/"/>
254275
</exec>
255276
</target>
256277

257278
<target name="publish-local">
258279
<exec dir="." executable="python">
259280
<arg value="mavenPush.py"/>
260-
<arg value="${version}"/>
281+
<arg value="${build.conf.lib.version}"/>
261282
<arg value="~/.m2/repository/"/>
262283
</exec>
263284
</target>

0 commit comments

Comments
 (0)