diff --git a/.github/release.yml b/.github/release.yml index d62e3abfe..844aec8c8 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -11,6 +11,18 @@ changelog: - title: Exciting New Features 🎉 labels: - enhancement + - title: Dependencies + labels: + - dependencies + - title: Espresso test + labels: + - Espresso + - title: Bug fix + labels: + - bugfix + - title: Pipeline + labels: + - pipeline - title: Other Changes labels: - "*" \ No newline at end of file diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml deleted file mode 100644 index cc2f3abf1..000000000 --- a/.github/workflows/gradle-wrapper-validation.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: "Gradle Wrapper" - -on: - pull_request: - branches: - - main - -jobs: - validation: - name: "Validate" - runs-on: ubuntu-latest - defaults: - run: - working-directory: ${{ matrix.example }} - strategy: - matrix: - example: [ android ] - steps: - - uses: actions/checkout@v4.2.0 - - uses: gradle/wrapper-validation-action@v3 \ No newline at end of file diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9037206ce..ffd835937 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - develop pull_request: jobs: @@ -20,6 +21,12 @@ jobs: - name: assemble ViroCore run: | ./gradlew :viroreact:assembleDebug + ./gradlew :code-samples:ARPlacingObjects:assembleDebug + ./gradlew :code-samples:ARRetail:assembleDebug + ./gradlew :code-samples:ARTesla:assembleDebug + ./gradlew :code-samples:ARHelloWorldAndroid:assembleDebug + ./gradlew :code-samples:ARBlackPanther:assembleDebug + ./gradlew :mainSample:assembleDebug working-directory: ./android - name: Upload result ViroCore uses: actions/upload-artifact@v4.4.0 @@ -46,6 +53,7 @@ jobs: with: distribution: "adopt" java-version: 17 + - uses: gradle/wrapper-validation-action@v3 - name: Code checks run: ./gradlew :viroreact:check - name: Archive Lint report @@ -62,9 +70,11 @@ jobs: strategy: fail-fast: false matrix: - xcode: ["14.2.0", "13.4.1"] - macOS: ["macos-12"] + macOS: [ "macos-13" ] + xcode: [ "15.2.0" ] steps: + - name: Investigate available XCode versions + run: ls -n /Applications/ | grep Xcode* - uses: actions/checkout@v4.2.0 - name: Install gpg run: brew install gnupg diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 10a916d7a..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,52 +0,0 @@ -pipeline { - agent any - stages { - stage('initial_setup') { - steps { - sh '''cd android - fastlane clean_old_artifacts - fastlane save_git_log''' - } - } - stage('viroreact_aar') { - steps { - sh '''cd android - fastlane virorenderer_viroreact_aar''' - } - } - stage('virocore_aar') { - steps { - sh '''cd android - fastlane virorenderer_virocore_aar''' - } - } - stage('virokit_framework (ios)') { - steps { - sh '''cd ios - fastlane virorender_viroreact_virokit - fastlane virorender_viroreact_virokit_static_lib''' - } - } - stage('releasetest') { - steps { - sh '''cd android -fastlane renderer_releasetest''' - } - } - stage('memoryleaktest') { - steps { - sh '''cd android -fastlane renderer_memoryleaktest''' - } - } - stage('start react-viro') { - steps { - build(job: 'react-viro/'+env.BRANCH_NAME, propagate: true, wait: true) - } - } - } - environment { - LC_ALL = 'en_US.UTF-8' - LANG = 'en_US.UTF-8' - } -} diff --git a/android/code-samples/ARBlackPanther/build.gradle b/android/code-samples/ARBlackPanther/build.gradle index 5ebc5c492..5c9b5b97e 100644 --- a/android/code-samples/ARBlackPanther/build.gradle +++ b/android/code-samples/ARBlackPanther/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 33 + compileSdkVersion 34 namespace "com.example.virosample.blackPanther" defaultConfig { minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' ndkVersion = "25.2.9519653" ndk { diff --git a/android/code-samples/ARHelloWorldAndroid/build.gradle b/android/code-samples/ARHelloWorldAndroid/build.gradle index 50fb1d226..5f8921821 100644 --- a/android/code-samples/ARHelloWorldAndroid/build.gradle +++ b/android/code-samples/ARHelloWorldAndroid/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 33 + compileSdkVersion 34 namespace "com.example.virosample.hello" defaultConfig { minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' ndkVersion = "25.2.9519653" ndk { diff --git a/android/code-samples/ARPlacingObjects/build.gradle b/android/code-samples/ARPlacingObjects/build.gradle index 5322f9d51..b479774a3 100644 --- a/android/code-samples/ARPlacingObjects/build.gradle +++ b/android/code-samples/ARPlacingObjects/build.gradle @@ -2,19 +2,22 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 33 + compileSdkVersion 34 namespace "com.example.virosample.placingObjects" defaultConfig { minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' ndkVersion = "25.2.9519653" ndk { abiFilters "arm64-v8a", "armeabi-v7a", "x86", "armeabi", "mips" } } - + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } lintOptions { disable 'UsingOnClickInXml' } diff --git a/android/code-samples/ARRetail/build.gradle b/android/code-samples/ARRetail/build.gradle index 250458f25..a2f028b59 100644 --- a/android/code-samples/ARRetail/build.gradle +++ b/android/code-samples/ARRetail/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 33 + compileSdkVersion 34 namespace "com.example.virosample.retail" defaultConfig { minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' ndkVersion = "25.2.9519653" ndk { diff --git a/android/code-samples/ARTesla/build.gradle b/android/code-samples/ARTesla/build.gradle index 469b61c2f..02df916cf 100644 --- a/android/code-samples/ARTesla/build.gradle +++ b/android/code-samples/ARTesla/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 33 + compileSdkVersion 34 namespace "com.example.virosample.tesla" defaultConfig { minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' ndkVersion = "25.2.9519653" ndk { diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar index f6b961fd5..a4b76b953 100644 Binary files a/android/gradle/wrapper/gradle-wrapper.jar and b/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 27313fbc8..df97d72b8 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew index 3e84efe61..f5feea6d6 100755 --- a/android/gradlew +++ b/android/gradlew @@ -1,78 +1,130 @@ -#!/usr/bin/env sh +#!/bin/sh + +# +# Copyright © 2015-2021 the original 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # 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 +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac 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"' +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # 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 - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | 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" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -81,92 +133,120 @@ 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. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + 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 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 +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac 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 +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; 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\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg 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" +# 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"' -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" fi +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + exec "$JAVACMD" "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat index ac1b06f93..9b42019c7 100644 --- a/android/gradlew.bat +++ b/android/gradlew.bat @@ -13,8 +13,10 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +27,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 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. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -56,11 +59,11 @@ 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. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 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 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/android/mainSample/build.gradle b/android/mainSample/build.gradle index b1e37ba40..6f2194265 100644 --- a/android/mainSample/build.gradle +++ b/android/mainSample/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { - compileSdkVersion 33 + compileSdkVersion 34 namespace "com.example.virosample" buildFeatures { buildConfig = true @@ -11,12 +11,12 @@ android { defaultConfig { applicationId "com.example.virosample" minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 - // versionCode getGitCommitCount() - // versionName getTag() + versionCode getGitCommitCount() + versionName getTag() buildConfigField "String", 'GIT_REPOSITORY', "\"" + getGitOriginRemote() + "\"" - buildConfigField "String", 'VERSION', "\"" + versionName + "\"" + buildConfigField "String", 'VERSION', "\"" + getTag() + "\"" } buildTypes { @@ -28,7 +28,10 @@ android { applicationIdSuffix ".debug" } } - + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } packagingOptions { exclude "META-INF/*.kotlin_module" } @@ -64,18 +67,8 @@ dependencies { } static def getTag() { - def tagVersion = "$System.env.TAG_VERSION" - if (tagVersion == "null") { - println "No variable TAG_VERSION specified, I'm using 'git describe --abbrev=0'" - def process = "git describe --abbrev=0".execute() - tagVersion = process.text.toString().trim() - if (tagVersion.equals("")) { - println "abbrev failed, I'm using 'git --tags'" - def processT = "git describe --tags".execute() - tagVersion = processT.text.toString().trim() - } - } - return tagVersion + def process = "git describe --tags --abbrev=0".execute() + return process.text.toString().trim() } static def getGitCommitCount() { diff --git a/android/mainSample/src/main/java/com/example/virosample/SystemInfoFragment.kt b/android/mainSample/src/main/java/com/example/virosample/SystemInfoFragment.kt index 26580be33..de2f3d985 100644 --- a/android/mainSample/src/main/java/com/example/virosample/SystemInfoFragment.kt +++ b/android/mainSample/src/main/java/com/example/virosample/SystemInfoFragment.kt @@ -16,7 +16,7 @@ class SystemInfoFragment : PreferenceFragmentCompat() { addPreferencesFromResource(R.xml.prefs) // TODO after next release you can use info from library //findPreference(PREFERENCE_ + "APPVERSION")?.summary = com.viro.renderer.BuildConfig.VIRO_VERSION - findPreference(PREFERENCE_ + "APPVERSION")?.summary = BuildConfig.VERSION_NAME + findPreference(PREFERENCE_ + "APPVERSION")?.summary = BuildConfig.VERSION findPreference(PREFERENCE_ + "APPVERSION")?.title = "${findPreference(PREFERENCE_ + "APPVERSION")?.title} [${BuildConfig.FLAVOR}]" findPreference(PREFERENCE_ + "BOARD")?.summary = Build.BOARD diff --git a/android/memoryleaktest/build.gradle b/android/memoryleaktest/build.gradle index f0efeef4e..25b48e074 100644 --- a/android/memoryleaktest/build.gradle +++ b/android/memoryleaktest/build.gradle @@ -8,11 +8,11 @@ android { buildConfig = true } - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { applicationId "com.example.memoryleaktest" minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 versionName "1.0" diff --git a/android/nativetest/build.gradle b/android/nativetest/build.gradle index aba59a414..f8da0a23f 100644 --- a/android/nativetest/build.gradle +++ b/android/nativetest/build.gradle @@ -6,12 +6,12 @@ android { buildFeatures { buildConfig = true } - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { applicationId "com.viro.nativetest" minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 versionName "1.0" missingDimensionStrategy 'product', 'viro_core' diff --git a/android/releasetest/build.gradle b/android/releasetest/build.gradle index f16616fa0..83b531922 100644 --- a/android/releasetest/build.gradle +++ b/android/releasetest/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'kotlin-android' android { flavorDimensions "target_platform" namespace "com.viromedia.releasetest" - compileSdkVersion 33 + compileSdkVersion 34 buildFeatures { buildConfig = true } @@ -12,7 +12,7 @@ android { defaultConfig { applicationId "com.viromedia.releasetest" minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 versionName "1.0" diff --git a/android/renderertest/build.gradle b/android/renderertest/build.gradle index d8c3ea153..b79ea36f6 100644 --- a/android/renderertest/build.gradle +++ b/android/renderertest/build.gradle @@ -6,12 +6,12 @@ android { buildFeatures { buildConfig = true } - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { applicationId "com.viromedia.renderertest" minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 versionName "1.0" missingDimensionStrategy 'product', 'viro_core' diff --git a/android/sharedCode/build.gradle b/android/sharedCode/build.gradle index 37d9b1d1e..aa388d279 100644 --- a/android/sharedCode/build.gradle +++ b/android/sharedCode/build.gradle @@ -13,11 +13,11 @@ android { buildFeatures { buildConfig = true } - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 ndkVersion = "25.2.9519653" ndk { diff --git a/android/sharedCode/src/androidTest/java/com/viro/renderer/ExampleInstrumentedTest.java b/android/sharedCode/src/androidTest/java/com/viro/renderer/ExampleInstrumentedTest.java deleted file mode 100644 index 2a453daf6..000000000 --- a/android/sharedCode/src/androidTest/java/com/viro/renderer/ExampleInstrumentedTest.java +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright (c) 2017-present, ViroMedia, Inc. -// All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -package com.viro.renderer; - -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.*; - -/** - * Instrumentation test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - @Test - public void useAppContext() throws Exception { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); - - assertEquals("com.viro.renderer", appContext.getPackageName()); - } -} diff --git a/android/viroar/build.gradle b/android/viroar/build.gradle index 6f2a2cc67..9f56cf194 100644 --- a/android/viroar/build.gradle +++ b/android/viroar/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'maven-publish' android { - compileSdkVersion 33 + compileSdkVersion 34 namespace "com.viro.ar" compileOptions { @@ -12,7 +12,7 @@ android { defaultConfig { minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 ndkVersion = "25.2.9519653" ndk { diff --git a/android/viroar/src/main/AndroidManifest.xml b/android/viroar/src/main/AndroidManifest.xml index f89c05f14..94cbbcfc3 100644 --- a/android/viroar/src/main/AndroidManifest.xml +++ b/android/viroar/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/android/virocore/build.gradle b/android/virocore/build.gradle index 863343183..51a043db7 100644 --- a/android/virocore/build.gradle +++ b/android/virocore/build.gradle @@ -3,7 +3,7 @@ apply from: 'preprocessor.gradle' apply plugin: 'maven-publish' android { - compileSdkVersion 33 + compileSdkVersion 34 namespace "com.viro.virocore" buildFeatures { buildConfig = true @@ -15,7 +15,7 @@ android { } defaultConfig { minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 ndkVersion = "25.2.9519653" ndk { diff --git a/android/viroreact/build.gradle b/android/viroreact/build.gradle index 5e0efe6fe..0e5e1f304 100644 --- a/android/viroreact/build.gradle +++ b/android/viroreact/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'maven-publish' android { - compileSdkVersion 33 + compileSdkVersion 34 namespace "com.viro.viroreact" buildFeatures { buildConfig = true @@ -14,7 +14,7 @@ android { defaultConfig { minSdkVersion 24 - targetSdkVersion 33 + targetSdkVersion 34 ndkVersion = "25.2.9519653" ndk { diff --git a/jitpack.yml b/jitpack.yml index fa984b80d..506bbd03d 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,5 +1,5 @@ jdk: - - openjdk11 + - openjdk17 install: - cd android - ./gradlew :virocore:assembleRelease :virocore:publishToMavenLocal