Project

General

Profile

« Previous | Next » 

Revision 5295

Added by Matt Jones over 14 years ago

Modified the build.xml to include a new task for building the dataone
service api package, which generates a jar file that is put into lib. This
task depends on maven being installed in maven.home, and depends on the
DataONE service_api being checed out in a sibling directory to the build.
If these conditions are not met, then the build skips the dataone build and
instead just uses the checked in service-api jar file.

View differences:

build.properties
11 11
# build.tomcat.dir=/usr/local/tomcat
12 12
build.tomcat.dir=/usr/local/devtools/jakarta-tomcat
13 13

  
14
# The Maven2 installation directory, for building the dataone-service-api
15
# Maven is available here: http://maven.apache.org/
16
maven.home=/opt/local/share/java/maven2
17

  
14 18
# install ant target uses this to determine where to drop 
15 19
# the war file in an installation.  Test classes will use
16 20
# this value to find metacat.properties
......
80 84
#  do NOT need to be configured
81 85
#metacat.dir=/home/daigle/workspace/metacat
82 86

  
87
# The location of the dataone source code, defaulting to a directory
88
# rooted at a sibling of the current build directory
89
d1.dir=../dataone/allsoftware/cicore/service_api
90

  
build.xml
29 29
	* along with this program; if not, write to the Free Software
30 30
	* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31 31
-->
32
<project name="metacat" default="jar" basedir=".">
32
<project name="metacat" default="jar" basedir="."
33
         xmlns:artifact="antlib:org.apache.maven.artifact.ant">
33 34
	<property environment="env" />
34 35
	<property file="build.properties" /><!-- USER SPECIFIC PROPS -->
35 36

  
36 37

  
38
    <!-- Configure the maven2 ant tasks -->
39
    <path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.0.jar" />
40
    <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
41
             uri="antlib:org.apache.maven.artifact.ant"
42
             classpathref="maven-ant-tasks.classpath" />
37 43

  
38

  
39 44
	<!-- Determine if ecogrid should be installed-->
40 45
	<condition property="enable.ecogrid">
41 46
		<equals arg1="${install.ecogrid}" arg2="true" />
......
46 51
		<equals arg1="${make.perl.code}" arg2="true" />
47 52
	</condition>
48 53

  
54
	<!-- Determine if dataone-service should be built-->
55
	<condition property="d1.available">
56
        <and>
57
	        <available file="${d1.dir}"/>
58
	        <available file="${maven.home}"/>
59
        </and>
60
	</condition>
61

  
49 62
	<target name="config">
50 63
        <!-- Find the servlet-api.jar, depending on the tomcat version. -->
51 64
		<property name="t5.jar" 
......
378 391
			url="/tmp/KeplerWebService.wsdl" />
379 392
	</target>
380 393

  
381
	<target name="compile" depends="prepare,utilities"
394
	<target name="compile" depends="dataone-service,prepare,utilities"
382 395
		description="Compiles java code to build dir, and copies metacat props files there">
383 396

  
384 397
		<javac srcdir="${build.src}" destdir="${build.dest}"
......
1502 1515
			<fileset dir="${dist.dir}" />
1503 1516
		</copy>
1504 1517
	</target>
1518

  
1519
    <!-- Build the dataone service, but only if it is checked out as a
1520
         sibling of the current build directory. Requires maven2 to
1521
         be installed and on the path. -->
1522
    <target name="dataone-service" if="d1.available">
1523
        <property name="d1.jar" value="dataone-service-api-0.1.0.jar"/>
1524

  
1525
        <artifact:mvn pom="${d1.dir}/pom.xml" fork="true"
1526
                      mavenHome="${maven.home}">
1527
            <arg value="install"/>
1528
        </artifact:mvn>
1529
		<copy file="${d1.dir}/target/${d1.jar}" todir="${lib.dir}" />
1530
    </target>
1505 1531
</project>

Also available in: Unified diff