Skip to content

Commit

Permalink
Updates sept 2022 (#5)
Browse files Browse the repository at this point in the history
Updated to support OVR SDK 1.50 & Latest QuakeQuest.
  • Loading branch information
BrainSlugs83 authored Sep 1, 2022
1 parent 4fe133b commit 9694450
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 20 deletions.
3 changes: 3 additions & 0 deletions bash-debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
::docker run -it thyrlian/android-sdk /bin/bash
docker run -it brainslugs83/ovrsdk /bin/bash
41 changes: 26 additions & 15 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ FROM thyrlian/android-sdk:latest
LABEL maintainer "brainslugs83@gmail.com"

ENV _JAVA_OPTIONS -XX:+UseContainerSupport
RUN ln -s /usr/bin/python3 /usr/bin/python

RUN apt-get update -y && \
apt-get install -y make dos2unix nano file && \
apt-get clean && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/*

# Downgrade to Gradle 4.x; 5.x has major compatibility issues.
ARG GRADLE_VERSION=4.8
# Upgrade Gradle
ARG GRADLE_VERSION=6.5.1
RUN cd /opt && \
rm -rf gradle && \
wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip && \
Expand All @@ -28,20 +29,21 @@ RUN cd /opt && \
rm gradle*.zip

# Install Android SDK
RUN cd ${ANDROID_HOME}/tools/bin && \
RUN /opt/license_accepter.sh
RUN cd ${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin && \
sdkmanager --update && \
sdkmanager "lldb;3.1" "ndk-bundle" "cmake;3.10.2.4988404" "platform-tools" \
"platforms;android-21" "platforms;android-22" "platforms;android-23" \
"platforms;android-24" "platforms;android-25" "platforms;android-26" \
"platforms;android-27" "platforms;android-28" "platforms;android-29" \
"build-tools;21.1.2" "build-tools;22.0.1" "build-tools;23.0.3" \
"build-tools;24.0.3" "build-tools;25.0.3" "build-tools;26.0.3" \
"build-tools;27.0.3" "build-tools;28.0.3" "build-tools;29.0.1"
sdkmanager "ndk;21.4.7075529" "cmake;3.22.1" "platform-tools" \
"platforms;android-21" "platforms;android-22" "platforms;android-23" \
"platforms;android-24" "platforms;android-25" "platforms;android-26" \
"platforms;android-27" "platforms;android-28" "platforms;android-29" \
"build-tools;21.1.2" "build-tools;22.0.1" "build-tools;23.0.3" \
"build-tools;24.0.3" "build-tools;25.0.3" "build-tools;26.0.3" \
"build-tools;27.0.3" "build-tools;28.0.3" "build-tools;29.0.3"

ENV PATH=${PATH}:${JAVA_HOME}/bin
ENV ANDROID_NDK=${ANDROID_HOME}/ndk-bundle
ENV ANDROID_NDK_ROOT=${ANDROID_HOME}/ndk-bundle
ENV ANDROID_NDK_HOME=${ANDROID_HOME}/ndk-bundle
ENV ANDROID_NDK=${ANDROID_SDK_ROOT}/ndk/21.4.7075529/
ENV ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk/21.4.7075529/
ENV ANDROID_NDK_HOME=${ANDROID_SDK_ROOT}/ndk/21.4.7075529/

# Install OVR SDK, compile one of the samples so that the main libs
# are precompiled and setup, then empty out the VrSamples folder.
Expand All @@ -58,13 +60,22 @@ RUN cd ${OVR_HOME} && \
COPY src/local.properties ${OVR_HOME}
RUN dos2unix ${OVR_HOME}/local.properties

COPY src/gradle-wrapper.properties ${OVR_HOME}/gradle/wrapper
COPY src/fix-gradle.py ${OVR_HOME}
RUN dos2unix ${OVR_HOME}/fix-gradle.py
RUN dos2unix ${OVR_HOME}/gradle/wrapper/gradle-wrapper.properties

RUN cd ${OVR_HOME} && find -name "*.py" -type f | xargs -r chmod +x
RUN cd ${OVR_HOME} && find -name "*.sh" -type f | xargs -r chmod +x

RUN cd ${OVR_HOME}/VrSamples/VrController/Projects/Android && ./build.py -n
RUN cd ${OVR_HOME}/VrSamples/VrInput/Projects/Android && ./build.py -n
RUN cd ${OVR_HOME}/VrSamples/VrInputStandard/Projects/Android && ./build.py -n
RUN cd ${OVR_HOME}/VrSamples/VrHands/Projects/Android && ./build.py -n
RUN cd ${OVR_HOME}/VrSamples/VrCompositor_NativeActivity/Projects/Android && ./build.py -n
RUN cd ${OVR_HOME}/VrSamples/VrCubeWorld_Framework/Projects/Android && ./build.py -n
RUN cd ${OVR_HOME}/VrSamples/VrCubeWorld_NativeActivity/Projects/Android && ./build.py -n
RUN cd ${OVR_HOME}/VrSamples/VrCubeWorld_SurfaceView/Projects/Android && ./build.py -n
RUN cd ${OVR_HOME}/VrSamples/VrCubeWorld_Vulkan/Projects/Android && ./build.py -n

RUN cd ${OVR_HOME} && find -name "*.keystore" -type f | xargs -r -I{} cp -f {} ${OVR_HOME}
RUN cd ${OVR_HOME} && rm -rf VrSamples && mkdir VrSamples

Expand Down
7 changes: 6 additions & 1 deletion src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ find -name "*.apk" -type f | xargs -r rm

build_dir=$(find -name "build.py" -type f | xargs dirname)
cd ${build_dir}
cp ${OVR_HOME}/*.keystore .
cp -n ${OVR_HOME}/*.keystore . || true
cp -n ${OVR_HOME}/fix-gradle.py . || true
chmod +x fix-gradle.py
./fix-gradle.py > build.gradle.new
mv build.gradle build.gradle.old
mv build.gradle.new build.gradle

[ -d "./build" ] && rm -rf ./build
[ -d "./.externalNativeBuild" ] && rm -rf ./.externalNativeBuild
Expand Down
4 changes: 4 additions & 0 deletions src/fix-gradle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/python
import re
with open('build.gradle', 'r') as f:
print(re.sub('task\s+prepareKotlinBuildScriptModel\s+\{\s+\}', '', f.read()))
2 changes: 1 addition & 1 deletion src/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
4 changes: 2 additions & 2 deletions src/local.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ndk.dir=/opt/android-sdk/ndk-bundle
sdk.dir=/opt/android-sdk/
ndk.dir=/opt/android-sdk/ndk/21.4.7075529/
sdk.dir=/opt/android-sdk/
2 changes: 1 addition & 1 deletion test.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
SET PROJ=%~1
IF "%PROJ%"=="" SET PROJ=D:\projects.git\ovr\VrSamples\VrController
IF "%PROJ%"=="" SET PROJ=D:\projects.git\OVR_SDK_1.50\VrSamples\VrHands

del %proj%\*.apk >nul 2>&1
docker run -it --rm -v %PROJ%:/proj brainslugs83/ovrsdk /opt/build.sh
Expand Down

0 comments on commit 9694450

Please sign in to comment.