-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
112 lines (95 loc) · 5.29 KB
/
build.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2003-2020 Broad Institute, Inc., Massachusetts Institute of Technology, and Regents of the University of California. All rights reserved.
-->
<project basedir="" default="devReleaseModule" name="GSEAPreranked">
<target name="init">
<tstamp>
<format property="publish.time" pattern="MM/dd/yyyy HH:mm " />
<format property="publish.time.short" pattern="MM/dd/yyyy " />
</tstamp>
<property environment="env" />
<property name="desktop.prod.version" value="4.1.0" />
<property name="test.version" value="999999999"/>
<property name="dest.dir" value="build" />
<mkdir dir="build" />
</target>
<target name="init_devrelease" depends="init" description="internal target used by other init_devrelease_* targets; do not use directly">
<!-- Set the full.version property so that it doesn't come in from release.properties -->
<property name="full.version" value="DEV_BUILD" />
<property name="version.date" value="${publish.time}" />
<property name="prereleasingModule" value="false" />
<property name="quality.level" value="development" />
</target>
<!-- Note: we formerly had support for building with a local bundle. We no longer have that
at this time with our switch to Docker, though we will want to bring back something similar
at some point (as support for local images).
-->
<target name="init_devrelease_prodDesktop" depends="init_devrelease"
description="Init properties for a Dev module build with the GSEA Desktop Production bundle">
</target>
<!-- Bump the build number and set the quality flag if we're doing a prerelease or release -->
<target name="init_prerelease" depends="init"
description="Init properties for a Prerelease module build with the GSEA Desktop Production bundle">
<property name="version.date" value="${publish.time}" />
<property name="prereleasingModule" value="true" />
<property name="quality.level" value="preproduction" />
</target>
<target name="init_release" depends="init"
description="Init properties for a Release module build with the GSEA Desktop Production bundle">
<property name="version.date" value="${publish.time.short}" />
<property name="prereleasingModule" value="false" />
<property name="quality.level" value="production" />
</target>
<target name="clean">
<delete dir="build" />
</target>
<target name="update-release-props" depends="init">
<!-- Increment the build number for use in the LSID & version-->
<propertyfile file="release.properties">
<entry key="build.number" type="int" operation="+" default="1" />
<entry key="build.timestamp" type="date" operation="=" value="${time.stamp}" pattern="EEE, d MMM yyyy HH:mm:ss Z" />
</propertyfile>
</target>
<target name="load-release-props">
<property file="release.properties" />
</target>
<target name="create-zip" depends="init,clean,addLSIDtoManifest">
<zip destfile="${dest.dir}/${ant.project.name}_v${full.version}.zip" whenempty="fail" defaultexcludes="true" duplicate="preserve">
<fileset dir="." includes="*.html, *.json, LICENSE*.txt, release.properties" />
<fileset dir="${dest.dir}" includes="manifest" />
</zip>
</target>
<target name="devReleaseModule" depends="init_devrelease_prodDesktop,load-release-props,create-zip" />
<target name="prereleaseModule" depends="init_prerelease,update-release-props,load-release-props,create-zip" />
<target name="releaseModule" depends="init_release,update-release-props,load-release-props,create-zip" />
<target name="addLSIDtoManifest" depends="init,getLSID">
<tstamp>
<format property="publish.time" pattern="MM/dd/yyyy HH:mm " />
</tstamp>
<!-- Work on a copy of the manifest to avoid unnecessary churn in version control. -->
<copy file="manifest" tofile="${dest.dir}/manifest" preservelastmodified="true" overwrite="true" />
<loadproperties srcfile="${dest.dir}/manifest" prefix="meta" prefixValues="false">
<filterchain>
<linecontains><contains value="version=" /></linecontains>
</filterchain>
</loadproperties>
<!-- NOTE: this will overwrite any LSID already in the manifest file -->
<propertyfile file="${dest.dir}/manifest">
<entry key="quality" value="${quality.level}" />
<entry key="LSID" value="${LSID}" />
<entry key="publicationDate" value="${publish.time}" />
<entry key="version" value="${version.date}: ${meta.version}" />
</propertyfile>
</target>
<target name="getLSID">
<property name="LSID.key" value="${ant.project.name}.lsid" />
<condition property="full.version" value="${release.version}.${build.number}" else="DEV_BUILD">
<isset property="release.version" />
</condition>
<condition property="LSID" value="${LSID.noVersion}:${full.version}" else="${LSID.noVersion}:${test.version}">
<not><contains string="${full.version}" substring="DEV_BUILD" /></not>
</condition>
<echo>${LSID.key} = ${LSID}</echo>
</target>
</project>