build.xml
author František Kučera <franta-hg@frantovo.cz>
Fri Oct 14 00:45:06 2011 +0200 (2011-10-14)
changeset 76 b5690fc25af6
parent 36 c404a87db5b7
permissions -rwxr-xr-x
Drupal: XSL šablona pro formátování XHTML části zprávy.
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project name="sonews" default="main" basedir=".">
     3 
     4     <property name="prj" value="."/>
     5     <property name="out" value="build"/>
     6     <property name="build.dir" value="${out}"/>
     7     <property name="inst.dir" value="/opt/sonews/sonews-1.1"/>
     8     <property name="build.class" value="${build.dir}/class"/>
     9 
    10     <!-- define how to handle CLASSPATH environment -->
    11     <property name="build.sysclasspath" value="ignore"/>
    12 
    13     <!-- set "modern" java compiler -->
    14     <property name="build.compiler" value="modern"/>
    15 
    16     <!-- set wether we want to compile with debug information -->
    17     <property name="debug" value="on"/>
    18 
    19     <!-- set wether we want to compile with optimisation -->
    20     <property name="optimize" value="off"/>
    21 
    22     <!-- set wether we want to compile with or without deprecation -->
    23     <property name="deprecation" value="on"/>
    24 
    25 
    26     <!-- classpath settings for compile and javadoc tasks -->
    27     <path id="classpath">
    28         <pathelement location="${build.class}"/>
    29         <pathelement location="lib/glassfish-mail.jar"/>
    30         <pathelement location="lib/mysql-connector-java.jar"/>
    31         <pathelement location="lib/junit-4.8.2.jar"/>
    32 
    33         <pathelement location="lib/javax.mail.jar"/>
    34         <pathelement location="lib/commons-codec-1.5.jar"/>
    35 
    36     </path>
    37 
    38 
    39 
    40     <!-- the main target, called in recursive builds -->
    41     <target name="main" depends="prepare,compile,jar"/>
    42 
    43     <!-- prepare output directories - -->
    44     <target name="prepare">
    45         <mkdir dir="${build.dir}"/>
    46         <mkdir dir="${build.class}"/>
    47     </target>
    48 
    49 
    50     <target name="compile" depends="prepare">
    51 	<javac destdir="${build.class}"
    52                debug="${debug}"
    53                deprecation="${deprecation}"
    54                optimize="${optimize}"
    55                classpathref="classpath">
    56             <src path="./src"/>
    57                 <include name="org/sonews/**/*.java"/>
    58 	</javac>
    59 	<javac destdir="${build.class}"
    60                debug="${debug}"
    61                deprecation="${deprecation}"
    62                optimize="${optimize}"
    63                classpathref="classpath">
    64             <src path="."/>
    65                 <include name="test/**/*java"/>
    66 	</javac>
    67     </target>
    68 	
    69     <!-- create jar file -->
    70     <target name="jar" depends="prepare,compile"> 
    71         <jar jarfile="${build.dir}/sonews.jar"
    72              basedir="${build.class}">
    73             <include name="org/sonews/**/*.class"/>
    74         </jar>
    75         <jar jarfile="${build.dir}/test.jar"
    76              basedir="${build.class}">
    77             <include name="test/**/*.class"/>
    78         </jar>
    79         <jar jarfile="${build.dir}/sonews-helpers.jar"
    80              basedir=".">
    81             <include name="helpers/**/*"/>
    82         </jar>
    83     </target>
    84 
    85     <target name="install" depends="jar">
    86         <mkdir dir="${inst.dir}/lib"/>
    87         <mkdir dir="${inst.dir}/bin"/>
    88         <mkdir dir="${inst.dir}/helpers"/>
    89         <copy todir="${inst.dir}/lib">
    90              <fileset dir="lib">
    91 		<include name="*.jar"/>	
    92              </fileset>
    93              <fileset dir="${build.dir}">
    94 		<include name="*.jar"/>	
    95              </fileset>
    96         </copy>
    97         <copy todir="${inst.dir}/bin">
    98              <fileset dir="bin">
    99 		<include name="*.sh"/>	
   100              </fileset>
   101         </copy>
   102         <chmod perm="755">
   103              <fileset dir="${inst.dir}/bin">
   104 		<include name="*.sh"/>	
   105              </fileset>
   106         </chmod>
   107         <copy todir="${inst.dir}/helpers">
   108              <fileset dir="helpers">
   109 		<include name="*"/>	
   110              </fileset>
   111         </copy>
   112     </target>
   113 
   114     <!-- clean up -->
   115     <target name="clean" depends="prepare">
   116         <delete includeEmptyDirs="true">
   117             <fileset dir="${build.class}">
   118                 <patternset>
   119                     <include name="**/*.class"/>
   120                     <include name="**/*.properties"/>
   121                 </patternset>
   122             </fileset>
   123             <fileset dir="${build.dir}">
   124                 <patternset>
   125                     <include name="**/*.jar"/>
   126                 </patternset>
   127             </fileset>
   128 	</delete>
   129     </target>
   130 </project>