Skip to content

Commit e29c4a1

Browse files
committed
unity installation revisions, caching Unity download directory
1 parent a659329 commit e29c4a1

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ language: objective-c
22
osx_image: xcode61
33
rvm:
44
- 2.1.2
5+
cache:
6+
directories:
7+
- ./Unity
58
before_install:
69
- chmod a+x ./Travis/installUnity.sh
710
install:

Travis/installUnity.sh

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
11
#! /bin/sh
2-
project="unity-sdk-travis"
2+
3+
set -e
34

45
BASE_URL=http://netstorage.unity3d.com/unity
56
HASH=38b4efef76f0
67
VERSION=5.5.0f3
78

89
download() {
9-
file=$1
10-
url="$BASE_URL/$HASH/$package"
10+
file=$1
11+
url="$BASE_URL/$HASH/$package"
1112

12-
echo "Downloading from $url: "
13-
curl -o `basename "$package"` "$url"
13+
echo "Downloading from $url: "
14+
cd Unity
15+
curl -o `basename "$package"` "$url"
16+
cd ../
1417
}
1518

1619
install() {
17-
package=$1
18-
download "$package"
20+
package=$1
21+
filename=`basename "$package"`
22+
packagePath = "/Unity/$filename"
23+
if [ ! -f $packagePath ] ; then
24+
download "$package"
25+
fi
1926

20-
echo "Installing "`basename "$package"`
21-
sudo installer -dumplog -package `basename "$package"` -target /
27+
echo "Installing "`basename "$package"`
28+
sudo installer -dumplog -package $packagePath -target /
2229
}
2330

24-
# See $BASE_URL/$HASH/unity-$VERSION-$PLATFORM.ini for complete list
25-
# of available packages, where PLATFORM is `osx` or `win`
31+
if [ ! -d "Unity" ] ; then
32+
mkdir -p -m 777 Unity
33+
fi
2634

2735
install "MacEditorInstaller/Unity-$VERSION.pkg"
2836
install "MacEditorTargetInstaller/UnitySetup-Windows-Support-for-Editor-$VERSION.pkg"
2937
install "MacEditorTargetInstaller/UnitySetup-Mac-Support-for-Editor-$VERSION.pkg"
30-
# install "MacEditorTargetInstaller/UnitySetup-Linux-Support-for-Editor-$VERSION.pkg"

0 commit comments

Comments
 (0)