Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/jobs/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,34 @@ jobs:
parameters:
vmImage: ${{ parameters.vmImage }}

- script: |
set -euo pipefail
ANDROID_SDK_ROOT="${ANDROID_SDK_ROOT:-${ANDROID_HOME:-}}"
if [ -z "$ANDROID_SDK_ROOT" ]; then
echo "ANDROID_SDK_ROOT or ANDROID_HOME must be set" >&2
exit 1
fi

if [ -x "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" ]; then
SDKMANAGER="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager"
elif [ -x "$ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager" ]; then
SDKMANAGER="$ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager"
elif [ -x "$ANDROID_SDK_ROOT/tools/bin/sdkmanager" ]; then
SDKMANAGER="$ANDROID_SDK_ROOT/tools/bin/sdkmanager"
else
echo "Unable to locate sdkmanager under $ANDROID_SDK_ROOT" >&2
exit 1
fi

echo "Installing Android NDK version $(NDK_VERSION) using $SDKMANAGER"
SDK_ARGS=("--sdk_root=$ANDROID_SDK_ROOT")

set +o pipefail
yes | "$SDKMANAGER" "${SDK_ARGS[@]}" --licenses >/dev/null
yes | "$SDKMANAGER" "${SDK_ARGS[@]}" --install "ndk;$(NDK_VERSION)"
set -o pipefail
displayName: 'Install Android NDK $(NDK_VERSION)'

- task: JavaToolInstaller@0
inputs:
versionSpec: '17'
Expand Down
28 changes: 28 additions & 0 deletions .github/jobs/android_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,34 @@ jobs:
parameters:
vmImage: ${{ parameters.vmImage }}

- script: |
set -euo pipefail
ANDROID_SDK_ROOT="${ANDROID_SDK_ROOT:-${ANDROID_HOME:-}}"
if [ -z "$ANDROID_SDK_ROOT" ]; then
echo "ANDROID_SDK_ROOT or ANDROID_HOME must be set" >&2
exit 1
fi

if [ -x "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" ]; then
SDKMANAGER="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager"
elif [ -x "$ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager" ]; then
SDKMANAGER="$ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager"
elif [ -x "$ANDROID_SDK_ROOT/tools/bin/sdkmanager" ]; then
SDKMANAGER="$ANDROID_SDK_ROOT/tools/bin/sdkmanager"
else
echo "Unable to locate sdkmanager under $ANDROID_SDK_ROOT" >&2
exit 1
fi

echo "Installing Android NDK version $(NDK_VERSION) using $SDKMANAGER"
SDK_ARGS=("--sdk_root=$ANDROID_SDK_ROOT")

set +o pipefail
yes | "$SDKMANAGER" "${SDK_ARGS[@]}" --licenses >/dev/null
yes | "$SDKMANAGER" "${SDK_ARGS[@]}" --install "ndk;$(NDK_VERSION)"
set -o pipefail
displayName: 'Install Android NDK $(NDK_VERSION)'

- script: |
echo Install Android image
echo 'y' | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-27;default;x86_64'
Expand Down
2 changes: 1 addition & 1 deletion .github/jobs/win32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parameters:

jobs:
- job: ${{ parameters.name }}
timeoutInMinutes: 20
timeoutInMinutes: 60
pool:
vmImage: ${{ parameters.vmImage }}
variables:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/build
.DS_Store
.vscode

dist/
50 changes: 37 additions & 13 deletions Apps/Playground/Android/BabylonNative/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ if (project.hasProperty("UNITY_BUILD")) {
}
def arcore_libpath = "${buildDir}/arcore-native"

def deviceAbis = project.hasProperty("ARM64Only") ? ["arm64-v8a"] : ["arm64-v8a", "armeabi-v7a", "x86"]
def xrSimulatorAbis = ["arm64-v8a"]

configurations { natives }

