| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
|
| 3 |
<project name="portlets" default="all" basedir=".."> |
| 4 |
|
| 5 |
<property file="${basedir}/override.properties" /> |
| 6 |
<property file="${basedir}/build.properties" /> |
| 7 |
|
| 8 |
<taskdef resource="net/sf/antcontrib/antlib.xml"> |
| 9 |
<classpath> |
| 10 |
<pathelement location="${basedir}/lib/ant-contrib-1.0b2.jar" /> |
| 11 |
</classpath> |
| 12 |
</taskdef> |
| 13 |
|
| 14 |
<property name="shell.cmd" value="sh"/> |
| 15 |
<property name="shell.options" value="-c"/> |
| 16 |
|
| 17 |
<target name="check.os" |
| 18 |
description="--> Check OS"> |
| 19 |
<condition property="isWindows"> |
| 20 |
<os family="windows" /> |
| 21 |
</condition> |
| 22 |
</target> |
| 23 |
|
| 24 |
<target name="setup.shell" if="isWindows" |
| 25 |
description="--> Setup shell parameters"> |
| 26 |
<property name="shell.cmd" value="cmd.exe"/> |
| 27 |
<property name="shell.options" value="/c"/> |
| 28 |
</target> |
| 29 |
|
| 30 |
<!-- =================================================================== --> |
| 31 |
<!-- REMOVE PORTLETS --> |
| 32 |
<!-- =================================================================== --> |
| 33 |
|
| 34 |
<target name="remove" |
| 35 |
description="--> Remove Portlets"> |
| 36 |
<for list="${portlets.list}" param="portlet"> |
| 37 |
<sequential> |
| 38 |
<echo>Portlet ID: @{portlet}</echo> |
| 39 |
<ant |
| 40 |
antfile="${portlets.home}/build-portlet.xml" |
| 41 |
target="remove" |
| 42 |
> |
| 43 |
<property |
| 44 |
name="portlet.resource.file" |
| 45 |
value="${portlets.resource.dir}/@{portlet}.properties" /> |
| 46 |
</ant> |
| 47 |
</sequential> |
| 48 |
</for> |
| 49 |
</target> |
| 50 |
|
| 51 |
<!-- =================================================================== --> |
| 52 |
<!-- CLEAN PORTLETS --> |
| 53 |
<!-- =================================================================== --> |
| 54 |
|
| 55 |
<target name="clean" |
| 56 |
description="--> Clean Portlets"> |
| 57 |
<for list="${portlets.list}" param="portlet"> |
| 58 |
<sequential> |
| 59 |
<echo>Portlet ID: @{portlet}</echo> |
| 60 |
<ant |
| 61 |
antfile="${portlets.home}/build-portlet.xml" |
| 62 |
target="clean" |
| 63 |
> |
| 64 |
<property |
| 65 |
name="portlet.resource.file" |
| 66 |
value="${portlets.resource.dir}/@{portlet}.properties" /> |
| 67 |
</ant> |
| 68 |
</sequential> |
| 69 |
</for> |
| 70 |
|
| 71 |
</target> |
| 72 |
|
| 73 |
<!-- =================================================================== --> |
| 74 |
<!-- CHECKOUT PORTLETS --> |
| 75 |
<!-- =================================================================== --> |
| 76 |
|
| 77 |
<target name="checkout" |
| 78 |
description="--> Checkout Portlets"> |
| 79 |
<for list="${portlets.list}" param="portlet"> |
| 80 |
<sequential> |
| 81 |
<echo>Portlet ID: @{portlet}</echo> |
| 82 |
<ant |
| 83 |
antfile="${portlets.home}/build-portlet.xml" |
| 84 |
target="checkout" |
| 85 |
> |
| 86 |
<property |
| 87 |
name="portlet.resource.file" |
| 88 |
value="${portlets.resource.dir}/@{portlet}.properties" /> |
| 89 |
</ant> |
| 90 |
</sequential> |
| 91 |
</for> |
| 92 |
|
| 93 |
</target> |
| 94 |
|
| 95 |
<!-- =================================================================== --> |
| 96 |
<!-- UPDATE PORTLETS --> |
| 97 |
<!-- =================================================================== --> |
| 98 |
|
| 99 |
<target name="update" |
| 100 |
description="--> Update Portlets"> |
| 101 |
<antcall target="update.portlets"/> |
| 102 |
<antcall target="update.portlets.for.custom"/> |
| 103 |
|
| 104 |
<antcall target="cms.contents"/> |
| 105 |
</target> |
| 106 |
|
| 107 |
<target name="update.portlets" > |
| 108 |
<for list="${portlets.list}" param="portlet"> |
| 109 |
<sequential> |
| 110 |
<echo>Portlet ID: @{portlet}</echo> |
| 111 |
<ant |
| 112 |
antfile="${portlets.home}/build-portlet.xml" |
| 113 |
target="update" |
| 114 |
> |
| 115 |
<property |
| 116 |
name="portlet.resource.file" |
| 117 |
value="${portlets.resource.dir}/@{portlet}.properties" /> |
| 118 |
</ant> |
| 119 |
</sequential> |
| 120 |
</for> |
| 121 |
</target> |
| 122 |
|
| 123 |
<target name="update.portlets.for.custom" unless="build.dist"> |
| 124 |
<!-- Additional Patches --> |
| 125 |
<!-- remove files from portlet --> |
| 126 |
<for list="${additional.portlet.delete.files}" param="delete.file"> |
| 127 |
<sequential> |
| 128 |
<delete file="${portlets.build.dir}/@{delete.file}"/> |
| 129 |
</sequential> |
| 130 |
</for> |
| 131 |
<!-- remove directories from portlet --> |
| 132 |
<for list="${additional.portlet.delete.directories}" param="delete.directory"> |
| 133 |
<sequential> |
| 134 |
<delete dir="${portlets.build.dir}/@{delete.directory}"/> |
| 135 |
</sequential> |
| 136 |
</for> |
| 137 |
|
| 138 |
<!-- copy files to portlet --> |
| 139 |
<mkdir dir="${additional.portlet.files.dir}"/> |
| 140 |
<copy todir="${portlets.build.dir}"> |
| 141 |
<fileset dir="${additional.portlet.files.dir}"> |
| 142 |
<include name="**"/> |
| 143 |
</fileset> |
| 144 |
</copy> |
| 145 |
|
| 146 |
<!-- Additional Patches --> |
| 147 |
<for list="${additional.portlet.patch.files}" param="patch.file"> |
| 148 |
<sequential> |
| 149 |
<patch patchfile="${additional.portlet.patches.dir}/@{patch.file}" |
| 150 |
dir="${portlets.build.dir}" |
| 151 |
originalfile="${portlets.build.dir}/@{patch.file}" |
| 152 |
ignorewhitespace="yes" |
| 153 |
strip="0"/> |
| 154 |
</sequential> |
| 155 |
</for> |
| 156 |
|
| 157 |
</target> |
| 158 |
|
| 159 |
<target name="cms.contents" > |
| 160 |
<mkdir dir="${portlets.build.dir}/cms-portlets/src/main/webapp/WEB-INF"/> |
| 161 |
<unzip |
| 162 |
src="${portlets.build.dir}/cms-portlets/src/main/webapp/WEB-INF/repository.zip" |
| 163 |
dest="${portlets.build.dir}/cms-portlets/src/main/webapp/WEB-INF" |
| 164 |
/> |
| 165 |
<delete file="${portlets.build.dir}/cms-portlets/src/main/webapp/WEB-INF/repository.zip"/> |
| 166 |
</target> |
| 167 |
|
| 168 |
<!-- =================================================================== --> |
| 169 |
<!-- BUILD PORTLETS --> |
| 170 |
<!-- =================================================================== --> |
| 171 |
|
| 172 |
<target name="build" |
| 173 |
description="--> Build Portlets"> |
| 174 |
<for list="${portlets.list}" param="portlet"> |
| 175 |
<sequential> |
| 176 |
<echo>Portlet ID: @{portlet}</echo> |
| 177 |
<ant |
| 178 |
antfile="${portlets.home}/build-portlet.xml" |
| 179 |
target="build" |
| 180 |
> |
| 181 |
<property |
| 182 |
name="portlet.resource.file" |
| 183 |
value="${portlets.resource.dir}/@{portlet}.properties" /> |
| 184 |
</ant> |
| 185 |
</sequential> |
| 186 |
</for> |
| 187 |
|
| 188 |
</target> |
| 189 |
|
| 190 |
<!-- =================================================================== --> |
| 191 |
<!-- DEPLOY PORTLETS --> |
| 192 |
<!-- =================================================================== --> |
| 193 |
|
| 194 |
<target name="deploy" |
| 195 |
description="--> Deploy Portlets"> |
| 196 |
<for list="${portlets.list}" param="portlet"> |
| 197 |
<sequential> |
| 198 |
<echo>Portlet ID: @{portlet}</echo> |
| 199 |
<ant |
| 200 |
antfile="${portlets.home}/build-portlet.xml" |
| 201 |
target="deploy" |
| 202 |
> |
| 203 |
<property |
| 204 |
name="portlet.resource.file" |
| 205 |
value="${portlets.resource.dir}/@{portlet}.properties" /> |
| 206 |
<property |
| 207 |
name="portlets.war.dir" |
| 208 |
value="${portlets.deploy.war.dir}" /> |
| 209 |
</ant> |
| 210 |
</sequential> |
| 211 |
</for> |
| 212 |
</target> |
| 213 |
|
| 214 |
<!-- =================================================================== --> |
| 215 |
<!-- DEPLOY PORTLETS FOR DISTRIBUTION --> |
| 216 |
<!-- =================================================================== --> |
| 217 |
|
| 218 |
<target name="deploy.for.dist" |
| 219 |
description="--> Deploy Portlets For Distribution"> |
| 220 |
<for list="${portlets.list}" param="portlet"> |
| 221 |
<sequential> |
| 222 |
<echo>Portlet ID: @{portlet}</echo> |
| 223 |
<ant |
| 224 |
antfile="${portlets.home}/build-portlet.xml" |
| 225 |
target="deploy" |
| 226 |
> |
| 227 |
<property |
| 228 |
name="portlet.resource.file" |
| 229 |
value="${portlets.resource.dir}/@{portlet}.properties" /> |
| 230 |
<property |
| 231 |
name="portlets.war.dir" |
| 232 |
value="${installer.portlets.dir}" /> |
| 233 |
</ant> |
| 234 |
</sequential> |
| 235 |
</for> |
| 236 |
</target> |
| 237 |
|
| 238 |
</project> |
| 239 |
|