2010-05-13 21:38:18 -04:00
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
2018-10-02 08:32:32 -04:00
2010-05-13 21:38:18 -04:00
http://www.apache.org/licenses/LICENSE-2.0
2018-10-02 08:32:32 -04:00
2010-05-13 21:38:18 -04:00
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
2018-10-02 08:32:32 -04:00
under the License.
2010-05-13 21:38:18 -04:00
-->
<!-- ====================================================================== -->
<!-- -->
<!-- Ant script for running OpenBooks -->
<!-- -->
<!-- ====================================================================== -->
2010-05-20 21:41:13 -04:00
<project name= "OpenBooks" default= "run" >
2010-05-14 16:29:27 -04:00
<property file= "run.properties" />
2010-05-13 21:38:18 -04:00
<property name= "jpa.provider" value= "openjpa" />
<property name= "load.properties" value= "load.properties" />
<property name= "demo.properties" value= "demo.properties" />
2018-10-02 08:32:32 -04:00
2010-05-13 21:38:18 -04:00
<path id= "run.classpath"
description="Runs on OpenBooks packaged library and database driver">
<pathelement location= "${basedir}" />
2010-05-14 17:42:37 -04:00
<fileset dir= "${basedir}" >
<include name= "*.jar" />
</fileset>
2010-05-13 21:38:18 -04:00
<fileset dir= "${openjpa.lib}" >
<include name= "*.jar" />
</fileset>
<pathelement location= "${jdbc.driver}" />
</path>
2018-10-02 08:32:32 -04:00
2010-05-13 21:38:18 -04:00
<target name= "check-env" description= "Checks if OpenJPA and JDBC driver exists" >
<available file= "${openjpa.lib}" property= "openjpa.exists" />
<available file= "${jdbc.driver}" property= "jdbc.driver.exists" />
2018-10-02 08:32:32 -04:00
<fail unless= "openjpa.exists" message= "The directory for OpenJPA libraries can not be located at ${openjpa.lib}. Make sure openjpa.lib property value is correectly specified in run.properties file" />
<fail unless= "jdbc.driver.exists" message= "The JDBC Driver can not be located at ${jdbc.driver}. Make sure jdbc.driver property value is correctly specified in run.properties file" />
2010-05-13 21:38:18 -04:00
</target>
2018-10-02 08:32:32 -04:00
2010-05-13 21:38:18 -04:00
<target name= "load" depends= "check-env"
description="Popluates a OpenBooks database with initial data">
<echo message= "Popluating a OpenBooks database with ${jpa.provider} as configured in ${load.properties}" />
<java classname= "openbook.server.DataLoader" fork= "true" >
<arg value= "OpenBooks" />
<arg value= "${load.properties}" />
<classpath refid= "run.classpath" />
</java>
</target>
2018-10-02 08:32:32 -04:00
2010-05-13 21:38:18 -04:00
<target name= "run" depends= "check-env"
2010-05-14 16:29:27 -04:00
description="Runs OpenBooks Demo">
<java classname= "openbook.client.Demo" fork= "true" >
<classpath refid= "run.classpath" />
</java>
2010-05-13 21:38:18 -04:00
</target>
2018-10-02 08:32:32 -04:00
</project>
2010-05-14 16:29:27 -04:00