File: igv_build.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 (180 lines) | stat: -rw-r--r-- 6,927 bytes parent folder | download
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!--
  ~ 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="IGV" default="build" basedir="../.">

    <property name="jar.name" value="igv.jar"/>
    <property name="dist.dir" value="${basedir}/${ant.project.name}-dist/"/>
    <property name="jar.path" value="${dist.dir}${jar.name}"/>
    <property name="dist.lib.dir" value="${dist.dir}lib/"/>
    <property name="download.dir" value="${basedir}"/>

    <property name="include.libs" value="true"/>

    <import file="../build.xml"/>

    <property name="alias" value="Broad-alias"/>
    <property name="key-password" value="Broad-keypass"/>
    <property name="store-password" value="Broad-storepass"/>

    <!-- The deployment folder for the JWS distribution. It is expected that this property will be overridden -->
    <property name="deploy.dir" value="${basedir}/deploy/"/>

    <!-- Src/binary archive file settings -->
    <property name="src.archive.name" value="IGVDistribution_${version}"/>
    <property name="src.archive.zip" value="${download.dir}/${src.archive.name}.zip"/>

    <property name="bin.archive.name" value="IGV_${version}"/>
    <property name="bin.archive.zip" value="${download.dir}/${bin.archive.name}.zip"/>


    <!--Add permissions attribute to manifest of jars -->
    <!-- We use exec because it's easier, this will only run on *nix-->
    <macrodef name="add-perms-macro">
        <attribute name="jarfile"/>
        <sequential>
            <!--Newline is important!-->
            <echo file="tmp.txt">Permissions: all-permissions${line.separator}</echo>
            <exec executable="jar">
                <arg value="ufm"/>
                <arg value="@{jarfile}"/>
                <arg value="tmp.txt"/>
            </exec>
            <delete file="tmp.txt"/>
        </sequential>
    </macrodef>

    <target name="add-perms">
        <add-perms-macro jarfile="${dist.dir}${batik-codec-finame}"/>
        <add-perms-macro jarfile="${dist.dir}${goby-io-finame}"/>
    </target>

    <!-- Sign all jars if a keystore is defined -->
    <target name="sign-jars" if="keystore">
        <signjar jar="${jar.path}" alias="${alias}" keypass="${key-password}" storepass="${store-password}"
                 keystore="${keystore}"/>
        <signjar jar="${dist.dir}${batik-codec-finame}" alias="${alias}" keypass="${key-password}"
                 storepass="${store-password}" keystore="${keystore}"/>
        <signjar jar="${dist.dir}${goby-io-finame}" alias="${alias}" keypass="${key-password}"
                 storepass="${store-password}" keystore="${keystore}"/>
    </target>

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

    <!-- Deploy the application -->
    <target name="deploy">
        <copy todir="${deploy.dir}" overwrite="true">
            <fileset dir="${dist.dir}">
                <include name="lib/**"/>
            </fileset>
            <fileset file="${dist.dir}${jar.name}"/>
            <fileset file="${dist.dir}${batik-codec-finame}"/>
            <fileset file="${dist.dir}${goby-io-finame}"/>
            <fileset refid="scripts"/>
            <fileset file="docs/readme.txt"/>
        </copy>
    </target>

    <!--Macro for creating zipped archive, used by bin and src/bin-->
    <macrodef name="archive">
        <attribute name="bin.dirname"/>
        <attribute name="zip.dest"/>
        <attribute name="update" default="no"/>


        <sequential>

            <!-- Copy files to directory -->
            <copy todir="${tmp.dir}/@{bin.dirname}" file="${dist.dir}igv.jar"/>
            <copy todir="${tmp.dir}/@{bin.dirname}" file="${dist.dir}${batik-codec-finame}"/>
            <copy todir="${tmp.dir}/@{bin.dirname}" file="${dist.dir}${goby-io-finame}"/>

            <zip destfile="@{zip.dest}" update="@{update}" duplicate="fail">
                <zipfileset dir="${tmp.dir}" filemode="755">
                    <include name="**/igv.sh"/>
                    <include name="**/igv.command"/>
                    <include name="**/igv.bat"/>
                </zipfileset>
                <zipfileset dir="${tmp.dir}">
                    <exclude name="**/igv.sh"/>
                    <exclude name="**/igv.command"/>
                    <exclude name="**/igv.bat"/>
                </zipfileset>
            </zip>
        </sequential>
    </macrodef>

    <!--Create binary archive -->
    <target name="publishBin" depends="build">
        <delete file="${bin.archive.zip}"/>
        <delete dir="${tmp.dir}"/>

        <mkdir dir="${tmp.dir}/${bin.archive.name}"/>
        <copy todir="${tmp.dir}/${bin.archive.name}">
            <fileset dir="${docs.dir}/">
                <include name="readme.txt"/>
            </fileset>
            <fileset refid="scripts"/>
        </copy>

        <archive bin.dirname="${bin.archive.name}" zip.dest="${bin.archive.zip}"/>
    </target>


    <!--Create a src/binary archive -->
    <target name="publish" depends="build">

        <!-- Clean -->
        <delete dir="${tmp.dir}"/>
        <delete file="${src.archive.zip}"/>

        <!-- Copy scripts and docs -->
        <copy todir="${tmp.dir}/${src.archive.name}">
            <fileset file="build.xml"/>
            <fileset file="build_macros.xml"/>
            <fileset dir="${basedir}">
                <include name="docs/*"/>
                <!--include name="test/src/**/*"/>
                <include name="test/data/**/*"/>
                <include name="test/lib/**/*"/-->
                <exclude name="**/*hic*"/>
            </fileset>
            <fileset refid="scripts"/>
        </copy>

        <!-- Src and lib directory -->
        <copy todir="${tmp.dir}/${src.archive.name}/src">
            <fileset dir="${src.dir}"/>
        </copy>

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

        <copy todir="${tmp.dir}/${src.archive.name}/lib">
            <fileset dir="${lib.dir}"/>
        </copy>


        <archive bin.dirname="${src.archive.name}" zip.dest="${src.archive.zip}"/>
    </target>


    <target name="build-jws" depends="build, add-perms">
        <antcall target="sign-jars"/>
    </target>

    <target name="all" depends="clean, init, build-jws, deploy, publish, publishBin"/>
    <target name="publishBoth" depends="publish, publishBin"/>

</project>