Skip to content

Instantly share code, notes, and snippets.

@emerleite
Created July 22, 2010 19:54
Show Gist options
  • Save emerleite/486484 to your computer and use it in GitHub Desktop.
Save emerleite/486484 to your computer and use it in GitHub Desktop.
#!/bin/bash
### BEGIN INFO
# Provides: Flex-SDK and FlexUnit
# Author: Emerson Macedo - http://github.com/emerleite - http://codificando.com
# Description: Install Flex-SDK and FlexUnit. Ajust environment configuration
### END INFO
ensure_installed() {
if [ ! `type -P $1` ]
then
echo "$1 is not installed. Please install before continue."
exit 127
fi
}
ensure_installed ant
ensure_installed java
echo "Going to user home dir - `echo ~`"
cd ~
echo "Downloading flex-sdk"
curl http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.1.0.16076.zip > flex_sdk_4.1.0.16076.zip
echo "Unpacking flex-sdk"
mkdir flex_sdk_4.1.0.16076 && unzip -qq flex_sdk_4.1.0.16076.zip -d flex_sdk_4.1.0.16076 && rm flex_sdk_4.1.0.16076.zip
ln -fs ./flex_sdk_4.1.0.16076 ./flex_sdk
echo "Setting FLEX_HOME and add it to PATH"
echo '' >> ~/.bash_profile
echo '# Flex SDK configuraion' >> ~/.bash_profile
echo 'export FLEX_HOME=~/flex_sdk' >> ~/.bash_profile
echo 'export PATH=$PATH:$FLEX_HOME/bin/' >> ~/.bash_profile
source ~/.bash_profile
echo "Downloading flex-unit"
curl http://flexunit.digitalprimates.net:8080/view/Flex%204.0/job/FlexUnit4-Flex4-AS3/lastSuccessfulBuild/artifact/flexunit.zip > flexunit.zip
echo "Unpacking flex-unit"
unzip -qq flexunit.zip && rm flexunit.zip
echo "Ajustin broken build.xml from example"
sed -i '' "s,flexUnitTasks-4.1.0.jar,flexUnitTasks-4.1.0-beta2.55.jar,g" flexunit/sampleCIProject/build.xml
echo "Flex-SDK and Flexunit successfull installed"
cd -
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment