forked from gearvrf/GearVRf-Demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.gradle
173 lines (151 loc) · 5.53 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
project.ext.hasBackend = false
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 23
targetSdkVersion 23
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'
pickFirst 'lib/*/libc++_shared.so'
pickFirst 'lib/*/libgnustl_shared.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
file("../../..").eachDir {
def fn = it.toString() + "/GearVRf-Demos_build.gradle"
if (file(fn).exists()) {
apply from: fn
println "importing build file from " + it.toString()
}
}
/*
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.130.0'
project.ext.jomlVersion = "1.9.3-SNAPSHOT"
project.ext.gsonVersion = '2.8.2'
if (!project.ext.hasBackend) {
project.ext.backend_oculus = true
project.ext.backend_daydream = true
}
if (project.hasProperty("backend_monoscopic")) {
project.ext.backend_monoscopic = project.property("backend_monoscopic")
} else if (project.hasProperty("backend_daydream")) {
project.ext.backend_daydream = project.property("backend_daydream")
} else if (project.hasProperty("backend_oculus")) {
project.ext.backend_oculus = project.property("backend_oculus")
}
dependencies {
implementation "com.google.code.gson:gson:$gsonVersion"
implementation "org.joml:joml-android:${jomlVersion}"
if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
if (findProject(':framework')) {
implementation project(':framework')
} else {
debugImplementation(name: 'framework-debug', ext: 'aar')
releaseImplementation(name: 'framework-release', ext: 'aar')
}
} else {
implementation "org.gearvrf:framework:$gearvrfVersion"
}
if (project.hasProperty("backend_monoscopic") && project.property("backend_monoscopic")) {
if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
if (findProject(':backend_monoscopic')) {
implementation project(':backend_monoscopic')
} else {
debugImplementation(name: 'backend_monoscopic-debug', ext: 'aar')
releaseImplementation(name: 'backend_monoscopic-release', ext: 'aar')
}
} else {
implementation "org.gearvrf:backend_monoscopic:$gearvrfVersion"
}
}
if (project.hasProperty("backend_daydream") && project.property("backend_daydream")) {
if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
if (findProject(':backend_daydream')) {
implementation project(':backend_daydream')
} else {
debugImplementation(name: 'backend_daydream-debug', ext: 'aar')
releaseImplementation(name: 'backend_daydream-release', ext: 'aar')
}
} else {
implementation "org.gearvrf:backend_daydream:$gearvrfVersion"
}
implementation "com.google.vr:sdk-base:${daydreamVersion}"
implementation "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')) {
implementation project(':backend_oculus')
} else {
debugImplementation(name: 'backend_oculus-debug', ext: 'aar')
releaseImplementation(name: 'backend_oculus-release', ext: 'aar')
}
} else {
implementation "org.gearvrf:backend_oculus:$gearvrfVersion"
}
}
}