diff --git a/.github/jobs/android.yml b/.github/jobs/android.yml
index 241f247ae..38ef161fb 100644
--- a/.github/jobs/android.yml
+++ b/.github/jobs/android.yml
@@ -19,11 +19,6 @@ jobs:
parameters:
vmImage: ${{ parameters.vmImage }}
- - script: |
- cd Apps/Playground/Android
- npm install
- displayName: 'Install JS engine NPMs'
-
- task: Gradle@2
inputs:
workingDirectory: 'Apps/Playground/Android'
diff --git a/.github/jobs/android_tests.yml b/.github/jobs/android_tests.yml
new file mode 100644
index 000000000..c32b5216b
--- /dev/null
+++ b/.github/jobs/android_tests.yml
@@ -0,0 +1,60 @@
+parameters:
+ name: ''
+ vmImage: ''
+ JSEngine: ''
+ macOSCodename: ''
+
+jobs:
+ - job: ${{ parameters.name }}
+ timeoutInMinutes: 45
+ pool:
+ vmImage: ${{ parameters.vmImage }}
+
+ steps:
+ - script: |
+ git submodule update --init --recursive
+ displayName: 'Checkout dependencies'
+
+ - template: cmake.yml
+ parameters:
+ vmImage: ${{ parameters.vmImage }}
+
+ - script: |
+ echo Install Android image
+ echo 'y' | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-27;default;x86_64'
+ echo 'y' | $ANDROID_HOME/tools/bin/sdkmanager --licenses
+ echo Create AVD
+ $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_27 -d pixel -k 'system-images;android-27;default;x86_64'
+ displayName: 'Install Android Emulator'
+
+ - script: |
+ echo Start emulator
+ nohup $ANDROID_HOME/emulator/emulator -avd Pixel_API_27 -gpu host -no-window 2>&1 &
+ echo Wait for emulator
+ $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do echo '.'; sleep 1; done'
+ $ANDROID_HOME/platform-tools/adb devices
+ displayName: 'Start Android Emulator'
+
+ - task: Gradle@3
+ inputs:
+ gradleWrapperFile: 'Apps/UnitTests/Android/gradlew'
+ workingDirectory: 'Apps/UnitTests/Android'
+ options: '-PabiFilters=x86_64 -PjsEngine=${{parameters.jsEngine}}'
+ tasks: 'connectedAndroidTest'
+ jdkVersionOption: 1.11
+ displayName: 'Run Connected Android Test'
+
+ - script: |
+ export results=$(find ./app/build/outputs/androidTest-results -name "*.txt")
+ echo cat "$results"
+ cat "$results"
+ workingDirectory: 'Apps/UnitTests/Android'
+ condition: succeededOrFailed()
+ displayName: 'Dump logcat from Test Results'
+
+ - task: PublishBuildArtifacts@1
+ inputs:
+ pathToPublish: 'Apps/UnitTests/Android/app/build/outputs/androidTest-results/connected'
+ artifactName: 'AndroidTestResults_${{parameters.jsEngine}}'
+ condition: succeededOrFailed()
+ displayName: 'Publish Test Results'
diff --git a/.github/jobs/win32.yml b/.github/jobs/win32.yml
index d43ab8fda..500808094 100644
--- a/.github/jobs/win32.yml
+++ b/.github/jobs/win32.yml
@@ -59,7 +59,13 @@ jobs:
cd RelWithDebInfo
Playground app:///Scripts/validation_native.js
displayName: 'Validation Tests'
-
+
+ - script: |
+ cmake --build build${{ variables.solutionName }} --target INSTALL --config RelWithDebInfo
+ cd Install/Test
+ cmake . -DBINARY_DIR=../../build${{ variables.solutionName }} ${{ variables.jsEngineDefine }} && cmake --build . --config RelWithDebInfo
+ displayName: 'Install'
+
- task: PublishBuildArtifacts@1
inputs:
artifactName: '${{ variables.solutionName }} - ${{ parameters.graphics_api }} Rendered Pictures'
diff --git a/Apps/Playground/Android/app/CMakeLists.txt b/Apps/Playground/Android/app/CMakeLists.txt
index b49da5a03..1c16356c3 100644
--- a/Apps/Playground/Android/app/CMakeLists.txt
+++ b/Apps/Playground/Android/app/CMakeLists.txt
@@ -23,14 +23,6 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(BABYLON_NATIVE_PLATFORM "Android")
set(CMAKE_CXX_STANDARD 17)
-if (${ANDROID_JSENGINE_LIBNAME} STREQUAL "jsc")
- set(NAPI_JAVASCRIPT_ENGINE "JavaScriptCore" CACHE STRING "JavaScript engine for N-API.")
-elseif (${ANDROID_JSENGINE_LIBNAME} STREQUAL "v8android")
- set(NAPI_JAVASCRIPT_ENGINE "V8" CACHE STRING "JavaScript engine for N-API.")
-else()
- message(FATAL_ERROR "Unrecognized JS engine: ${ANDROID_JSENGINE_LIBNAME}")
-endif()
-
add_library(javascript_engine SHARED IMPORTED GLOBAL)
set_target_properties(javascript_engine PROPERTIES IMPORTED_LOCATION "${ANDROID_JSENGINE_LIBPATH}/${ANDROID_ABI}/lib${ANDROID_JSENGINE_LIBNAME}.so")
target_include_directories(javascript_engine INTERFACE "${ANDROID_JSENGINE_INCPATH}")
diff --git a/Apps/Playground/Android/app/build.gradle b/Apps/Playground/Android/app/build.gradle
index d24a60c4b..2e36b8ca1 100644
--- a/Apps/Playground/Android/app/build.gradle
+++ b/Apps/Playground/Android/app/build.gradle
@@ -1,21 +1,8 @@
apply plugin: 'com.android.application'
-// When no project property is set for Gradle ('-PJSEngine=')
-// default JS engine is set to v8android
-// JSEngine property can be:
-// - jsc for JavaScriptCore
-// - v8android for V8
-
-def jsEngineBaseDir = "${buildDir}/JS"
-def jsEngineIncDir = "${jsEngineBaseDir}/include/V8"
-def jsEngineLibDir = "${rootDir}/app/src/main/jniLibs"
-
-def jsEngineLibName = "v8android"
-if (project.hasProperty("JSEngine")) {
- jsEngineLibName = project.property("JSEngine")
- if ("${jsEngineLibName}" == "jsc" ) {
- jsEngineIncDir = "${jsEngineBaseDir}/include"
- }
+def jsEngine = "V8"
+if (project.hasProperty("jsEngine")) {
+ jsEngine = project.property("jsEngine")
}
def graphics_api = "OpenGL"
@@ -36,12 +23,12 @@ def arcore_libpath = "${buildDir}/arcore-native"
configurations { natives }
android {
- compileSdkVersion 28
+ compileSdkVersion 29
defaultConfig {
applicationId "com.android.babylonnative.playground"
minSdkVersion "${platformVersion}"
- targetSdkVersion 28
+ targetSdkVersion 29
ndkVersion "23.1.7779620"
if (project.hasProperty("NDK_VERSION")) {
def NDKVersion = project.property("NDK_VERSION")
@@ -54,9 +41,8 @@ android {
"-DENABLE_PCH=OFF",
"-DGRAPHICS_API=${graphics_api}",
"-DARCORE_LIBPATH=${arcore_libpath}/jni",
- "-DANDROID_JSENGINE_LIBPATH=${jsEngineLibDir}",
- "-DANDROID_JSENGINE_LIBNAME=${jsEngineLibName}",
- "-DANDROID_JSENGINE_INCPATH=${jsEngineIncDir}",
+ "-DNAPI_JAVASCRIPT_ENGINE=${jsEngine}",
+ "-DJSRUNTIMEHOST_CORE_APPRUNTIME_V8_INSPECTOR=ON"
"-DCMAKE_UNITY_BUILD=${unity_build}"
}
}
@@ -162,78 +148,5 @@ task copyFiles {
}
}
-repositories {
- mavenLocal()
- maven {
- // Android JSC is installed from npm
- url "$rootDir/../../node_modules/jsc-android/dist"
- }
- maven {
- // Android V8 is installed from npm
- url "$rootDir/../../node_modules/v8-android/dist"
- }
- google()
- jcenter()
-}
-
-configurations
-{
- jscAndroid
- v8Android
-}
-
-dependencies {
- jscAndroid 'org.webkit:android-jsc:+'
- v8Android 'org.chromium:v8-android:+'
-}
-
-// Extracts the shared libraries from aars in the natives configuration.
-// This is done so that NDK builds can access these libraries.
-task extractJSEngineLibraries() {
- // Always extract, this insures the native libs are updated if the version changes.
- outputs.upToDateWhen { false }
- def jsconfig
- if ("${jsEngineLibName}" == "jsc" ) {
- jsconfig = configurations.jscAndroid
- } else {
- jsconfig = configurations.v8Android
- }
- doFirst {
- jsconfig.files.each { f ->
- copy {
- from zipTree(f)
- into jsEngineLibDir
- include "jni/**/*"
- // remove 'jni/'
- eachFile { fcd ->
- fcd.relativePath = new RelativePath(true, fcd.relativePath.segments.drop(1))
- }
- includeEmptyDirs = false
- }
- }
- }
-}
-
-tasks.whenTaskAdded { task ->
- if (task.name.contains("external") && !task.name.contains("Clean")) {
- task.dependsOn(extractJSEngineLibraries)
- }
-}
-
-task copyFilesJSHeaders {
- copy
- {
- from "${rootDir}/../../node_modules/jsc-android/dist/include"
- include "*"
- into "${jsEngineBaseDir}/include/JavaScriptCore"
- }
- copy
- {
- from "${rootDir}/../../node_modules/v8-android/dist/include"
- include "**/*"
- into "${jsEngineIncDir}"
- }
-}
-
preBuild.dependsOn(copyFiles)
-preBuild.dependsOn(copyFilesJSHeaders)
+
diff --git a/Apps/Playground/Scripts/config.json b/Apps/Playground/Scripts/config.json
index 14abb2fcb..32a2053e1 100644
--- a/Apps/Playground/Scripts/config.json
+++ b/Apps/Playground/Scripts/config.json
@@ -183,7 +183,7 @@
},
{
"title": "LightFalloff",
- "playgroundId": "#20OAV9#201",
+ "playgroundId": "#20OAV9#11218",
"referenceImage": "lightFalloff.png"
},
{
@@ -207,7 +207,7 @@
{
"title": "Capsule",
"renderCount": 10,
- "playgroundId": "#JAFIIU#2",
+ "playgroundId": "#JAFIIU#4",
"referenceImage": "CreateCapsule.png"
},
{
diff --git a/Apps/UnitTests/Android/.gitignore b/Apps/UnitTests/Android/.gitignore
new file mode 100644
index 000000000..ca296116d
--- /dev/null
+++ b/Apps/UnitTests/Android/.gitignore
@@ -0,0 +1,10 @@
+*.iml
+.gradle/
+.idea/
+local.properties
+
+app/.cxx/
+app/build/
+app/src/main/assets
+
+build/
\ No newline at end of file
diff --git a/Apps/UnitTests/Android/app/build.gradle b/Apps/UnitTests/Android/app/build.gradle
new file mode 100644
index 000000000..fa6c88f67
--- /dev/null
+++ b/Apps/UnitTests/Android/app/build.gradle
@@ -0,0 +1,110 @@
+plugins {
+ id 'com.android.application'
+}
+
+def jsEngine = "V8"
+if (project.hasProperty("jsEngine")) {
+ jsEngine = project.property("jsEngine")
+}
+
+configurations { natives }
+
+android {
+ namespace 'com.babylonnative.unittests'
+ compileSdk 33
+ ndkVersion = "21.4.7075529"
+
+ defaultConfig {
+ applicationId "com.babylonnative.unittests"
+ minSdk 21
+ targetSdk 33
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+
+ externalNativeBuild {
+ cmake {
+ arguments (
+ "-DANDROID_STL=c++_shared",
+ "-DNAPI_JAVASCRIPT_ENGINE=${jsEngine}",
+ "-DJSRUNTIMEHOST_CORE_APPRUNTIME_V8_INSPECTOR=ON",
+ )
+ }
+ }
+
+ if (project.hasProperty("abiFilters")) {
+ ndk {
+ abiFilters project.getProperty("abiFilters")
+ }
+ }
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+ externalNativeBuild {
+ cmake {
+ path file('src/main/cpp/CMakeLists.txt')
+ buildStagingDirectory '../../../../Build/Android'
+ version '3.22.1+'
+ }
+ }
+ buildFeatures {
+ viewBinding true
+ }
+}
+
+dependencies {
+ implementation 'com.google.ar:core:1.16.0'
+ natives 'com.google.ar:core:1.16.0'
+ implementation 'androidx.appcompat:appcompat:1.6.0'
+ implementation 'com.google.android.material:material:1.7.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
+ implementation group: 'org.java-websocket', name: 'Java-WebSocket', version: '1.5.3'
+ testImplementation 'junit:junit:4.13.2'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.5'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
+}
+
+task copyScripts {
+ doLast {
+ // run copy at execution phase because npm command is not done at configuration phase
+ copy
+ {
+ from "../../../node_modules/chai"
+ include "chai.js"
+ into 'src/main/assets/Scripts'
+ }
+ copy
+ {
+ from "../../../node_modules/mocha"
+ include "mocha.js"
+ into 'src/main/assets/Scripts'
+ }
+ copy
+ {
+ from '../../Scripts'
+ include "*.js"
+ into 'src/main/assets/Scripts'
+ }
+ }
+}
+
+// Run copyScripts task after CMake external build
+// And make sure merging assets into output is performed after the scripts copy
+tasks.whenTaskAdded { task ->
+ if (task.name == 'mergeDebugNativeLibs') {
+ task.finalizedBy(copyScripts)
+ }
+ if (task.name == 'mergeDebugAssets') {
+ task.dependsOn(copyScripts)
+ }
+}
diff --git a/Apps/UnitTests/Android/app/proguard-rules.pro b/Apps/UnitTests/Android/app/proguard-rules.pro
new file mode 100644
index 000000000..481bb4348
--- /dev/null
+++ b/Apps/UnitTests/Android/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/Apps/UnitTests/Android/app/src/androidTest/java/com/babylonnative/unittests/Main.java b/Apps/UnitTests/Android/app/src/androidTest/java/com/babylonnative/unittests/Main.java
new file mode 100644
index 000000000..cff697434
--- /dev/null
+++ b/Apps/UnitTests/Android/app/src/androidTest/java/com/babylonnative/unittests/Main.java
@@ -0,0 +1,28 @@
+package com.babylonnative.unittests;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class Main {
+ @Test
+ public void javaScriptTests() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.babylonnative.unittests", appContext.getPackageName());
+
+ assertEquals(0, Native.javaScriptTests(appContext));
+ }
+}
\ No newline at end of file
diff --git a/Apps/UnitTests/Android/app/src/androidTest/java/com/babylonnative/unittests/Native.java b/Apps/UnitTests/Android/app/src/androidTest/java/com/babylonnative/unittests/Native.java
new file mode 100644
index 000000000..882ecd5d5
--- /dev/null
+++ b/Apps/UnitTests/Android/app/src/androidTest/java/com/babylonnative/unittests/Native.java
@@ -0,0 +1,12 @@
+package com.babylonnative.unittests;
+
+import android.content.Context;
+
+public class Native {
+ // JNI interface
+ static {
+ System.loadLibrary("UnitTestsJNI");
+ }
+
+ public static native int javaScriptTests(Context context);
+}
diff --git a/Apps/UnitTests/Android/app/src/main/AndroidManifest.xml b/Apps/UnitTests/Android/app/src/main/AndroidManifest.xml
new file mode 100644
index 000000000..c3537fae4
--- /dev/null
+++ b/Apps/UnitTests/Android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Apps/UnitTests/Android/app/src/main/cpp/CMakeLists.txt b/Apps/UnitTests/Android/app/src/main/cpp/CMakeLists.txt
new file mode 100644
index 000000000..aba990c52
--- /dev/null
+++ b/Apps/UnitTests/Android/app/src/main/cpp/CMakeLists.txt
@@ -0,0 +1,45 @@
+cmake_minimum_required(VERSION 3.18)
+
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+project(UnitTestsJNI)
+
+get_filename_component(UNIT_TESTS_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../.." ABSOLUTE)
+get_filename_component(REPO_ROOT_DIR "${UNIT_TESTS_DIR}/../.." ABSOLUTE)
+
+set(JSRUNTIMEHOST_TESTS OFF) # Turn off the tests folder for Android Studio path
+add_subdirectory(${REPO_ROOT_DIR} "${CMAKE_CURRENT_BINARY_DIR}/BabylonNative")
+
+npm(install "${UNIT_TESTS_DIR}/../" "UnitTests")
+
+add_library(UnitTestsJNI SHARED
+ JNI.cpp
+ ${UNIT_TESTS_DIR}/Shared/Tests.h)
+target_compile_definitions(UnitTestsJNI PRIVATE JSRUNTIMEHOST_PLATFORM="${JSRUNTIMEHOST_PLATFORM}")
+
+target_include_directories(UnitTestsJNI
+ PRIVATE ${UNIT_TESTS_DIR})
+
+target_link_libraries(UnitTestsJNI
+ PRIVATE GLESv3
+ PRIVATE android
+ PRIVATE EGL
+ PRIVATE log
+ PRIVATE -lz
+ PRIVATE AndroidExtensions
+ PRIVATE AppRuntime
+ PRIVATE Canvas
+ PRIVATE Console
+ PRIVATE GraphicsDevice
+ PRIVATE NativeCamera
+ PRIVATE NativeEngine
+ PRIVATE NativeInput
+ PRIVATE NativeOptimizations
+ #NativeXr
+ PRIVATE ScriptLoader
+ PRIVATE XMLHttpRequest
+ PRIVATE gtest_main
+ PRIVATE Window)
+
+
\ No newline at end of file
diff --git a/Apps/UnitTests/Android/app/src/main/cpp/JNI.cpp b/Apps/UnitTests/Android/app/src/main/cpp/JNI.cpp
new file mode 100644
index 000000000..815007ee4
--- /dev/null
+++ b/Apps/UnitTests/Android/app/src/main/cpp/JNI.cpp
@@ -0,0 +1,40 @@
+#include "gtest/gtest.h"
+#include
+#include
+#include
+#include
+
+#include
+
+extern "C" JNIEXPORT jint JNICALL
+Java_com_babylonnative_unittests_Native_javaScriptTests(JNIEnv* env, jclass clazz, jobject context) {
+ JavaVM* javaVM{};
+ if (env->GetJavaVM(&javaVM) != JNI_OK)
+ {
+ throw std::runtime_error{"Failed to get Java VM"};
+ }
+
+ //jclass webSocketClass{env->FindClass("com/jsruntimehost/unittests/WebSocket")};
+ //java::websocket::WebSocketClient::InitializeJavaWebSocketClass(webSocketClass, env);
+ android::global::Initialize(javaVM, context);
+
+ auto consoleCallback = [](const char* message, Babylon::Polyfills::Console::LogLevel level)
+ {
+ switch (level)
+ {
+ case Babylon::Polyfills::Console::LogLevel::Log:
+ __android_log_write(ANDROID_LOG_INFO, "JsRuntimeHost", message);
+ break;
+ case Babylon::Polyfills::Console::LogLevel::Warn:
+ __android_log_write(ANDROID_LOG_WARN, "JsRuntimeHost", message);
+ break;
+ case Babylon::Polyfills::Console::LogLevel::Error:
+ __android_log_write(ANDROID_LOG_ERROR, "JsRuntimeHost", message);
+ break;
+ }
+ };
+
+ auto testResult = Run();
+ //java::websocket::WebSocketClient::DestructJavaWebSocketClass(env);
+ return testResult;
+}
diff --git a/Apps/UnitTests/Android/app/src/main/res/values/strings.xml b/Apps/UnitTests/Android/app/src/main/res/values/strings.xml
new file mode 100644
index 000000000..18d319673
--- /dev/null
+++ b/Apps/UnitTests/Android/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ JsRuntimeHost UnitTests
+
\ No newline at end of file
diff --git a/Apps/UnitTests/Android/build.gradle b/Apps/UnitTests/Android/build.gradle
new file mode 100644
index 000000000..71b99f4ca
--- /dev/null
+++ b/Apps/UnitTests/Android/build.gradle
@@ -0,0 +1,5 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ id 'com.android.application' version '7.3.1' apply false
+ id 'com.android.library' version '7.3.1' apply false
+}
\ No newline at end of file
diff --git a/Apps/UnitTests/Android/gradle.properties b/Apps/UnitTests/Android/gradle.properties
new file mode 100644
index 000000000..3e927b11e
--- /dev/null
+++ b/Apps/UnitTests/Android/gradle.properties
@@ -0,0 +1,21 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Enables namespacing of each library's R class so that its R class includes only the
+# resources declared in the library itself and none from the library's dependencies,
+# thereby reducing the size of the R class for that library
+android.nonTransitiveRClass=true
\ No newline at end of file
diff --git a/Apps/UnitTests/Android/gradle/wrapper/gradle-wrapper.jar b/Apps/UnitTests/Android/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000..e708b1c02
Binary files /dev/null and b/Apps/UnitTests/Android/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/Apps/UnitTests/Android/gradle/wrapper/gradle-wrapper.properties b/Apps/UnitTests/Android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..806746cfe
--- /dev/null
+++ b/Apps/UnitTests/Android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Jan 20 12:19:56 PST 2023
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/Apps/UnitTests/Android/gradlew b/Apps/UnitTests/Android/gradlew
new file mode 100644
index 000000000..4f906e0c8
--- /dev/null
+++ b/Apps/UnitTests/Android/gradlew
@@ -0,0 +1,185 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/Apps/UnitTests/Android/gradlew.bat b/Apps/UnitTests/Android/gradlew.bat
new file mode 100644
index 000000000..107acd32c
--- /dev/null
+++ b/Apps/UnitTests/Android/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/Apps/UnitTests/Android/settings.gradle b/Apps/UnitTests/Android/settings.gradle
new file mode 100644
index 000000000..52ff7502b
--- /dev/null
+++ b/Apps/UnitTests/Android/settings.gradle
@@ -0,0 +1,16 @@
+pluginManagement {
+ repositories {
+ gradlePluginPortal()
+ google()
+ mavenCentral()
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+rootProject.name = "UnitTests"
+include ':app'
diff --git a/Apps/UnitTests/Apple/App.mm b/Apps/UnitTests/Apple/App.mm
index 5e6622c94..8cdce73a1 100644
--- a/Apps/UnitTests/Apple/App.mm
+++ b/Apps/UnitTests/Apple/App.mm
@@ -1,5 +1,5 @@
#include "../Shared/Tests.h"
int main() {
- return Run({{}});
+ return Run();
}
diff --git a/Apps/UnitTests/CMakeLists.txt b/Apps/UnitTests/CMakeLists.txt
index 95b502a2a..8da3fe245 100644
--- a/Apps/UnitTests/CMakeLists.txt
+++ b/Apps/UnitTests/CMakeLists.txt
@@ -40,10 +40,9 @@ target_link_to_dependencies(UnitTests
PRIVATE UrlLib
PRIVATE Window
PRIVATE XMLHttpRequest
+ PRIVATE gtest_main
${ADDITIONAL_LIBRARIES})
-add_test(NAME UnitTests COMMAND UnitTests)
-
# See https://gitlab.kitware.com/cmake/cmake/-/issues/23543
# If we can set minimum required to 3.26+, then we can use the `copy -t` syntax instead.
add_custom_command(TARGET UnitTests POST_BUILD
diff --git a/Apps/UnitTests/Shared/Tests.h b/Apps/UnitTests/Shared/Tests.h
index 8dcc5e4b2..305eae012 100644
--- a/Apps/UnitTests/Shared/Tests.h
+++ b/Apps/UnitTests/Shared/Tests.h
@@ -1,5 +1,5 @@
-#include
-#include
+#include "gtest/gtest.h"
+#include
#include
#include
#include
@@ -15,6 +15,8 @@
std::promise exitCode;
+Babylon::Graphics::Configuration deviceTestConfig{};
+
static inline constexpr const char* JS_FUNCTION_NAME{ "SetExitCode" };
void SetExitCode(const Napi::CallbackInfo& info)
{
@@ -26,30 +28,30 @@ void SetExitCode(const Napi::CallbackInfo& info)
exitCode.set_value(info[0].As().Int32Value());
}
-int Run(Babylon::Graphics::Device device)
+TEST(JSTest, Test0)
{
+ Babylon::Graphics::Device device = deviceTestConfig;
+
std::optional nativeCanvas;
Babylon::AppRuntime runtime{};
- runtime.Dispatch([&device, &nativeCanvas](Napi::Env env)
- {
+ runtime.Dispatch([&device, &nativeCanvas](Napi::Env env) {
device.AddToJavaScript(env);
Babylon::Polyfills::XMLHttpRequest::Initialize(env);
- Babylon::Polyfills::Console::Initialize(env, [](const char* message, auto)
- {
+ Babylon::Polyfills::Console::Initialize(env, [](const char* message, auto) {
printf("%s", message);
fflush(stdout);
});
Babylon::Polyfills::Window::Initialize(env);
nativeCanvas.emplace(Babylon::Polyfills::Canvas::Initialize(env));
Babylon::Plugins::NativeEngine::Initialize(env);
-
+
env.Global().Set(JS_FUNCTION_NAME, Napi::Function::New(env, SetExitCode, JS_FUNCTION_NAME));
});
Babylon::ScriptLoader loader{runtime};
- loader.Eval("global = {};", ""); // Required for Chai.js as we do not have global in Babylon Native
+ loader.Eval("global = {};", ""); // Required for Chai.js as we do not have global in Babylon Native
loader.Eval("location = { href: '' };", ""); // Required for Mocha.js as we do not have a location in Babylon Native
loader.LoadScript("app:///Scripts/babylon.max.js");
loader.LoadScript("app:///Scripts/babylonjs.materials.js");
@@ -61,5 +63,11 @@ int Run(Babylon::Graphics::Device device)
device.FinishRenderingCurrentFrame();
auto code{exitCode.get_future().get()};
- return code;
+ EXPECT_EQ(code, 0);
+}
+
+int Run()
+{
+ testing::InitGoogleTest();
+ return RUN_ALL_TESTS();
}
diff --git a/Apps/UnitTests/Win32/App.cpp b/Apps/UnitTests/Win32/App.cpp
index 7006a831b..67aaa6259 100644
--- a/Apps/UnitTests/Win32/App.cpp
+++ b/Apps/UnitTests/Win32/App.cpp
@@ -13,9 +13,8 @@ int main() {
::RegisterClassEx(&wc);
HWND hwnd = ::CreateWindow(wc.lpszClassName, "BabylonNative", WS_OVERLAPPEDWINDOW, -1, -1, -1, -1, NULL, NULL, wc.hInstance, NULL);
- Babylon::Graphics::Configuration config{};
- config.Window = hwnd;
- config.Width = 600;
- config.Height = 400;
- return Run({config});
+ deviceTestConfig.Window = hwnd;
+ deviceTestConfig.Width = 600;
+ deviceTestConfig.Height = 400;
+ return Run();
}
diff --git a/Apps/UnitTests/X11/App.cpp b/Apps/UnitTests/X11/App.cpp
index f7467ae8e..98e230045 100644
--- a/Apps/UnitTests/X11/App.cpp
+++ b/Apps/UnitTests/X11/App.cpp
@@ -1,3 +1,4 @@
+#include "gtest/gtest.h"
#define XK_MISCELLANY
#define XK_LATIN1
#include // will include X11 which #defines None... Don't mess with order of includes.
@@ -42,9 +43,8 @@ int main()
XMapWindow(display, window);
XStoreName(display, window, applicationName);
- Babylon::Graphics::Configuration graphicsConfig{};
- graphicsConfig.Window = window;
- graphicsConfig.Width = static_cast(width);
- graphicsConfig.Height = static_cast(height);
- return Run({graphicsConfig});
+ deviceTestConfig.Window = window;
+ deviceTestConfig.Width = static_cast(width);
+ deviceTestConfig.Height = static_cast(height);
+ return Run();
}
\ No newline at end of file
diff --git a/BUILDING.md b/BUILDING.md
index e1c45f6d2..823585d4d 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -16,14 +16,6 @@ Babylon Native makes extensive use of submodules for dependencies.
git clone --recursive https://github.com/BabylonJS/BabylonNative.git
```
-Babylon Native requires Babylon.js. You will need to install NPM packages to resolve these dependencies. From the root
-of the repository on the command line, run the following commands:
-
-```
-cd Apps
-npm install
-```
-
Babylon Native's build system is based on CMake, which customarily uses a separate
build directory. Build directory location is up to you, but we highly recommend using
the `build` directory from the repository root. The `.gitignore` file is set up to
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ad3b0a168..8d2b8e501 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,21 +2,32 @@
cmake_minimum_required(VERSION 3.18)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-# CMakeExtensions
include(FetchContent)
+
+# Modules declaration
FetchContent_Declare(cmake-extensions
GIT_REPOSITORY https://github.com/BabylonJS/CMakeExtensions.git
GIT_TAG 7bdd0664181ce3d90dc94474464cea9b25b22db7)
-message(STATUS "Fetching cmake-extensions")
-FetchContent_MakeAvailable(cmake-extensions)
-message(STATUS "Fetching cmake-extensions - done")
-
-# JSRuntime Host
+FetchContent_Declare(ios-cmake
+ GIT_REPOSITORY https://github.com/leetal/ios-cmake.git
+ GIT_TAG 04d91f6675dabb3c97df346a32f6184b0a7ef845)
FetchContent_Declare(jsruntimehost
GIT_REPOSITORY https://github.com/BabylonJS/JsRuntimeHost.git
- GIT_TAG 7d4c1966b54dca290be44646998cbeec431fca50)
+ GIT_TAG d1667b827c5b80c07c959780e582ea0d9a11c0ad)
+FetchContent_Declare(AndroidExtensions
+ GIT_REPOSITORY https://github.com/BabylonJS/AndroidExtensions.git
+ GIT_TAG 883c4a286116e51ee989e39ee8e216d632997329)
set(JSRUNTIMEHOST_TESTS OFF)
-FetchContent_MakeAvailable(jsruntimehost)
+
+set(CONTENT_TO_FETCH cmake-extensions jsruntimehost)
+
+if(IOS)
+ FetchContent_MakeAvailable(ios-cmake)
+ set(CMAKE_TOOLCHAIN_FILE "${ios-cmake_SOURCE_DIR}/ios.toolchain.cmake" CACHE PATH "")
+ set(PLATFORM "OS64COMBINED" CACHE STRING "")
+ set(DEPLOYMENT_TARGET "12" CACHE STRING "")
+ set(ENABLE_ARC OFF CACHE STRING "Enables or disables ARC support.")
+endif()
project(BabylonNative)
@@ -54,6 +65,7 @@ endif()
# Setting Platform
if(ANDROID)
set(BABYLON_NATIVE_PLATFORM "Android")
+ set(CONTENT_TO_FETCH ${CONTENT_TO_FETCH} AndroidExtensions)
elseif(IOS)
set(BABYLON_NATIVE_PLATFORM "iOS")
elseif(APPLE)
@@ -68,6 +80,14 @@ else()
message(FATAL_ERROR "Unrecognized platform: ${CMAKE_SYSTEM_NAME}")
endif()
+if(NOT WINDOWS_STORE)
+ FetchContent_Declare(googletest
+ URL "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz")
+ # For Windows: Prevent overriding the parent project's compiler/linker settings
+ set(gtest_force_shared_crt OFF CACHE BOOL "" FORCE)
+ FetchContent_MakeAvailable(googletest)
+endif()
+
# Setting Graphics API
if(APPLE)
set(GRAPHICS_API Metal)
@@ -89,6 +109,11 @@ elseif(WIN32)
endif()
endif()
+# Fetching content
+message(STATUS "Fetching dependencies for ${PROJECT_NAME} (${CONTENT_TO_FETCH})")
+FetchContent_MakeAvailable(${CONTENT_TO_FETCH})
+message(STATUS "Fetching dependencies for ${PROJECT_NAME} - done")
+
if(APPLE)
set(BABYLON_NATIVE_PLATFORM_IMPL_EXT "mm")
set_property(TARGET JsRuntime PROPERTY UNITY_BUILD false)
diff --git a/Install/Install.cmake b/Install/Install.cmake
index 731adfa97..77b9ec301 100644
--- a/Install/Install.cmake
+++ b/Install/Install.cmake
@@ -43,9 +43,13 @@ if(TARGET openxr_loader)
install_targets(openxr_loader)
endif()
-## napi
-install_include(Dependencies/napi/napi-direct/include/napi)
-install_targets(napi)
+#install_targets(Node-API)
+#install_include(${jsruntimehost_SOURCE_DIR}/Core/Node-API/Include)
+
+#if(TARGET Node-API-JSI)
+ #install_targets(Node-API-JSI)
+ #install_include(${jsruntimehost_SOURCE_DIR}/Core/Node-API-JSI/Include)
+#endif()
## UrlLib
install_targets(UrlLib)
@@ -53,9 +57,8 @@ install_targets(UrlLib)
# ----------------
# Core
# ----------------
-
install_targets(JsRuntime)
-install_include(Core/JsRuntime/Include/Babylon)
+install_include(${jsruntimehost_SOURCE_DIR}/Core/JsRuntime/Include/Babylon)
install_targets(Graphics)
install_include(Core/Graphics/Include/Platform/${BABYLON_NATIVE_PLATFORM}/Babylon)
@@ -64,12 +67,12 @@ install_include(Core/Graphics/Include/Shared/Babylon)
if(TARGET AppRuntime)
install_targets(AppRuntime)
- install_include(Core/AppRuntime/Include/Babylon)
+ install_include(${jsruntimehost_SOURCE_DIR}/Core/AppRuntime/Include/Babylon)
endif()
if(TARGET ScriptLoader)
install_targets(ScriptLoader)
- install_include(Core/ScriptLoader/Include/Babylon)
+ install_include(${jsruntimehost_SOURCE_DIR}/Core/ScriptLoader/Include/Babylon)
endif()
# ----------------
@@ -126,7 +129,7 @@ endif()
if(TARGET Console)
install_targets(Console)
- install_include(Polyfills/Console/Include/Babylon)
+ install_include(${jsruntimehost_SOURCE_DIR}/Polyfills/Console/Include/Babylon)
endif()
if(TARGET Window)
@@ -136,5 +139,5 @@ endif()
if(TARGET XMLHttpRequest)
install_targets(XMLHttpRequest)
- install_include(Polyfills/XMLHttpRequest/Include/Babylon)
+ install_include(${jsruntimehost_SOURCE_DIR}/Polyfills/XMLHttpRequest/Include/Babylon)
endif()
\ No newline at end of file
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 7ae180053..83fdc88cd 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -14,25 +14,25 @@ variables:
jobs:
# Apple
- - template: .github/jobs/macos.yml
- parameters:
- name: MacOS_Xcode1341
- vmImage: 'macOS-latest'
- xCodeVersion: 13.4.1
-
- - template: .github/jobs/ios.yml
- parameters:
- name: iOS_Xcode1341_iOS155
- vmImage: 'macOS-latest'
- xCodeVersion: 13.4.1
- deploymentTarget: 15.5
-
- - template: .github/jobs/ios.yml
- parameters:
- name: iOS_Xcode142_iOS162
- vmImage: 'macOS-latest'
- xCodeVersion: 14.2
- deploymentTarget: 16.2
+# - template: .github/jobs/macos.yml
+# parameters:
+# name: MacOS_Xcode1341
+# vmImage: 'macOS-latest'
+# xCodeVersion: 13.4.1
+#
+# - template: .github/jobs/ios.yml
+# parameters:
+# name: iOS_Xcode1341_iOS155
+# vmImage: 'macOS-latest'
+# xCodeVersion: 13.4.1
+# deploymentTarget: 15.5
+#
+# - template: .github/jobs/ios.yml
+# parameters:
+# name: iOS_Xcode142_iOS162
+# vmImage: 'macOS-latest'
+# xCodeVersion: 14.2
+# deploymentTarget: 16.2
# WIN32
- template: .github/jobs/win32.yml
@@ -56,67 +56,79 @@ jobs:
graphics_api: D3D12
# UWP
- - template: .github/jobs/uwp.yml
- parameters:
- name: UWP_x64
- vmImage: 'windows-latest'
- platform: x64
-
- - template: .github/jobs/uwp.yml
- parameters:
- name: UWP_arm64
- vmImage: 'windows-latest'
- platform: arm64
-
- - template: .github/jobs/uwp.yml
- parameters:
- name: UWP_arm64_JSI
- vmImage: 'windows-latest'
- platform: arm64
- napiType: jsi
+# - template: .github/jobs/uwp.yml
+# parameters:
+# name: UWP_x64
+# vmImage: 'windows-latest'
+# platform: x64
+#
+# - template: .github/jobs/uwp.yml
+# parameters:
+# name: UWP_arm64
+# vmImage: 'windows-latest'
+# platform: arm64
+#
+# - template: .github/jobs/uwp.yml
+# parameters:
+# name: UWP_arm64_JSI
+# vmImage: 'windows-latest'
+# platform: arm64
+# napiType: jsi
# Ubuntu/Linux
# TODO: v8 is incompatible with curl for some reason
# See https://github.com/BabylonJS/BabylonNative/issues/1190
- - template: .github/jobs/linux.yml
- parameters:
- name: Ubuntu_Clang_JavaScriptCore
- vmImage: 'ubuntu-latest'
- CC: clang
- CXX: clang++
- JSEngine: JavaScriptCore
-
- - template: .github/jobs/linux.yml
- parameters:
- name: Ubuntu_GCC_JavaScriptCore
- vmImage: 'ubuntu-latest'
- CC: gcc
- CXX: g++
- JSEngine: JavaScriptCore
-
+# - template: .github/jobs/linux.yml
+# parameters:
+# name: Ubuntu_Clang_JavaScriptCore
+# vmImage: 'ubuntu-latest'
+# CC: clang
+# CXX: clang++
+# JSEngine: JavaScriptCore
+#
+# - template: .github/jobs/linux.yml
+# parameters:
+# name: Ubuntu_GCC_JavaScriptCore
+# vmImage: 'ubuntu-latest'
+# CC: gcc
+# CXX: g++
+# JSEngine: JavaScriptCore
+#
# Android
- template: .github/jobs/android.yml
parameters:
name: Android_Ubuntu_JSC
vmImage: 'ubuntu-latest'
- JSEngine: jsc
+ JSEngine: JavaScriptCore
- template: .github/jobs/android.yml
parameters:
name: Android_Ubuntu_V8
vmImage: 'ubuntu-latest'
- JSEngine: v8android
+ JSEngine: V8
- template: .github/jobs/android.yml
parameters:
name: Android_MacOS_JSC
vmImage: 'macOS-latest'
- JSEngine: jsc
+ JSEngine: JavaScriptCore
- template: .github/jobs/android.yml
parameters:
name: Android_MacOS_V8
vmImage: 'macOS-latest'
- JSEngine: v8android
\ No newline at end of file
+ JSEngine: V8
+
+ - template: .github/jobs/android_tests.yml
+ parameters:
+ name: Android_Tests_MacOS_JSC
+ vmImage: 'macOS-latest'
+ JSEngine: JavaScriptCore
+
+ - template: .github/jobs/android_tests.yml
+ parameters:
+ name: Android_Tests_MacOS_V8
+ vmImage: 'macOS-latest'
+ JSEngine: V8