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