-
Notifications
You must be signed in to change notification settings - Fork 260
/
Copy pathbuild.gradle
107 lines (91 loc) · 3.17 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Copyright (c) 2020-2024, The Khronos Group Inc.
//
// SPDX-License-Identifier: Apache-2.0
// Open this directory in Android Studio, or build with Gradle,
// to build the "hello_xr" sample application
plugins {
id 'com.android.application' version '7.4.2'
}
// These next few lines are just to make the version match the OpenXR release.
project.ext.repoRoot = file('../../../')
apply from: file('../../version.gradle')
android {
compileSdk 33
ndkVersion "23.2.8568313"
buildToolsVersion = "34.0.0"
namespace 'org.khronos.openxr.hello_xr'
defaultConfig {
applicationId "org.khronos.openxr.hello_xr"
// for Vulkan, need at least 24
minSdkVersion 24
versionName = project.versionOpenXR.toString() + project.versionQualifier
versionCode = project.versionOpenXR.getVersionCode()
externalNativeBuild {
cmake {
arguments '-DBUILD_API_LAYERS=OFF',
'-DBUILD_TESTS=ON',
'-DBUILD_LOADER=ON',
'-DBUILD_CONFORMANCE_TESTS=OFF',
'-DBUILD_ALL_EXTENSIONS=ON'
targets "openxr_loader", "hello_xr"
}
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
res.srcDir 'android_resources'
}
Vulkan {
res.srcDir 'android_resources/vulkan'
}
OpenGLES {
res.srcDir 'android_resources/opengles'
}
}
buildTypes {
release {
minifyEnabled false
}
}
externalNativeBuild {
cmake {
path "${project.repoRoot}/CMakeLists.txt"
}
}
flavorDimensions 'api'
productFlavors {
OpenGLES {
dimension 'api'
applicationIdSuffix '.opengles'
externalNativeBuild.cmake.arguments += '-DHELLOXR_DEFAULT_GRAPHICS_PLUGIN=OpenGLES'
resValue "string", "app_name", "Hello XR (OpenGL ES)"
}
Vulkan {
dimension 'api'
applicationIdSuffix '.vulkan'
externalNativeBuild.cmake.arguments += '-DHELLOXR_DEFAULT_GRAPHICS_PLUGIN=Vulkan'
resValue "string", "app_name", "Hello XR (Vulkan)"
}
}
}
// For signing of release binaries - env var must contain an absolute path
// CI always does this.
def keystorePropertiesFilename = System.getenv("KEYSTORE_PROPERTIES")
if (keystorePropertiesFilename) {
def keystorePropertiesFile = file("${keystorePropertiesFilename}")
if (keystorePropertiesFile.exists()) {
println("Signing release artifacts for hello_xr")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android.signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file("${project.repoRoot}/" + keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
android.buildTypes.release.signingConfig android.signingConfigs.release
}
}