[120] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
| 2 | <project default="fetchplugin"> |
---|
| 3 | <target name="fetchplugin" depends="fetch-local-unversioned-plugin, fetch-remote-unversioned-plugin-version-forrest,fetch-remote-unversioned-plugin-unversion-forrest, final-check"/> |
---|
| 4 | <target name="fetch-local-versioned-plugin"> |
---|
| 5 | <antcallback return="plugin-found" target="get-local"> |
---|
| 6 | <param name="local-plugin-version" value="-"/> |
---|
| 7 | <param name="local-plugin-name" value="org.apache.forrest.plugin.output.pdf"/> |
---|
| 8 | </antcallback> |
---|
| 9 | </target> |
---|
| 10 | <target unless="plugin-found" name="fetch-remote-versioned-plugin-version-forrest"> |
---|
| 11 | <antcallback return="plugin-found,desired.plugin.zip.present" target="download"> |
---|
| 12 | <param name="download-plugin-version" value="-"/> |
---|
| 13 | <param name="download-plugin-name" value="org.apache.forrest.plugin.output.pdf"/> |
---|
| 14 | <param name="download-forrest-version" value="0.8/"/> |
---|
| 15 | </antcallback> |
---|
| 16 | </target> |
---|
| 17 | <target unless="plugin-found" name="fetch-local-unversioned-plugin"> |
---|
| 18 | <antcallback return="plugin-found" target="get-local"> |
---|
| 19 | <param value="" name="local-plugin-version"/> |
---|
| 20 | <param name="local-plugin-name" value="org.apache.forrest.plugin.output.pdf"/> |
---|
| 21 | </antcallback> |
---|
| 22 | </target> |
---|
| 23 | <target unless="plugin-found" name="fetch-remote-unversioned-plugin-version-forrest"> |
---|
| 24 | <antcallback return="plugin-found,desired.plugin.zip.present" target="download"> |
---|
| 25 | <param value="" name="download-plugin-version"/> |
---|
| 26 | <param name="download-plugin-name" value="org.apache.forrest.plugin.output.pdf"/> |
---|
| 27 | <param name="download-forrest-version" value="0.8/"/> |
---|
| 28 | </antcallback> |
---|
| 29 | </target> |
---|
| 30 | <target unless="plugin-found" name="fetch-remote-unversioned-plugin-unversion-forrest"> |
---|
| 31 | <antcallback return="plugin-found,desired.plugin.zip.present" target="download"> |
---|
| 32 | <param value="" name="download-plugin-version"/> |
---|
| 33 | <param name="download-plugin-name" value="org.apache.forrest.plugin.output.pdf"/> |
---|
| 34 | <param value="" name="download-forrest-version"/> |
---|
| 35 | </antcallback> |
---|
| 36 | </target> |
---|
| 37 | <target name="get-local"> |
---|
| 38 | <echo>Trying to locally get ${local-plugin-name}${local-plugin-version}</echo> |
---|
| 39 | <trycatch property="plugin-found"> |
---|
| 40 | <try> |
---|
| 41 | <for param="plugin-src-dir" list="/export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/plugins,/export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/whiteboard/plugins"> |
---|
| 42 | <sequential> |
---|
| 43 | <echo>Looking in local @{plugin-src-dir}</echo> |
---|
| 44 | <if> |
---|
| 45 | <available type="dir" property="plugin.src.present" file="@{plugin-src-dir}/${local-plugin-name}${local-plugin-version}"/> |
---|
| 46 | <then> |
---|
| 47 | <echo message="Found !"/> |
---|
| 48 | <ant target="local-deploy" antfile="@{plugin-src-dir}/${local-plugin-name}${local-plugin-version}/build.xml" dir="@{plugin-src-dir}/${local-plugin-name}${local-plugin-version}"> |
---|
| 49 | <property value="true" name="no.echo.init"/> |
---|
| 50 | </ant> |
---|
| 51 | <fail/> |
---|
| 52 | </then> |
---|
| 53 | </if> |
---|
| 54 | </sequential> |
---|
| 55 | </for> |
---|
| 56 | </try> |
---|
| 57 | <catch> |
---|
| 58 | <echo>Plugin ${local-plugin-name}${local-plugin-version} deployed ! Ready to configure</echo> |
---|
| 59 | </catch> |
---|
| 60 | </trycatch> |
---|
| 61 | </target> |
---|
| 62 | <target depends="keep-original-zip,get-from-remote-site,is-downloaded,remove-original-zip" name="download"/> |
---|
| 63 | <target if="original.zip.exists" depends="available-original-zip" name="keep-original-zip"> |
---|
| 64 | <copy preservelastmodified="true" file="/export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/build/plugins/${download-plugin-name}.zip" tofile="/export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/build/plugins/${download-plugin-name}.zip.orig"/> |
---|
| 65 | </target> |
---|
| 66 | <target name="available-original-zip"> |
---|
| 67 | <available property="original.zip.exists" file="/export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/build/plugins/${download-plugin-name}.zip"/> |
---|
| 68 | </target> |
---|
| 69 | <target name="get-from-remote-site"> |
---|
| 70 | <echo>Tying to download ${download-plugin-name}${download-plugin-version} from the distribution site ...</echo> |
---|
| 71 | <if> |
---|
| 72 | <not> |
---|
| 73 | <equals arg2="" arg1="${download.forrest.version}"/> |
---|
| 74 | </not> |
---|
| 75 | <then> |
---|
| 76 | <echo>Using Forrest version : ${download-forrest-version}</echo> |
---|
| 77 | </then> |
---|
| 78 | </if> |
---|
| 79 | <get ignoreerrors="true" usetimestamp="true" verbose="true" src="http://forrest.apache.org/plugins//${download-forrest-version}${download-plugin-name}${download-plugin-version}.zip" dest="/export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/build/plugins/${download-plugin-name}.zip"/> |
---|
| 80 | <available property="desired.plugin.zip.present" file="/export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/build/plugins/${download-plugin-name}.zip"/> |
---|
| 81 | <condition property="plugin-found"> |
---|
| 82 | <and> |
---|
| 83 | <isset property="desired.plugin.zip.present"/> |
---|
| 84 | <not> |
---|
| 85 | <isset property="original.zip.exists"/> |
---|
| 86 | </not> |
---|
| 87 | </and> |
---|
| 88 | </condition> |
---|
| 89 | </target> |
---|
| 90 | <target if="original.zip.exists" name="is-downloaded"> |
---|
| 91 | <uptodate property="no-difference-found" srcfile="/export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/build/plugins/${download-plugin-name}.zip" targetfile="/export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/build/plugins/${download-plugin-name}.zip.orig"/> |
---|
| 92 | <if> |
---|
| 93 | <not> |
---|
| 94 | <isset property="no-difference-found"/> |
---|
| 95 | </not> |
---|
| 96 | <then> |
---|
| 97 | <property value="true" name="plugin-found"/> |
---|
| 98 | </then> |
---|
| 99 | </if> |
---|
| 100 | </target> |
---|
| 101 | <target if="original.zip.exists" name="remove-original-zip"> |
---|
| 102 | <delete file="/export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/build/plugins/${download-plugin-name}.zip.orig"/> |
---|
| 103 | </target> |
---|
| 104 | <target depends="has-been-downloaded,downloaded-message,uptodate-message,not-found-message" name="final-check"/> |
---|
| 105 | <target if="desired.plugin.zip.present" name="has-been-downloaded"> |
---|
| 106 | <condition property="up-to-date"> |
---|
| 107 | <not> |
---|
| 108 | <isset property="plugin-found"/> |
---|
| 109 | </not> |
---|
| 110 | </condition> |
---|
| 111 | <condition property="downloaded"> |
---|
| 112 | <isset property="plugin-found"/> |
---|
| 113 | </condition> |
---|
| 114 | </target> |
---|
| 115 | <target if="downloaded" name="downloaded-message"> |
---|
| 116 | <echo>Plugin org.apache.forrest.plugin.output.pdf downloaded ! Ready to install</echo> |
---|
| 117 | </target> |
---|
| 118 | <target if="up-to-date" name="uptodate-message"> |
---|
| 119 | <echo>Plugin org.apache.forrest.plugin.output.pdf was up-to-date ! Ready to configure</echo> |
---|
| 120 | <property value="true" name="plugin-found"/> |
---|
| 121 | </target> |
---|
| 122 | <target unless="desired.plugin.zip.present" name="not-found-message"> |
---|
| 123 | <fail> |
---|
| 124 | Unable to download the |
---|
| 125 | "org.apache.forrest.plugin.output.pdf" plugin |
---|
| 126 | |
---|
| 127 | or an equivalent unversioned plugin |
---|
| 128 | from http://forrest.apache.org/plugins/ |
---|
| 129 | There are a number of possible causes for this: |
---|
| 130 | |
---|
| 131 | One possible problem is that you do not have write access to |
---|
| 132 | FORREST_HOME, in which case ask your system admin to install the |
---|
| 133 | required Forrest plugin as described below. |
---|
| 134 | |
---|
| 135 | A further possibility is that Forrest may be unable to connect to |
---|
| 136 | the plugin distribution server. Again the solution is to manually |
---|
| 137 | install the plugin. |
---|
| 138 | |
---|
| 139 | To manually install a plugin, download the plugin zip file from |
---|
| 140 | http://forrest.apache.org/plugins/ and |
---|
| 141 | extract it into |
---|
| 142 | /export/crawlspace/hadoopqa/tools/buildtools/forrest/latest/build/plugins/org.apache.forrest.plugin.output.pdf</fail> |
---|
| 143 | </target> |
---|
| 144 | </project> |
---|