From 292602afd7c3ecd844ee9ca03f767ff1bd8c3dff Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 14 Feb 2019 12:55:28 -0800 Subject: [PATCH] Resolving more master differences --- android/build.gradle | 122 +++++++++++++++++- android/settings.gradle | 12 +- interface/resources/qml/Web3DSurface.qml | 75 +++-------- .../resources/qml/hifi/tablet/TabletMenu.qml | 1 + interface/src/ui/Keyboard.cpp | 3 +- .../animation/src/AnimInverseKinematics.cpp | 4 + .../src/ConsoleScriptingInterface.cpp | 12 -- libraries/shaders/src/shaders/Shaders.cpp | 2 +- libraries/ui/src/QmlFragmentClass.cpp | 3 +- 9 files changed, 151 insertions(+), 83 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index eebe7bdc27..5a4dbc0033 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,15 +1,29 @@ +import de.undercouch.gradle.tasks.download.Download +import de.undercouch.gradle.tasks.download.Verify +import groovy.io.FileType +import groovy.json.JsonSlurper +import groovy.xml.XmlUtil import org.apache.tools.ant.taskdefs.condition.Os +import java.util.regex.Matcher +import java.util.regex.Pattern + buildscript { repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.0' + classpath 'com.android.tools.build:gradle:3.2.1' } } +plugins { + id 'de.undercouch.download' version '3.3.0' + id "cz.malohlava" version "1.0.3" + id "io.github.http-builder-ng.http-plugin" version "0.1.1" +} + allprojects { repositories { google() @@ -18,6 +32,10 @@ allprojects { } } +task clean(type: Delete) { + delete rootProject.buildDir +} + ext { RELEASE_NUMBER = project.hasProperty('RELEASE_NUMBER') ? project.getProperty('RELEASE_NUMBER') : '0' VERSION_CODE = project.hasProperty('VERSION_CODE') ? project.getProperty('VERSION_CODE') : '0' @@ -126,6 +144,108 @@ task setupDependencies() { task cleanDependencies(type: Delete) { } +def runBreakpadDumpSyms = { buildType -> + gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS + + def objDir = new File("${appDir}/build/intermediates/cmake/${buildType}/obj/arm64-v8a") + def stripDebugSymbol = "${appDir}/build/intermediates/transforms/stripDebugSymbol/${buildType}/0/lib/arm64-v8a/" + def outputDir = new File(breakpadDumpSymsDir, buildType) + if (!outputDir.exists()) { + outputDir.mkdirs() + } + + objDir.eachFileRecurse (FileType.FILES) { file -> + if (file.name.endsWith('.so')) { + def output = file.name + ".sym" + def cmdArgs = [ + file.toString(), + stripDebugSymbol + ] + def result = exec { + workingDir HIFI_ANDROID_PRECOMPILED + '/breakpad/bin' + commandLine './dump_syms' + args cmdArgs + ignoreExitValue true + standardOutput = new BufferedOutputStream(new FileOutputStream(new File(outputDir, output))) + } + } + } +} + +task runBreakpadDumpSymsDebug() { + doLast { + runBreakpadDumpSyms("debug"); + } +} + +task runBreakpadDumpSymsRelease() { + doLast { + runBreakpadDumpSyms("release"); + } +} + +task zipDumpSymsDebug(type: Zip, dependsOn: runBreakpadDumpSymsDebug) { + from (new File(breakpadDumpSymsDir, "debug").absolutePath) + archiveName "symbols-${RELEASE_NUMBER}-debug.zip" + destinationDir(new File("${appDir}/build/tmp/")) +} + +task zipDumpSymsRelease(type: Zip, dependsOn: runBreakpadDumpSymsRelease) { + from (new File(breakpadDumpSymsDir, "release").absolutePath) + archiveName "symbols-${RELEASE_NUMBER}-release.zip" + destinationDir(new File("${appDir}/build/tmp/")) +} + +task uploadBreakpadDumpSymsDebug(type:io.github.httpbuilderng.http.HttpTask, dependsOn: zipDumpSymsDebug) { + onlyIf { + System.getenv("CMAKE_BACKTRACE_URL") && System.getenv("CMAKE_BACKTRACE_SYMBOLS_TOKEN") + } + config { + request.uri = System.getenv("CMAKE_BACKTRACE_URL") + } + post { + request.uri.path = '/post' + request.uri.query = [format: 'symbols', token: System.getenv("CMAKE_BACKTRACE_SYMBOLS_TOKEN")] + request.body = new File("${appDir}/build/tmp/", "symbols-${RELEASE_NUMBER}-debug.zip").bytes + request.contentType = 'application/octet-stream' + response.success { + println ("${appDir}/build/tmp/symbols-${RELEASE_NUMBER}-debug.zip uploaded") + } + } +} + +task uploadBreakpadDumpSymsRelease(type:io.github.httpbuilderng.http.HttpTask, dependsOn: zipDumpSymsRelease) { + onlyIf { + System.getenv("CMAKE_BACKTRACE_URL") && System.getenv("CMAKE_BACKTRACE_SYMBOLS_TOKEN") + } + config { + request.uri = System.getenv("CMAKE_BACKTRACE_URL") + } + post { + request.uri.path = '/post' + request.uri.query = [format: 'symbols', token: System.getenv("CMAKE_BACKTRACE_SYMBOLS_TOKEN")] + request.body = new File("${appDir}/build/tmp/", "symbols-${RELEASE_NUMBER}-release.zip").bytes + request.contentType = 'application/octet-stream' + response.success { + println ("${appDir}/build/tmp/symbols-${RELEASE_NUMBER}-release.zip uploaded") + } + } +} + +task renameHifiACTaskDebug() { + doLast { + def sourceFile = new File("${appDir}/build/intermediates/cmake/debug/obj/arm64-v8a/","libhifiCodec.so") + def destinationFile = new File("${appDir}/src/main/jniLibs/arm64-v8a", "libplugins_libhifiCodec.so") + copy { from sourceFile; into destinationFile.parent; rename(sourceFile.name, destinationFile.name) } + } +} +task renameHifiACTaskRelease(type: Copy) { + doLast { + def sourceFile = new File("${appDir}/build/intermediates/cmake/release/obj/arm64-v8a/","libhifiCodec.so") + def destinationFile = new File("${appDir}/src/main/jniLibs/arm64-v8a", "libplugins_libhifiCodec.so") + copy { from sourceFile; into destinationFile.parent; rename(sourceFile.name, destinationFile.name) } + } +} // FIXME this code is prototyping the desired functionality for doing build time binary dependency resolution. // See the comment on the qtBundle task above diff --git a/android/settings.gradle b/android/settings.gradle index 23e54b0457..64eb246719 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -12,8 +12,8 @@ project(':qt').projectDir = new File(settingsDir, 'libraries/qt') // Applications // -//include ':interface' -//project(':interface').projectDir = new File(settingsDir, 'apps/interface') +include ':interface' +project(':interface').projectDir = new File(settingsDir, 'apps/interface') include ':questInterface' project(':questInterface').projectDir = new File(settingsDir, 'apps/questInterface') @@ -22,8 +22,8 @@ project(':questInterface').projectDir = new File(settingsDir, 'apps/questInterfa // Test projects // -//include ':framePlayer' -//project(':framePlayer').projectDir = new File(settingsDir, 'apps/framePlayer') +include ':framePlayer' +project(':framePlayer').projectDir = new File(settingsDir, 'apps/framePlayer') -//include ':questFramePlayer' -//project(':questFramePlayer').projectDir = new File(settingsDir, 'apps/questFramePlayer') +include ':questFramePlayer' +project(':questFramePlayer').projectDir = new File(settingsDir, 'apps/questFramePlayer') diff --git a/interface/resources/qml/Web3DSurface.qml b/interface/resources/qml/Web3DSurface.qml index 4281755447..fdd5d8a7c6 100644 --- a/interface/resources/qml/Web3DSurface.qml +++ b/interface/resources/qml/Web3DSurface.qml @@ -1,7 +1,7 @@ // // Web3DOverlay.qml // -// Created by Gabriel Calero & Cristian Duarte on Jun 22, 2018 +// Created by David Rowe on 16 Dec 2016. // Copyright 2016 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. @@ -9,68 +9,23 @@ // import QtQuick 2.5 -import QtGraphicalEffects 1.0 -Item { +import "controls" as Controls - property string url - RadialGradient { - anchors.fill: parent - gradient: Gradient { - GradientStop { position: 0.0; color: "#262626" } - GradientStop { position: 1.0; color: "#000000" } +Controls.WebView { + + // This is for JS/QML communication, which is unused in a Web3DOverlay, + // but not having this here results in spurious warnings about a + // missing signal + signal sendToScript(var message); + + function onWebEventReceived(event) { + if (event.slice(0, 17) === "CLARA.IO DOWNLOAD") { + ApplicationInterface.addAssetToWorldFromURL(event.slice(18)); } } - function shortUrl(url) { - var hostBegin = url.indexOf("://"); - if (hostBegin > -1) { - url = url.substring(hostBegin + 3); - } - - var portBegin = url.indexOf(":"); - if (portBegin > -1) { - url = url.substring(0, portBegin); - } - - var pathBegin = url.indexOf("/"); - if (pathBegin > -1) { - url = url.substring(0, pathBegin); - } - - if (url.length > 45) { - url = url.substring(0, 45); - } - - return url; + Component.onCompleted: { + eventBridge.webEventReceived.connect(onWebEventReceived); } - - Text { - id: urlText - text: shortUrl(url) - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - anchors.fill: parent - anchors.rightMargin: 10 - anchors.leftMargin: 10 - font.family: "Cairo" - font.weight: Font.DemiBold - font.pointSize: 48 - fontSizeMode: Text.Fit - color: "#FFFFFF" - minimumPixelSize: 5 - } - - Image { - id: hand - source: "../../icons/hand.svg" - width: 300 - height: 300 - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.bottomMargin: 100 - anchors.rightMargin: 100 - } - - -} \ No newline at end of file +} diff --git a/interface/resources/qml/hifi/tablet/TabletMenu.qml b/interface/resources/qml/hifi/tablet/TabletMenu.qml index 7170fcdf5f..5f06e4fbab 100644 --- a/interface/resources/qml/hifi/tablet/TabletMenu.qml +++ b/interface/resources/qml/hifi/tablet/TabletMenu.qml @@ -3,6 +3,7 @@ import QtGraphicalEffects 1.0 import QtQuick.Controls 1.4 import QtQml 2.2 + import "." import stylesUit 1.0 import "../../controls" diff --git a/interface/src/ui/Keyboard.cpp b/interface/src/ui/Keyboard.cpp index 9dd233b85b..9e9a319802 100644 --- a/interface/src/ui/Keyboard.cpp +++ b/interface/src/ui/Keyboard.cpp @@ -734,7 +734,6 @@ void Keyboard::setLayerIndex(int layerIndex) { } void Keyboard::loadKeyboardFile(const QString& keyboardFile) { - return; if (keyboardFile.isEmpty()) { return; } @@ -782,7 +781,7 @@ void Keyboard::loadKeyboardFile(const QString& keyboardFile) { { "isSolid", true }, { "visible", false }, { "grabbable", true }, - { "ignoreRayIntersection", false }, + { "ignorePickIntersection", false }, { "dimensions", anchorObject["dimensions"].toVariant() }, { "position", anchorObject["position"].toVariant() }, { "orientation", anchorObject["rotation"].toVariant() } diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp index be3a769394..7af9e81889 100644 --- a/libraries/animation/src/AnimInverseKinematics.cpp +++ b/libraries/animation/src/AnimInverseKinematics.cpp @@ -865,6 +865,10 @@ const AnimPoseVec& AnimInverseKinematics::evaluate(const AnimVariantMap& animVar //virtual const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars, const AnimContext& context, float dt, AnimVariantMap& triggersOut, const AnimPoseVec& underPoses) { +#ifdef Q_OS_ANDROID + // disable IK on android + return underPoses; +#endif // allows solutionSource to be overridden by an animVar auto solutionSource = animVars.lookup(_solutionSourceVar, (int)_solutionSource); diff --git a/libraries/script-engine/src/ConsoleScriptingInterface.cpp b/libraries/script-engine/src/ConsoleScriptingInterface.cpp index e95053b964..60de04aa9e 100644 --- a/libraries/script-engine/src/ConsoleScriptingInterface.cpp +++ b/libraries/script-engine/src/ConsoleScriptingInterface.cpp @@ -30,7 +30,6 @@ QList ConsoleScriptingInterface::_groupDetails = QList(); QScriptValue ConsoleScriptingInterface::info(QScriptContext* context, QScriptEngine* engine) { if (ScriptEngine* scriptEngine = qobject_cast(engine)) { scriptEngine->scriptInfoMessage(appendArguments(context)); - qDebug()<<"SCRIPTING INFO: %s"<(engine)) { scriptEngine->scriptPrintedMessage(message); - qDebug()<<"SCRIPTING LOG: %s"<(engine)) { scriptEngine->scriptPrintedMessage(appendArguments(context)); - qDebug()<<"SCRIPTING DEBUG: %s"<(engine)) { scriptEngine->scriptWarningMessage(appendArguments(context)); - qDebug()<<"SCRIPTING WARN: %s"<(engine)) { scriptEngine->scriptErrorMessage(appendArguments(context)); - qDebug()<<"SCRIPTING ERROR: %s"<(engine)) { scriptEngine->scriptErrorMessage(appendArguments(context)); - qDebug()<<"SCRIPTING EXCEPTION: %s"<(engine)) { scriptEngine->scriptErrorMessage(assertionResult); - qDebug()<<"SCRIPTING ASSERT: %s"<& allDialects() { - static const std::vector ALL_DIALECTS{ Dialect::glsl310es }; + static const std::vector ALL_DIALECTS{ { Dialect::glsl310es } }; return ALL_DIALECTS; } diff --git a/libraries/ui/src/QmlFragmentClass.cpp b/libraries/ui/src/QmlFragmentClass.cpp index af386bfdd5..fbd045fdb1 100644 --- a/libraries/ui/src/QmlFragmentClass.cpp +++ b/libraries/ui/src/QmlFragmentClass.cpp @@ -53,8 +53,9 @@ QScriptValue QmlFragmentClass::internal_constructor(QScriptContext* context, QSc QScriptValue scriptObject = engine->newQObject(retVal); _fragments[qml.toString()] = scriptObject; return scriptObject; -#endif +#else return QScriptValue(); +#endif } void QmlFragmentClass::close() {