-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-adapter.xml
165 lines (145 loc) · 7.94 KB
/
build-adapter.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
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
<?xml version="1.0" encoding="utf-8" ?>
<project name="caBIG Study Calendar" default="build:war" basedir=".">
<description>Builds, tests, and runs the project psc.</description>
<property name="download" value="${basedir}/temp/download"/>
<property name="jruby.version" value="1.5.6"/>
<property name="jruby.dist.filename" value="jruby-bin-${jruby.version}.zip"/>
<property name="jruby.dist.url" value="http://jruby.org.s3.amazonaws.com/downloads/${jruby.version}/${jruby.dist.filename}"/>
<property name="jruby.dist.local" value="${download}/${jruby.dist.filename}"/>
<property name="jruby.local.base" value="${download}/jruby-${jruby.version}"/>
<property name="jruby.local.script" value="${jruby.local.base}/bin/jruby"/>
<property name="jruby.local.bat" value="${jruby.local.base}/bin/jruby.bat"/>
<property name="jruby.local.gemdir" value="${jruby.local.base}/lib/ruby/gems/1.8/gems"/>
<property name="unixfamily" value="Linux,Mac OS X,Mac OS,HP UX,Digital Unix"/>
<property name="windowsfamily" value="Windows 2000,Windows 98,Windows NT,Windows Vista,Windows XP" />
<property environment="env"/>
<property name="tomcat.base" value="${env.CATALINA_BASE}"/>
<property name="tomcat.base" value="${env.CATALINA_HOME}"/> <!-- set base to home if base not set -->
<property name="tomcat.home" value="${env.CATALINA_HOME}"/>
<available file="${jruby.local.script}" property="jruby.exists" />
<!--Standard sub project build TARGETS -->
<target name="install"
depends="install:gem:buildr,install:gem:buildr-iidea,install:gem:haml,install:gem:facets,install:gem:json_pure,install:gem:rest-client"
description="Downloads JRuby and installs required gems">
</target>
<target name="install:jruby" unless="jruby.exists" description="Downloads jruby">
<mkdir dir="${basedir}/temp/download"/>
<retry retrycount="5">
<sequential>
<get src="${jruby.dist.url}" dest="${jruby.dist.local}"/>
<unzip dest="${download}" src="${jruby.dist.local}" />
</sequential>
</retry>
<echo message="Downloaded & extracted JRuby sucessfully"/>
<exec executable="chmod" os="${unixfamily}" failonerror="true">
<arg value="u+x"/>
<arg value="${jruby.local.script}"/>
</exec>
<delete dir="${jruby.dest.file}"/>
<jruby line="--version"/>
</target>
<macrodef name="jruby" description="Executes a command using the jruby script">
<attribute name="line" description="the command line to pass to jruby (not including jruby itself)"/>
<element name="envs" implicit="yes" optional="true"/>
<sequential>
<echo>jruby @{line}</echo>
<exec executable="${jruby.local.script}" os="${unixfamily}" failonerror="true">
<!-- Xms override works around a jruby bug. See PSC issue #881 for details. -->
<arg line="-J-Xms256M @{line}"/>
<envs/>
</exec>
<exec executable="cmd" dir="." os="${windowsfamily}" failonerror="true">
<arg line="/c ${jruby.local.bat} @{line}"/>
<envs/>
</exec>
</sequential>
</macrodef>
<!-- The two gem macros have to be separate because ant doesn't let you macrodef targets -->
<macrodef name="gem_available">
<attribute name="name"/>
<attribute name="path" default="@{name}-${gems.@{name}.version}"
description="the path within the jruby gems directory where the gem will be if it is already installed"/>
<sequential>
<echo level="verbose">gem_available name=@{name} path=@{path}</echo>
<available file="${jruby.local.gemdir}/@{path}" property="@{name}.exists"/>
</sequential>
</macrodef>
<macrodef name="install_gem">
<attribute name="name"/>
<sequential>
<echo level="verbose">install_gem name=@{name} version=${gems.@{name}.version}</echo>
<retry retrycount="5">
<jruby line="-S gem install @{name} -v ${gems.@{name}.version} --no-rdoc --no-ri"/>
</retry>
</sequential>
</macrodef>
<property name="gems.rspec.version" value="1.3.1"/>
<gem_available name="rspec"/>
<target name="install:gem:rspec" unless="rspec.exists" depends="install:jruby" description="Installs rspec gem before buildr to work around JRUBY-5581">
<install_gem name="rspec"/>
</target>
<property name="gems.buildr.version" value="1.4.4"/>
<gem_available name="buildr" path="buildr-1.4.4-java"/>
<target name="install:gem:buildr" unless="buildr.exists" depends="install:jruby,install:gem:rspec" description="Installs buildr gem">
<install_gem name="buildr"/>
</target>
<property name="gems.buildr-iidea.version" value="0.0.8"/>
<gem_available name="buildr-iidea"/>
<target name="install:gem:buildr-iidea" unless="buildr-iidea.exists" depends="install:jruby" description="Installs buildr-iidea gem">
<install_gem name="buildr-iidea"/>
</target>
<property name="gems.haml.version" value="3.0.25"/>
<gem_available name="haml"/>
<target name="install:gem:haml" unless="haml.exists" depends="install:jruby" description="Installs haml gem">
<install_gem name="haml"/>
</target>
<property name="gems.facets.version" value="2.4.5"/>
<gem_available name="facets"/>
<target name="install:gem:facets" unless="facets.exists" depends="install:jruby" description="Installs facets gem">
<install_gem name="facets"/>
</target>
<property name="gems.json_pure.version" value="1.4.3"/>
<gem_available name="json_pure"/>
<target name="install:gem:json_pure" unless="json_pure.exists" depends="install:jruby" description="Installs json_pure gem">
<install_gem name="json_pure"/>
</target>
<property name="gems.rest-client.version" value="1.0.3"/>
<gem_available name="rest-client"/>
<target name="install:gem:rest-client" unless="rest-client.exists" depends="install:jruby" description="Installs rest-client gem">
<install_gem name="rest-client"/>
</target>
<target name="build:war" depends="install" description="Builds PSC webapp war">
<jruby line="-S buildr clean build test=no"/>
</target>
<target name="deploy:psc:webapp" description="Deploys pre-built war file">
<delete dir="${tomcat.base}/webapps/psc.war" />
<copy todir="${tomcat.base}/webapps" file="${basedir}/web/target/psc.war"/>
</target>
<target name="build:deploy:psc:webapp" depends="build:war" description="Builds and deploy war file ">
<delete dir="${tomcat.base}/webapps/psc.war" />
<copy todir="${tomcat.base}/webapps" file="${basedir}/web/target/psc.war"/>
</target>
<target name="build:grid" depends="install" description="Builds PSC grid services">
<jruby line="-S buildr psc:grid:package WSRF_DIR_NAME=wsrf-psc TEST=no TOMCAT_HOSTNAME=${tomcat.hostname}">
<env key="CCTS_HOME" value="${ccts.common.grid.src.dir}"/>
<env key="GLOBUS_LOCATION" value="${env.GLOBUS_LOCATION}"/>
</jruby>
</target>
<target name="deploy:psc:grid" depends="install" description="Deploys PSC grid services">
<jruby line="-S buildr psc:grid:deploy_with_globus TEST=no WSRF_DIR_NAME=wsrf-psc TOMCAT_HOSTNAME=${tomcat.hostname}">
<env key="CATALINA_BASE" value="${tomcat.base}"/>
<env key="CATALINA_HOME" value="${tomcat.home}"/>
<env key="CCTS_HOME" value="${ccts.common.grid.src.dir}"/>
<env key="GLOBUS_LOCATION" value="${env.GLOBUS_LOCATION}"/>
</jruby>
</target>
<target name="clean" depends="install">
<jruby line="-S buildr clean"/>
</target>
<target name="local_repo:clear_unreliable" depends="install">
<jruby line="-S buildr local_repo:clear_unreliable"/>
</target>
<target name="clean-download">
<delete dir="${download}" />
</target>
</project>