diff --git a/.gitignore b/.gitignore index d247157..06b5e34 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ Kin Android/.gradle Kin Android/build Kin Unity/.gradle Kin Unity/Logs +Unity_license.ulf diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..2778d23 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +sudo: required +language: bash +env: + global: + - IMAGE_NAME=yosriz/unity-2018.3.14f1-android-sdk-gmsaas:latest +services: +- docker +before_install: +- docker pull $IMAGE_NAME +script: +# decrypt unity license credentials +- openssl aes-256-cbc -K $encrypted_2f80d11909ba_key -iv $encrypted_2f80d11909ba_iv -in Unity_license.ulf.enc -out Unity_license.ulf -d +- scripts/ci_run_docker.sh + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2d4cccc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM gableroux/unity3d:2018.3.14f1-android + +RUN touch /root/.android/repositories.cfg \ + && /opt/android-sdk-linux/tools/bin/sdkmanager --install tools "platforms;android-28" "build-tools;28.0.3" "extras;android;m2repository" "platform-tools" \ + && export PATH="/opt/android-sdk-linux/platform-tools/:$PATH" \ + # install genymotion cloud tool gmsaas + # first install pip3 + && apt-get update -y && apt-get install -y python3-pip \ + # install gmsaas + && pip3 install gmsaas==1.0.0 \ + && gmsaas config set android-sdk-path /opt/android-sdk-linux/ \ No newline at end of file diff --git a/Kin Unity/Assets/Kin/Editor/PostProcessor.cs b/Kin Unity/Assets/Kin/Editor/PostProcessor.cs index dac144d..1836d87 100644 --- a/Kin Unity/Assets/Kin/Editor/PostProcessor.cs +++ b/Kin Unity/Assets/Kin/Editor/PostProcessor.cs @@ -1,4 +1,5 @@ -using UnityEngine; +#if UNITY_IOS +using UnityEngine; using UnityEditor; using UnityEditor.Callbacks; using UnityEditor.iOS.Xcode; @@ -58,3 +59,4 @@ public static void OnPostProcessBuild( BuildTarget buildTarget, string buildPath } } } +#endif \ No newline at end of file diff --git a/Kin Unity/ProjectSettings/ProjectSettings.asset b/Kin Unity/ProjectSettings/ProjectSettings.asset index c2323f8..6068c90 100644 --- a/Kin Unity/ProjectSettings/ProjectSettings.asset +++ b/Kin Unity/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 16 + serializedVersion: 15 productGUID: 8a65fec08cc234624aafd06df2b2ea24 AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 @@ -125,6 +125,7 @@ PlayerSettings: m_HolographicPauseOnTrackingLoss: 1 xboxOneDisableKinectGpuReservation: 0 xboxOneEnable7thCore: 0 + isWsaHolographicRemotingEnabled: 0 vrSettings: cardboard: depthFormat: 0 @@ -139,17 +140,10 @@ PlayerSettings: hololens: depthFormat: 1 depthBufferSharingEnabled: 0 - lumin: - depthFormat: 0 - frameTiming: 2 - enableGLCache: 0 - glCacheMaxBlobSize: 524288 - glCacheMaxFileSize: 8388608 oculus: sharedDepthBuffer: 0 dashSupport: 0 enable360StereoCapture: 0 - isWsaHolographicRemotingEnabled: 0 protectGraphicsMemory: 0 enableFrameTimingStats: 0 useHDRDisplay: 0 @@ -201,10 +195,6 @@ PlayerSettings: iPadHighResPortraitSplashScreen: {fileID: 0} iPadLandscapeSplashScreen: {fileID: 0} iPadHighResLandscapeSplashScreen: {fileID: 0} - iPhone65inPortraitSplashScreen: {fileID: 0} - iPhone65inLandscapeSplashScreen: {fileID: 0} - iPhone61inPortraitSplashScreen: {fileID: 0} - iPhone61inLandscapeSplashScreen: {fileID: 0} appleTVSplashScreen: {fileID: 0} appleTVSplashScreen2x: {fileID: 0} tvOSSmallIconLayers: [] @@ -264,7 +254,6 @@ PlayerSettings: AndroidEnableTango: 0 androidEnableBanner: 1 androidUseLowAccuracyLocation: 0 - androidUseCustomKeystore: 0 m_AndroidBanners: - width: 320 height: 180 @@ -468,7 +457,6 @@ PlayerSettings: m_BuildTargetEnableVuforiaSettings: [] openGLRequireES31: 0 openGLRequireES31AEP: 0 - openGLRequireES32: 0 m_TemplateCustomTags: {} mobileMTRendering: Android: 1 @@ -652,7 +640,6 @@ PlayerSettings: ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 ps4ProGarlicHeapSize: 2560 - playerPrefsMaxSize: 32768 ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ ps4pnSessions: 1 ps4pnPresence: 1 @@ -700,7 +687,6 @@ PlayerSettings: webGLCompressionFormat: 1 webGLLinkerTarget: 1 webGLThreadsSupport: 0 - webGLWasmStreaming: 0 scriptingDefineSymbols: {} platformArchitecture: {} scriptingBackend: {} @@ -710,8 +696,6 @@ PlayerSettings: allowUnsafeCode: 0 additionalIl2CppArgs: scriptingRuntimeVersion: 0 - gcIncremental: 0 - gcWBarrierValidation: 0 apiCompatibilityLevelPerPlatform: {} m_RenderingPath: 1 m_MobileRenderingPath: 1 @@ -742,6 +726,7 @@ PlayerSettings: metroFTAName: metroFTAFileTypes: [] metroProtocolName: + metroCompilationOverrides: 1 XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -780,7 +765,7 @@ PlayerSettings: m_PortalFolderPath: luminCert: m_CertPath: - m_SignPackage: 1 + m_PrivateKeyPath: luminIsChannelApp: 0 luminVersion: m_VersionCode: 1 diff --git a/Unity_license.ulf.enc b/Unity_license.ulf.enc new file mode 100644 index 0000000..b83f5a0 Binary files /dev/null and b/Unity_license.ulf.enc differ diff --git a/scripts/ci_run_docker.sh b/scripts/ci_run_docker.sh new file mode 100755 index 0000000..30e1fae --- /dev/null +++ b/scripts/ci_run_docker.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e #exit on any command failure +set -x + +docker run -it --rm \ +-e "GENY_USERNAME=$GENY_USERNAME" \ +-e "GENY_PASSWORD=$GENY_PASSWORD" \ +--network=host \ +-v "$(pwd):/root/project" \ +$IMAGE_NAME \ +/bin/bash -c "/root/project/scripts/ci_run_test.sh" \ No newline at end of file diff --git a/scripts/ci_run_test.sh b/scripts/ci_run_test.sh new file mode 100755 index 0000000..b3773b2 --- /dev/null +++ b/scripts/ci_run_test.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +set -x + +TEST_RESULT_FILE="/root/project/test_results.xml" +# Google Pixel device with Android 9.0 +GENY_DEVICE_TEMPLATE_ID="107d757e-463a-4a18-8667-b8dec6e4c87e" + +# copy unity license file +mkdir /root/.local/share/unity3d/Unity +cp /root/project/Unity_license.ulf /root/.local/share/unity3d/Unity/Unity_lic.ulf + +# login to gmsaas (genymotion tool) +gmsaas auth login $GENY_USERNAME "$GENY_PASSWORD" +# start the instance +instance_id=$(gmsaas instances start $GENY_DEVICE_TEMPLATE_ID ci_test) +# connect insatnce via ADB +gmsaas instances adbconnect $instance_id + +# extract the port adb is connected to the remote device +adb_port=$(adb devices |grep localhost: | grep -o -E '[0-9]+') +# WORKAROUND: expliclty forward adb device port to Unity test runner, from some reason Unity test runner +# is failed doing that in the build/test process +adb -s "localhost:$adb_port" forward "tcp:34999" "localabstract:Unity-com.UnityTestRunner.UnityTestRunner" + +# run unity test with remote device (use xvfb to create required virtual screen) +${UNITY_EXECUTABLE:-xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' /opt/Unity/Editor/Unity} \ +-projectPath /root/project/Kin\ Unity/ \ +-runTests -buildTarget Android -testPlatform android -logfile \ +-batchmode -testResults $TEST_RESULT_FILE +UNITY_EXIT_CODE=$? + +if [ $UNITY_EXIT_CODE -eq 0 ]; then + echo "Run succeeded, no failures occurred"; +elif [ $UNITY_EXIT_CODE -eq 2 ]; then + echo "Run succeeded, some tests failed"; + cat $TEST_RESULT_FILE +elif [ $UNITY_EXIT_CODE -eq 3 ]; then + echo "Run failure (other failure)"; + cat $TEST_RESULT_FILE +else + echo "Unexpected exit code $UNITY_EXIT_CODE"; + cat $TEST_RESULT_FILE +fi + +grep test-run $TEST_RESULT_FILE | grep "result=" +gmsaas instances stop $instance_id +exit $UNITY_EXIT_CODE \ No newline at end of file