File: build-tools.xml

package info (click to toggle)
igv 2.3.38%2Bdfsg-1
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd
  • size: 194,072 kB
  • ctags: 20,659
  • sloc: java: 131,543; xml: 18,718; php: 152; sh: 17; makefile: 11
file content (121 lines) | stat: -rw-r--r-- 4,780 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?xml version="1.0"?>
<!--
  ~ Copyright (c) 2007-2012 The Broad Institute, Inc.
  ~ SOFTWARE COPYRIGHT NOTICE
  ~ This software and its documentation are the copyright of the Broad Institute, Inc. All rights are reserved.
  ~
  ~ This software is supplied without any warranty or guaranteed support whatsoever. The Broad Institute is not responsible for its use, misuse, or functionality.
  ~
  ~ This software is licensed under the terms of the GNU Lesser General Public License (LGPL),
  ~ Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php.
  -->

<project name="igvtools" basedir="../." default="deploy">
    <property name="scripts.dir" value="${basedir}/scripts"/>
    <property name="docs.dir" value="${basedir}/docs"/>
    <property name="tmp.dir" value="tmp"/>
    <property name="main-class" value="org.broad.igv.tools.IgvTools"/>
    <property name="title" value="IGVTools"/>
    <property name="jarname" value="igvtools"/>
    <property name="deploy.dir" value="igvtools-dist"/>
    <property name="genome.dir" value="resources/chromSizes/"/>
    <property name="version" value="v0.0"/>
    <property name="build-number" value="0.0"/>

    <import file="${basedir}/build_macros.xml"/>


    <target name="extract-classes">
        <unzip dest="${tmp.dir}">
            <patternset>
                <include name="**/*.class"/>
            </patternset>
            <fileset dir="lib">
                <include name="**/*.jar"/>
            </fileset>
        </unzip>
    </target>

    <target name="init">
        <path id="library.classpath">
            <fileset id="jar.lib" dir="lib"/>
        </path>
    </target>

    <target name="compile" depends="init">
        <delete dir="${tmp.dir}"/>
        <mkdir dir="${tmp.dir}"/>

        <!-- Copy resource files to the tmp directory (.txt files, etc) -->
        <copy todir="${tmp.dir}" overwrite="true">
            <fileset dir="src">
                <exclude name="**/*.form"/>
                <exclude name="**/*.java"/>
                <exclude name="**/*.svn"/>
                <exclude name="**/manifest.mf"/>
            </fileset>
        </copy>

        <javac debug="true" defaultexcludes="false" deprecation="true"
               destdir="${tmp.dir}" optimize="false" proceed="false"
               srcdir="src">
            <classpath refid="library.classpath"/>
        </javac>
    </target>

    <target name="package-jar" depends="compile">
        <antcall target="extract-classes"/>
        <delete dir="${ant.project.name}-dist"/>
        <mkdir dir="${ant.project.name}-dist"/>

        <write_version targetFile="${tmp.dir}/resources/about.properties"/>

        <jar destfile="${ant.project.name}-dist/${jarname}.jar">
            <classfileset dir="${tmp.dir}">
                <root classname="${main-class}"/>
                <root classname="org.apache.log4j.ConsoleAppender"/>
                <rootfileset dir="${tmp.dir}" includes="org/apache/commons/logging/**/*.class"/>
                <rootfileset dir="${tmp.dir}" includes="ncsa/hdf/hdf5lib/exceptions/*.class"/>
                <rootfileset dir="${tmp.dir}" includes="org/broad/igv/itdf/*.class"/>
            </classfileset>
            <fileset dir="${tmp.dir}" includes="resources/**, log4j.properties"/>
            <fileset dir="." includes="docs/**"/>
            <manifest>
                <attribute name="Implementation-Title" value="${title}"/>
                <attribute name="Main-Class" value="${main-class}"/>
            </manifest>
        </jar>
    </target>

    <fileset id="scripts" dir="${scripts.dir}">
        <include name="igvtools"/>
        <include name="igvtools_gui"/>
        <include name="igvtools_gui.command"/>
        <include name="igvtools.bat"/>
        <include name="igvtools_gui.bat"/>
    </fileset>

    <target name="create-zip" depends="cleanup, compile, package-jar">
        <zip destfile="${deploy.dir}/igvtools_${version}.zip" whenempty="fail" defaultexcludes="true">
            <zipfileset dir="${ant.project.name}-dist" includes="${jarname}.jar" prefix="${title}"/>
            <zipfileset refid="scripts" prefix="${title}" filemode="755"/>
            <zipfileset dir="${docs.dir}" includes="igvtools_readme.txt" prefix="${title}"/>
            <zipfileset dir="${genome.dir}"  prefix="${title}/genomes"/>
        </zip>
    </target>


    <target name="deploy" depends="create-zip">
        <copy todir="${deploy.dir}" overwrite="true">
            <fileset dir="${ant.project.name}-dist" includes="*.zip"/>
        </copy>
    </target>

    <target name="cleanup">
        <delete quiet="true">
            <fileset dir="${tmp.dir}"/>
            <fileset dir="${ant.project.name}-dist"/>
        </delete>
    </target>

</project>