Skip to content
Browse files
add installer script
  • Loading branch information
justinmclean committed Oct 11, 2014
1 parent cbe8bfa commit 711e4544f65562023fc5a4bc83f8f7edcb012435
Showing 1 changed file with 127 additions and 0 deletions.
@@ -0,0 +1,127 @@
<?xml version="1.0"?>
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

<project name="squiggly_install" default="install" basedir=".">

<!-- Required for OSX 10.6 / Snow Leopard Performance. -->
<!-- Java 7 on Mac requires OSX 10.7.3 or higher and is 64-bit only -->
<!-- local.d32 is set/used in so this needs to be done first. -->
<condition property="local.d32" value="-d32">
<os family="windows"/>
<equals arg1="${}" arg2="64"/>
<equals arg1="${os.arch}" arg2="x86_64"/>
<equals arg1="${}" arg2="1.6"/>

<condition property="isMacOrLinux" value="mac">
<os family="mac" />
<os family="unix" />
<condition property="isWindows" value="windows">
<os family="windows" />

<property environment="env"/>
<condition property="FLEX_HOME" value="${env.FLEX_HOME}">
<isset property="env.FLEX_HOME" />

<property file="${FLEX_HOME}/"/>
<property file="${FLEX_HOME}/"/>
<property file="${basedir}/${bundle}.properties"/>

<property name="download.dir" value="${FLEX_HOME}/in"/>
<property name="unpack.dir" value="${FLEX_HOME}/squiggly"/>
<property name="mirror.url" value="" />

<property name="squiggly.url.folder" value="flex/squiggly/1.1" />

<target name="file-setup-win" if="isWindows">
<property name="squiggly.url.file" value="" />
<property name="squiggly.url.md5" value="34a0d8d445f8f1307cad35e25d1377bd" />

<target name="file-setup-unix" if="isMacOrLinux">
<property name="squiggly.url.file" value="apache-flex-squiggly-1.1-bin.tar.gz" />
<property name="squiggly.url.md5" value="ea03691ec15f625c5281e0d01dcc9570" />

<target name="install" depends="file-setup-win,file-setup-unix,squiggly-download-unpack" description="Adds squiggly to an Apache Flex SDK">
<delete dir="${download.dir}" />
<echo>Squiggly installed</echo>

<target name="squiggly-download-unpack" description="Downloads squiggly and copies into the Apache Flex SDK">
<mkdir dir="${download.dir}"/>

<get src="${mirror.url}" dest="${download.dir}/mirror.txt" />
<replace file="${download.dir}/mirror.txt" token="&lt;p&gt;" />
<replace file="${download.dir}/mirror.txt" token="&lt;/p&gt;" />
<loadfile property="squiggly.url.server" srcFile="${download.dir}/mirror.txt" />

<echo>Downloading ${squiggly.url.server}/${squiggly.url.folder}/${squiggly.url.file}</echo>

<antcall target="download-check-md5">
<param name="domain" value="${squiggly.url.server}" />
<param name="folder" value="${squiggly.url.folder}" />
<param name="file" value="${squiggly.url.file}" />
<param name="dest" value="${download.dir}/${squiggly.url.file}"/>
<param name="failmessage" value="Squiggly download failed" />
<param name="md5" value="${squiggly.url.md5}" />

<mkdir dir="${unpack.dir}"/>
<antcall target="files-unzip" />
<antcall target="files-untar" />

<target name="files-unzip" if="isWindows">
<unzip dest="${unpack.dir}">
<fileset file="${download.dir}/${squiggly.url.file}" />

<target name="files-untar" if="isMacOrLinux">
<untar dest="${unpack.dir}" compression="gzip">
<fileset file="${download.dir}/${squiggly.url.file}" />

<target name="download-check-md5" description="Downloads file, and verifies checksum.">
<tstamp />
<property name="ts" value="${DSTAMP}${TSTAMP}" />
<get src="${domain}/${folder}/${file}?ts=${ts}" dest="${dest}" verbose="true" />
<antcall target="check-md5" />

<target name="check-md5" description="Verifies MD5 checksum, and fails if checksum doesn't match">
<echo>Checking ${dest} matches ${md5}</echo>
<checksum file="${dest}" algorithm="MD5" verifyproperty="md5.failed" property="${md5}" />
<fail message="${failmessage}">
<equals arg1="${md5.failed}" arg2="false" />

0 comments on commit 711e454

Please sign in to comment.