The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

t/oxr_android: Generate license resource at build time.

+46 -28
+3
.gitignore
··· 34 34 .vscode 35 35 *.autosave 36 36 .vs 37 + CMakeSettings.json 37 38 38 39 # Ignore merge-conflict resolution files 39 40 *.orig ··· 68 69 # .idea/assetWizardSettings.xml 69 70 .externalNativeBuild 70 71 .cxx 72 + .settings 73 + .project 71 74 72 75 gradlew 73 76 gradlew.bat
+1
doc/changes/misc_features/mr.592.md
··· 1 + Additional improvements to the Android port.
+41 -5
src/xrt/targets/openxr_android/build.gradle
··· 1 1 // Copyright 2020, Collabora, Ltd. 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 4 + import groovy.xml.XmlUtil 5 + 6 + plugins { 7 + id 'com.android.application' 8 + id 'kotlin-android' 9 + } 4 10 apply plugin: 'com.android.application' 5 11 apply plugin: 'kotlin-android' 6 12 apply plugin: 'com.mikepenz.aboutlibraries.plugin' ··· 8 14 androidGitVersion { 9 15 tagPattern(/^v[0-9]+.*/) 10 16 codeFormat = 'MNNPPPBBB' 17 + format = '%tag%%-count%%-gcommit%%-dirty%' 11 18 } 12 19 13 20 def parseOpenXRVersion(def fn) { 14 - def matches = file(fn).readLines().find { it.contains('XR_CURRENT_API_VERSION') } =~ ~/XR_MAKE_VERSION\(([^\)]+)\)/ 21 + def matches = file(fn).readLines().find { 22 + it.contains('XR_CURRENT_API_VERSION') 23 + } =~ ~/XR_MAKE_VERSION\(([^\)]+)\)/ 15 24 def components = matches[0][1].split(',').each { it.replace(' ', '').trim() } 16 25 String.join('.', components) 17 26 } 18 27 28 + 29 + // TODO: this copies to the source dir for simplicity right now, but it's not great! 30 + task copyLicenses(type: Copy) { 31 + from "${rootDir}/LICENSES/" 32 + include 'BSL-1.0.txt' 33 + rename { 34 + String name -> 35 + def lowerNoExtension = name.toLowerCase().replace(".txt", "") 36 + def result = lowerNoExtension.replaceAll(~/[\-.]/, "_") + ".txt" 37 + return result 38 + } 39 + into project.layout.projectDirectory.dir('src/main/res/raw').asFile 40 + filter { line -> 41 + if (line.trim().isEmpty()) { 42 + return '<br /><br />' 43 + } else { 44 + return groovy.xml.XmlUtil.escapeXml(line) 45 + } 46 + } 47 + } 48 + 19 49 android { 20 50 compileSdkVersion project.sharedTargetSdk 21 51 buildToolsVersion '30.0.2' ··· 30 60 versionCode androidGitVersion.code() 31 61 versionName androidGitVersion.name() 32 62 63 + println versionName 64 + 33 65 resValue "string", "monado_lib_version", "${versionName}" 34 66 resValue "string", "app_name", "Monado XR" 35 67 36 - resValue "string", "library_openxrheaders_libraryVersion", parseOpenXRVersion("../../../external/openxr_includes/openxr/openxr.h") 68 + resValue "string", "library_openxrheaders_libraryVersion", parseOpenXRVersion("${rootDir}/src/external/openxr_includes/openxr/openxr.h") 37 69 38 70 externalNativeBuild { 39 71 cmake { ··· 45 77 cmake.arguments "-DPYTHON_EXECUTABLE=${project.pythonBinary}" 46 78 } 47 79 } 80 + 81 + // Be sure to copy over licenses formatted as required. 82 + preBuild.dependsOn(copyLicenses) 48 83 } 49 84 50 85 buildTypes { ··· 57 92 58 93 externalNativeBuild { 59 94 cmake { 60 - path "../../../../CMakeLists.txt" 95 + path "${rootDir}/CMakeLists.txt" 61 96 } 62 97 } 63 98 ··· 80 115 sourceCompatibility JavaVersion.VERSION_1_8 81 116 targetCompatibility JavaVersion.VERSION_1_8 82 117 } 118 + 83 119 } 84 120 85 121 aboutLibraries { 86 - configPath = "config" 122 + configPath = "${projectDir}/config" 87 123 } 88 124 89 125 dependencies { ··· 91 127 implementation project(':src:xrt:auxiliary:android') 92 128 implementation 'androidx.appcompat:appcompat:1.2.0' 93 129 implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 94 - implementation 'androidx.constraintlayout:constraintlayout:2.0.1' 130 + implementation 'androidx.constraintlayout:constraintlayout:2.0.3' 95 131 implementation "com.mikepenz:aboutlibraries-core:${latestAboutLibsRelease}" 96 132 implementation "com.mikepenz:aboutlibraries:${latestAboutLibsRelease}" 97 133 implementation "androidx.cardview:cardview:1.*.*"
+1
src/xrt/targets/openxr_android/src/main/res/raw/.gitignore
··· 1 + bsl_1_0.txt
-23
src/xrt/targets/openxr_android/src/main/res/raw/bsl_1_0.txt
··· 1 - Boost Software License - Version 1.0 - August 17th, 2003<br> 2 - <br> 3 - Permission is hereby granted, free of charge, to any person or organization 4 - obtaining a copy of the software and accompanying documentation covered by 5 - this license (the "Software") to use, reproduce, display, distribute, execute, 6 - and transmit the Software, and to prepare derivative works of the Software, 7 - and to permit third-parties to whom the Software is furnished to do so, all 8 - subject to the following:<br> 9 - <br> 10 - The copyright notices in the Software and this entire statement, including 11 - the above license grant, this restriction and the following disclaimer, must 12 - be included in all copies of the Software, in whole or in part, and all derivative 13 - works of the Software, unless such copies or derivative works are solely in 14 - the form of machine-executable object code generated by a source language 15 - processor.<br> 16 - <br> 17 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 - FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 20 - COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES 21 - OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 - THE SOFTWARE.