forked from gearvrf/GearVRf-Demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.gradle
191 lines (171 loc) · 6.44 KB
/
common.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
if (file("../../../extra_properties.gradle").exists()) {
apply from: '../../../extra_properties.gradle'
}
if (file("../../../../extra_properties.gradle").exists()) {
apply from: '../../../../extra_properties.gradle'
}
allprojects {
repositories {
jcenter()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url "http://google.bintray.com/googlevr"
}
flatDir {
dirs '../../GearVRf/GVRf/gearvrf-libs', '../../../GearVRf/GVRf/gearvrf-libs', '../../../../GearVRf/GVRf/gearvrf-libs'
}
}
}
android {
compileSdkVersion 26
buildTypes {
debug {
debuggable = true
jniDebuggable = true
resValue 'string', 'app_name', System.getProperty("appName")
}
release {
signingConfig signingConfigs.debug
resValue 'string', 'app_name', System.getProperty("appName")
}
}
defaultConfig {
minSdkVersion 21
targetSdkVersion 21
ndk {
if (rootProject.hasProperty("ARM64")) {
abiFilters = ['arm64-v8a']
} else {
abiFilters = ['armeabi-v7a']
}
}
}
applicationVariants.all { variant ->
variant.outputs.all { output ->
output.outputFileName = System.getProperty("appName") + ".apk"
}
}
// ignore the x86 files from the google vr libraries
packagingOptions {
exclude 'lib/x86/libgvr.so'
if (!project.hasProperty("ARM64")) {
exclude 'lib/arm64-v8a/*.so'
} else {
exclude 'lib/armeabi-v7a/*.so'
}
}
}
task copyOculusSignature(type: Copy) {
if (project.hasProperty("OCULUS_SIGS_DIRECTORY")) {
copy {
from project.property("OCULUS_SIGS_DIRECTORY")
into 'src/main/assets'
include 'oculussig_*'
}
}
}
preBuild {}.dependsOn copyOculusSignature
/*
To use local dependencies add the following line in a global gradle properties file
eg. ~/.gradle/gradle.properties:
useLocalDependencies=true
*/
ext.gearvrfVersion = '4.0.1-SNAPSHOT'
project.ext.daydreamVersion = '1.120.0'
project.ext.jomlVersion = "1.9.3-SNAPSHOT"
project.ext.gsonVersion = '2.8.2'
def hasBackend = false
if (project.hasProperty("backend_monoscopic") && project.property("backend_monoscopic")) {
hasBackend = true
} else if (project.hasProperty("backend_daydream") && project.property("backend_daydream")) {
hasBackend = true
} else if (project.hasProperty("backend_oculus") && project.property("backend_oculus")) {
hasBackend = true
} else if (project.hasProperty("backend") && project.property("backend")) {
hasBackend = true
}
if (!hasBackend) {
project.ext.backend_oculus = true
project.ext.backend_daydream = true
}
dependencies {
compile "com.google.code.gson:gson:$gsonVersion"
compile "org.joml:joml-android:${jomlVersion}"
if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
if (findProject(':framework')) {
compile project(':framework')
} else {
debugCompile(name: 'framework-debug', ext: 'aar')
releaseCompile(name: 'framework-release', ext: 'aar')
}
} else {
compile "org.gearvrf:framework:$gearvrfVersion"
}
if (project.hasProperty("backend_monoscopic") && project.property("backend_monoscopic")) {
if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
if (findProject(':backend_monoscopic')) {
compile project(':backend_monoscopic')
} else {
debugCompile(name: 'backend_monoscopic-debug', ext: 'aar')
releaseCompile(name: 'backend_monoscopic-release', ext: 'aar')
}
} else {
compile "org.gearvrf:backend_monoscopic:$gearvrfVersion"
}
}
if (project.hasProperty("backend_daydream") && project.property("backend_daydream")) {
if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
if (findProject(':backend_daydream')) {
compile project(':backend_daydream')
} else {
debugCompile(name: 'backend_daydream-debug', ext: 'aar')
releaseCompile(name: 'backend_daydream-release', ext: 'aar')
}
} else {
compile "org.gearvrf:backend_daydream:$gearvrfVersion"
}
compile "com.google.vr:sdk-base:${daydreamVersion}"
compile "com.google.vr:sdk-controller:${daydreamVersion}"
}
if (project.hasProperty("backend_oculus") && project.property("backend_oculus")) {
if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
if (findProject(':backend_oculus')) {
compile project(':backend_oculus')
} else {
debugCompile(name: 'backend_oculus-debug', ext: 'aar')
releaseCompile(name: 'backend_oculus-release', ext: 'aar')
}
} else {
compile "org.gearvrf:backend_oculus:$gearvrfVersion"
}
}
if (project.hasProperty("backend_java") && project.property("backend_java")) {
if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
if (findProject(':backend_java')) {
compile project(':backend_java')
} else {
debugCompile(name: 'backend_java-debug', ext: 'aar')
releaseCompile(name: 'backend_java-release', ext: 'aar')
}
} else {
throw new GradleException("backend_java not available from maven")
}
}
if (project.hasProperty("backend_cpp") && project.property("backend_cpp")) {
if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
if (findProject(':backend_cpp')) {
compile project(':backend_cpp')
compile project(':backend_cpp_library')
} else {
debugCompile(name: 'backend_cpp-debug', ext: 'aar')
releaseCompile(name: 'backend_cpp-release', ext: 'aar')
debugCompile(name: 'backend_cpp_library-debug', ext: 'aar')
releaseCompile(name: 'backend_cpp_library-release', ext: 'aar')
}
} else {
throw new GradleException("backend_cpp not available from maven")
}
}
}