OpenXR - Use a build variant instead of a module

This commit is contained in:
Lubos 2022-07-31 15:27:15 +02:00
parent 89f5038c01
commit 4691b376d1
9 changed files with 53 additions and 340 deletions

20
android/QuestManifest.xml Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:logo="@drawable/ic_banner"
android:isGame="true"
android:banner="@drawable/tv_banner"
android:requestLegacyExternalStorage="true"
android:preserveLegacyExternalStorage="true">
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
<meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2"/>
</application>
</manifest>

View File

@ -65,9 +65,6 @@ android {
versionCode ANDROID_VERSION_CODE
versionName ANDROID_VERSION_NAME
}
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
signingConfig signingConfigs.debug
}
buildTypes {
@ -106,6 +103,9 @@ android {
gold {
res.srcDirs = ['gold/res']
}
quest {
manifest.srcFile 'QuestManifest.xml'
}
}
productFlavors {
normal {
@ -122,6 +122,9 @@ android {
'-DANDROID_ARM_NEON=TRUE'
}
}
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
gold {
applicationId 'org.ppsspp.ppssppgold'
@ -138,6 +141,28 @@ android {
'-DGOLD=TRUE'
}
}
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
quest {
applicationId 'org.ppsspp.ppsspp'
dimension "variant"
externalNativeBuild {
cmake {
// Available arguments listed at https://developer.android.com/ndk/guides/cmake.html
arguments '-DANDROID=true',
'-DANDROID_PLATFORM=android-16',
'-DANDROID_TOOLCHAIN=clang',
'-DANDROID_CPP_FEATURES=',
'-DANDROID_STL=c++_static',
'-DANDROID_ARM_NEON=TRUE',
'-DOPENXR=TRUE'
}
}
ndk {
abiFilters 'arm64-v8a'
}
}
}
variantFilter { variant ->
@ -145,7 +170,10 @@ android {
'normalDebug', // for debugging
'normalOptimized', // for testing
'normalRelease', // for Google Play releases
'goldRelease' // for Google Play releases
'goldRelease', // for Google Play releases
'questDebug', // for VR debugging
'questOptimized', // for VR testing
'questRelease', // for VR releases
]
variant.setIgnore(!needed)
}

9
quest/.gitignore vendored
View File

@ -1,9 +0,0 @@
bin
gen
obj
build*/
gen
obj
.cxx
.externalNativeBuild
android.iml

View File

@ -1,127 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.ppsspp.ppsspp"
android:installLocation="auto"
android:versionCode="112030000"
android:versionName="1.12.3.0">
<!-- Note that versionCode should be in the format xyyzzrrrr. Example: 110030000 -->
<!-- In this same case, versionName should be 1.10.3.0 -->
<!-- Also note that we are overriding these values anyway from gradle. -->
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
<uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.software.leanback" android:required="false" />
<uses-feature android:name="android.hardware.gamepad" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<!-- I tried using android:maxSdkVersion="29" on WRITE/READ_EXTERNAL_STORAGE, but that made
<it so that in legacy mode, you can't ask for permission anymore. So removed that. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="archos.permission.FULLSCREEN.FULL" />
<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission-sdk-23 android:name="android.permission.CAMERA" />
<uses-permission-sdk-23 android:name="android.permission.RECORD_AUDIO" />
<!-- AndroidX minimum SDK workaround. We don't care if it's broken on older versions. -->
<uses-sdk tools:overrideLibrary="androidx.appcompat.resources,androidx.appcompat,androidx.fragment,androidx.drawerlayout,androidx.vectordrawable.animated,androidx.vectordrawable,androidx.viewpager,androidx.loader,androidx.activity,androidx.annotation,androidx.customview,androidx.cursoradapter,androidx.arch,androidx.collection,androidx.core,androidx.versionedparcelable,androidx.interpolator,androidx.lifecycle,androidx.loader,androidx.savedstate,androidx.lifecycle.viewmodel,androidx.lifecycle.livedata,androidx.lifecycle.livedata.core,androidx.arch.core,androidx.documentfile"/>
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:logo="@drawable/ic_banner"
android:isGame="true"
android:banner="@drawable/tv_banner"
android:requestLegacyExternalStorage="true"
android:preserveLegacyExternalStorage="true">
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
<meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2"/>
<activity
android:name=".PpssppActivity"
android:configChanges="locale|keyboard|keyboardHidden|navigation|uiMode"
android:label="@string/app_name"
android:theme="@style/ppsspp_style"
android:exported="true">
<!-- android:screenOrientation="landscape" -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
<category android:name="tv.ouya.intent.category.GAME"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="*"
android:mimeType="*/*"
android:pathPattern=".*\\.iso"
android:scheme="file" />
<data
android:host="*"
android:mimeType="*/*"
android:pathPattern=".*\\.cso"
android:scheme="file" />
<data
android:host="*"
android:mimeType="*/*"
android:pathPattern=".*\\.elf"
android:scheme="file" />
<data
android:host="*"
android:mimeType="*/*"
android:pathPattern=".*\\.ISO"
android:scheme="file" />
<data
android:host="*"
android:mimeType="*/*"
android:pathPattern=".*\\.CSO"
android:scheme="file" />
<data
android:host="*"
android:mimeType="*/*"
android:pathPattern=".*\\.ELF"
android:scheme="file" />
</intent-filter>
</activity>
<meta-data android:name="isGame" android:value="true" />
<activity
android:name=".ShortcutActivity"
android:label="@string/shortcut_name"
android:exported="true">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.CREATE_SHORTCUT" />
</intent-filter>
</activity>
<meta-data
android:name="xperiaplayoptimized_content"
android:resource="@drawable/ic_launcher" />
</application>
</manifest>

View File

@ -1,164 +0,0 @@
plugins {
id 'com.gladed.androidgitversion' version '0.4.5'
}
apply plugin: 'com.android.application'
androidGitVersion {
codeFormat = "MNNPPBBBB"
format = "%tag%%-count%%-branch%%-dirty%"
prefix = "v" // Only tags beginning with v are considered.
untrackedIsDirty = false
}
dependencies {
def appcompat_version = "1.2.0"
implementation "androidx.appcompat:appcompat:$appcompat_version"
// Convenient wrapper around DocumentContract. Might look into writing our own
// to see if there's some performance to squeeze at some point, but doubt it.
implementation "androidx.documentfile:documentfile:1.0.1"
}
android {
flavorDimensions "variant"
signingConfigs {
debug {
storeFile file("../android/debug.keystore")
}
optimized {
storeFile file("../android/debug.keystore")
}
// Set these in a system global (or project local, but not checked in) gradle.properties .
if (project.hasProperty("RELEASE_STORE_FILE")) {
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
} else {
release {
}
}
}
compileSdkVersion 32
defaultConfig {
applicationId 'org.ppsspp.ppsspp'
if (androidGitVersion.name() != "unknown" && androidGitVersion.code() >= 14000000) {
// Start using automatic Android version numbers from version 1.4.
println "Overriding Android Version Name, Code: " + androidGitVersion.name() + " " + androidGitVersion.code();
versionName androidGitVersion.name()
versionCode androidGitVersion.code()
} else {
println "(not using these:) Android Version Name, Code: " + androidGitVersion.name() + " " + androidGitVersion.code();
}
new File("versionname.txt").write(androidGitVersion.name())
new File("versioncode.txt").write(androidGitVersion.code().toString())
minSdkVersion 9
targetSdkVersion 32
if (project.hasProperty("ANDROID_VERSION_CODE") && project.hasProperty("ANDROID_VERSION_NAME")) {
versionCode ANDROID_VERSION_CODE
versionName ANDROID_VERSION_NAME
}
ndk {
abiFilters 'arm64-v8a'
}
signingConfig signingConfigs.debug
}
buildTypes {
debug {
minifyEnabled = false
jniDebuggable true
signingConfig signingConfigs.debug
}
optimized {
// Debug signed but optimized.
minifyEnabled = false
jniDebuggable true
signingConfig android.buildTypes.debug.signingConfig
}
release {
minifyEnabled = false
signingConfig signingConfigs.release
}
}
externalNativeBuild {
cmake {
path '../CMakeLists.txt'
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
res.srcDirs = ['../android/res']
java.srcDirs = ['../android/src']
aidl.srcDirs = ['../android/src']
resources.srcDirs = ['../android/src']
assets.srcDirs = ['../assets']
}
gold {
res.srcDirs = ['../android/gold/res']
}
}
productFlavors {
normal {
applicationId 'org.ppsspp.ppsspp'
dimension "variant"
externalNativeBuild {
cmake {
// Available arguments listed at https://developer.android.com/ndk/guides/cmake.html
arguments '-DANDROID=true',
'-DANDROID_PLATFORM=android-16',
'-DANDROID_TOOLCHAIN=clang',
'-DANDROID_CPP_FEATURES=',
'-DANDROID_STL=c++_static',
'-DANDROID_ARM_NEON=TRUE',
'-DOPENXR=TRUE'
}
}
}
gold {
applicationId 'org.ppsspp.ppssppgold'
dimension "variant"
externalNativeBuild {
cmake {
// Available arguments listed at https://developer.android.com/ndk/guides/cmake.html
arguments '-DANDROID=true',
'-DANDROID_PLATFORM=android-16',
'-DANDROID_TOOLCHAIN=clang',
'-DANDROID_CPP_FEATURES=',
'-DANDROID_STL=c++_static',
'-DANDROID_ARM_NEON=TRUE',
'-DOPENXR=TRUE',
'-DGOLD=TRUE'
}
}
}
}
variantFilter { variant ->
def needed = variant.name in [
'normalDebug', // for debugging
'normalOptimized', // for testing
'normalRelease', // for Google Play releases
'goldRelease' // for Google Play releases
]
variant.setIgnore(!needed)
}
}
afterEvaluate {
android.sourceSets.main.assets.getSrcDirs().each { println it }
}
// F-Droid lite version can be created with : ./gradlew assembleOptimized -Pf_droid
if (project.hasProperty("f_droid")) {
project.android.sourceSets.main.java.srcDirs += '../android/libs/MogaStubs'
} else {
project.dependencies {
implementation files('../android/libs/com.bda.controller.jar')
}
}

View File

@ -1,3 +0,0 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true

View File

@ -1,20 +0,0 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# 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 *;
#}

View File

@ -1,12 +0,0 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# Project target.
target=android-26

View File

@ -1 +1 @@
include ':android',':quest'
include ':android'