android {
Expand All @@ -31,16 +34,15 @@ android {
defaultConfig {
minSdk 25

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
ndkVersion "23.1.7779620"
ndkVersion "28.2.13676358"
if (project.hasProperty("NDK_VERSION")) {
def NDKVersion = project.property("NDK_VERSION")
ndkVersion "${NDK_VERSION}"
}
externalNativeBuild {
cmake {
abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
arguments "-DANDROID_STL=c++_shared",
"-DENABLE_PCH=OFF",
"-DGRAPHICS_API=${graphics_api}",
Expand All @@ -51,18 +53,39 @@ android {
"-DBABYLON_DEBUG_TRACE=ON"
}
}
ndk {
if (project.hasProperty("ARM64Only")) {
abiFilters "arm64-v8a"
} else {
abiFilters "arm64-v8a", "armeabi-v7a", "x86"
}
}
packagingOptions {
exclude '**/libarcore_sdk_c.so'
}
}

flavorDimensions "runtime"
productFlavors {
device {
dimension "runtime"
ndk {
abiFilters.addAll(deviceAbis)
}
externalNativeBuild {
cmake {
abiFilters.clear()
abiFilters.addAll(deviceAbis)
}
}
}
androidXrSimulator {
dimension "runtime"
ndk {
abiFilters.addAll(xrSimulatorAbis)
}
externalNativeBuild {
cmake {
abiFilters.clear()
abiFilters.addAll(xrSimulatorAbis)
}
}
}
}

externalNativeBuild {
cmake {
version '3.19.6+'
Expand Down Expand Up @@ -92,10 +115,11 @@ dependencies {
// ARCore library
implementation 'com.google.ar:core:1.14.0'
natives 'com.google.ar:core:1.14.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.example.babylonnative;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
31 changes: 25 additions & 6 deletions Apps/Playground/Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,41 @@ if (project.hasProperty("UNITY_BUILD")) {
}
def arcore_libpath = "${buildDir}/arcore-native"

def deviceAbis = project.hasProperty("ARM64Only") ? ["arm64-v8a"] : ["arm64-v8a", "armeabi-v7a", "x86"]
def xrSimulatorAbis = ["arm64-v8a"]

configurations { natives }

android {
compileSdkVersion 29
compileSdk 34

defaultConfig {
applicationId "com.android.babylonnative.playground"
minSdkVersion "${platformVersion}"
targetSdkVersion 29
ndkVersion "23.1.7779620"
minSdk platformVersion
targetSdk 34
ndkVersion "28.2.13676358"
if (project.hasProperty("NDK_VERSION")) {
def NDKVersion = project.property("NDK_VERSION")
ndkVersion "${NDK_VERSION}"
}
}

flavorDimensions "runtime"
productFlavors {
device {
dimension "runtime"
ndk {
abiFilters.addAll(deviceAbis)
}
}
androidXrSimulator {
dimension "runtime"
ndk {
abiFilters.addAll(xrSimulatorAbis)
}
}
}

packagingOptions {
jniLibs {
pickFirsts += ['lib/*/libv8android.so', 'lib/*/libjsc.so', 'lib/*/libBabylonNativeJNI.so', 'lib/*/libc++_shared.so']
Expand Down Expand Up @@ -62,8 +81,8 @@ dependencies {
implementation project(':BabylonNative')
natives 'com.google.ar:core:1.14.0'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
}

// Extracts the shared libraries from aars in the natives configuration.
Expand Down
1 change: 1 addition & 0 deletions Apps/Playground/Android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/playground_activity">
<activity android:name="PlaygroundActivity"
android:exported="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:configChanges="orientation|keyboardHidden|screenSize">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import android.view.View;

import com.library.babylonnative.BabylonView;
Expand Down
2 changes: 2 additions & 0 deletions Apps/Playground/Android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# jsEngine=JavaScriptCore
android.useAndroidX=true
android.enableJetifier=true
Empty file modified Apps/Playground/Android/gradlew
100644 → 100755
Empty file.
8 changes: 5 additions & 3 deletions Apps/Playground/Scripts/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@
"title": "Glow layer and LODs",
"playgroundId": "#UNS6ZV#2",
"renderCount": 50,
"excludedGraphicsApis": [ "OpenGL" ],
"excludedGraphicsApis": [ "OpenGL", "D3D12" ],
"referenceImage": "glowlayerandlods.png",
"comment": "xvfb : invalid enum with glRenderbufferStorage"
"comment": "xvfb : invalid enum with glRenderbufferStorage. D3D12/CI: mapping a texture fails with error HRESULT 0x887A0005"
},
{
"title": "Nested BBG",
Expand All @@ -128,7 +128,9 @@
{
"title": "Dynamic Texture context clip",
"playgroundId": "#FU0ES5#47",
"referenceImage": "dynamicTextureClip.png"
"referenceImage": "dynamicTextureClip.png",
"excludedGraphicsApis": ["D3D12" ],
"comment": "D3D12/CI: Incorrect rendering of clipped texture"
},
{
"title": "GUI3D SpherePanel",
Expand Down
2 changes: 1 addition & 1 deletion Apps/Playground/Scripts/validation_native.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
}

function evaluate(test, referenceImage, done, compareFunction) {
engine._engine.getFrameBufferData(function (screenshot) {
TestUtils.getFrameBufferData(function (screenshot) {
let testRes = true;

if (!test.onlyVisual) {
Expand Down
Loading