forked from KhronosGroup/UnityGLTF
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbefore_script.sh
More file actions
38 lines (29 loc) · 1.06 KB
/
before_script.sh
File metadata and controls
38 lines (29 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
echo -en "travis_fold:start:before_script.1\\r" && echo "Applying Unity license"
set -e
set -x
mkdir -p /root/.cache/unity3d
mkdir -p /root/.local/share/unity3d/Unity/
set +x
UPPERCASE_BUILD_TARGET=${BUILD_TARGET^^};
if [ "$UPPERCASE_BUILD_TARGET" = "ANDROID" ]
then
if [ -n $ANDROID_KEYSTORE_BASE64 ]
then
echo '$ANDROID_KEYSTORE_BASE64 found, decoding content into keystore.keystore'
echo $ANDROID_KEYSTORE_BASE64 | base64 --decode > keystore.keystore
else
echo '$ANDROID_KEYSTORE_BASE64'" env var not found, building with Unity's default debug keystore"
fi
fi
LICENSE="UNITY_LICENSE_CONTENT_"$UPPERCASE_BUILD_TARGET
if [ -z "${!LICENSE}" ]
then
echo "$LICENSE env var not found, using default UNITY_LICENSE_CONTENT env var"
LICENSE=UNITY_LICENSE_CONTENT
else
echo "Using $LICENSE env var"
fi
echo "Writing $LICENSE to license file /root/.local/share/unity3d/Unity/Unity_lic.ulf"
echo "${!LICENSE}" | tr -d '\r' > /root/.local/share/unity3d/Unity/Unity_lic.ulf
echo -en "travis_fold:end:before_script.1\\r"