-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
97 lines (81 loc) · 4.47 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012-2020 Broad Institute, Inc., Massachusetts Institute of Technology, and Regents of the University of California. All rights reserved.
-->
<project basedir="" default="devReleaseModule" name="ssGSEA">
<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 name="test.version" value="999999999"/>
<property name="dest.dir" value="build" />
<mkdir dir="build" />
</target>
<target name="init_devrelease" depends="init">
<!-- 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>
<!-- Bump the build number and set the quality flag if we're doing a prerelease or release -->
<target name="init_prerelease" depends="init">
<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">
<property name="version.date" value="${publish.time.short}" />
<property name="prereleasingModule" value="false" />
<property name="quality.level" value="production" />
</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="addLSIDtoManifest">
<zip destfile="${dest.dir}/${ant.project.name}_v${full.version}.zip" whenempty="fail" defaultexcludes="true">
<fileset dir="." includes="*.html, *.json, LICENSE*.txt, release.properties" />
<fileset dir="${dest.dir}" includes="manifest" />
<fileset dir="src" includes="*.R"/>
</zip>
</target>
<target name="devReleaseModule" depends="init_devrelease,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">
<!-- 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>
<!-- Adjust the quality level, set the LSID to the (computed) version, and assign the publicationDate.
Also, prepend the date to the version so it will be available in Manage Modules.
NOTE: this will overwrite these values 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><equals arg1="${full.version}" arg2="DEV_BUILD" /></not>
</condition>
<echo>${LSID.key} = ${LSID}</echo>
</target>
</project>