[protege] / protege-collab / trunk / build.xml
Project Root:

protege: protege-collab/trunk/build.xml

File: [protege] / protege-collab / trunk / build.xml (download) (as text)
Revision: 14527, Fri Jun 12 22:31:08 2009 UTC (5 months, 1 week ago) by tredmond
File size: 6046 byte(s)
the internal build script was out of sync
<?xml version = "1.0" encoding = "utf-8"?>
<project name = "Protege Collaboration Plugins" default = "dist" basedir = ".">    
   <property file="local.properties"/>
   <property environment="env"/>
   <property name="protege.home" value="${env.PROTEGE_HOME}"/>

   <property name = "src"             value = "./src"/>  
   <property name = "build"           value = "./build"/>
   <property name = "classes"         value = "${build}/classes"/>  
   <property name = "plugins"         value = "${build}/plugins"/>
   <property name = "lib"             value = "./lib"/>
   <property name = "plugin_dist"     value = "edu.stanford.smi.protege.collab"/>
   <property name = "pluginName"      value = "protege-collab"/>


    <!-- 
       #  ********** Finding Protege Libraries. *************
       # 
       #  We are using an approach that allows developers to decide
       #  whether to hand copy the needed jars into the lib directory or
       #  to point them to a protege installation.
      -->
    <target name="checkProtegeHome">
      <condition property="protege.home.set">
        <available file="${protege.home}/protege.jar" type="file"/>
      </condition>
    </target>
    
    <target name="useProtegeHome" depends="checkProtegeHome" if="protege.home.set">
      <echo message="Using Protege Home = ${protege.home} to find protege jars"/>
      <property name="protege.lib"       location="${protege.home}/protege.jar"/>
      <property name="protege.owl.lib"   location="${protege.home}/plugins/edu.stanford.smi.protegex.owl/protege-owl.jar"/>
      <property name="chat.lib"          location="${protege.home}/plugins/edu.stanford.smi.protegex.chatPlugin/chat.jar"/>
      <property name="changes.lib"       location="${protege.home}/plugins/edu.stanford.smi.protegex.changes/change-management.jar"/>
    </target>
    
    <target name = "checkProtegeLibs" depends="useProtegeHome">
      <condition property="libs.found">
        <and>
          <available file="${protege.lib}"       type = "file"/>
          <available file="${protege.owl.lib}"   type = "file"/>
          <available file="${chat.lib}"          type = "file"/>
          <available file="${changes.lib}"       type = "file"/>
        </and>
      </condition>
      <path id = "project.classpath">    
        <pathelement location = "${protege.lib}"/>
        <pathelement location = "${protege.owl.lib}"/>
        <pathelement location = "${chat.lib}"/>
        <pathelement location = "${changes.lib}"/>
        <pathelement location = "./lib/jcalendar.jar"/>
      </path>

    </target>

    <target name="checkProtegeLibsAndReport" depends="checkProtegeLibs"
            unless="libs.found">
      <echo message="Missing protege libraries.  You can either "/>
      <echo message="set the PROTEGE_HOME environment variable to a"/>
      <echo message="protege installation directory where the"/>
      <echo message="appropriate plugins have been installed or copy the"/>
      <echo message="needed jars into the lib directory"/>
      <echo message="Use the -v option to ant to determine which library is missing."/>
      <fail message="build aborted"/>
    </target>
      
   <!-- 
     #  ********** Finding Protege Libraries Done. *************
     -->

	
   <target name = "init">
     <tstamp>
       <format property="build.time" pattern="MM/dd/yyyy hh:mm aa"/>
     </tstamp>
     <mkdir dir = "${build}"/>
     <mkdir dir = "${classes}"/>
     <mkdir dir = "${plugins}"/>
     <mkdir dir = "${plugins}/${plugin_dist}"/>
   </target>  


   <target name = "compile" depends = "init, checkProtegeLibsAndReport">    
     <javac srcdir = "${src}"
            destdir = "${classes}" debug="on"
            includeAntRuntime="false">
       <classpath refid = "project.classpath"/>    
     </javac>
     <copy todir="${classes}">
       <fileset dir="${src}">
         <include name="**/*"/>
         <exclude name="**/*.java"/>
         <exclude name="**/MANIFEST.MF"/>
         <exclude name="**/manifest.mf"/>
       </fileset>
     </copy>
   </target>

   <target name = "jar" depends = "compile">
     <copy todir="${build}" 
           file="${src}/META-INF/MANIFEST.MF" overwrite="true"/>
     <manifest file="${build}/MANIFEST.MF" 
               mode = "update">
        <attribute name="Built-By" value = "${user.name}"/>
        <attribute name="Build-Date" value = "${build.time}"/>
     </manifest>
     <jar jarfile = "${plugins}/${plugin_dist}/${pluginName}.jar" 
          basedir = "${classes}" 
          manifest = "${build}/MANIFEST.MF"/>  
     <copy file = "plugin.properties"
           todir = "${plugins}/${plugin_dist}"/>
     <copy file = "about_protege_collab.html"
	   todir = "${plugins}/${plugin_dist}"/>
     <copy todir = "${plugins}/${plugin_dist}">
       <fileset dir="${lib}" includes="*.jar"/>
     </copy>
   </target>

   <target name = "dist" depends = "jar">
     <zip basedir = "${plugins}"
          includes = "${plugin_dist}/**"
          destfile = "${build}/${pluginName}.zip"/>
   </target>

   <target name = "update" depends = "jar">
      <fail message = "set the protege.home variable to do an install">
         <condition>
            <not>
              <isset property="protege.home"/>
            </not>
         </condition>
      </fail>
      <copy file="${plugins}/${plugin_dist}/${pluginName}.jar"
            todir="${protege.home}/plugins/${plugin_dist}"/>
   </target>

   <target name = "install" depends = "dist, checkProtegeHome">
      <fail message = "set the protege.home variable to do an install">
         <condition>
            <not>
              <isset property="protege.home"/>
            </not>
         </condition>
      </fail>
      <unzip src="${build}/${pluginName}.zip" 
             dest = "${protege.home}/plugins"
             overwrite = "true"/>
      <copy todir="${protege.home}/examples">
          <fileset dir="./examples"/>
      </copy>
   </target>

   <target name = "clean">
     <delete dir = "${build}"/>
   </target>

</project>

CVS-SVN admin

Powered by ViewCVS 1.0-dev
(Powered by Apache)

ViewCVS and CVS Help