Skip to content

Commit

Permalink
Automatically enable webvr for Android VR builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Nov 28, 2018
1 parent 6eb3968 commit d171daa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions python/servo/package_commands.py
Expand Up @@ -281,6 +281,15 @@ def package(self, release=False, dev=False, android=None, magicleap=None, debug=
if flavor is not None:
flavor_name = flavor.title()

vr = flavor == "googlevr" or flavor == "oculusvr"

dir_to_resources = path.join(self.get_top_dir(), 'target', 'android', 'resources')
if path.exists(dir_to_resources):
delete(dir_to_resources)

shutil.copytree(path.join(dir_to_root, 'resources'), dir_to_resources)
change_prefs(dir_to_resources, "android", vr=vr)

variant = ":assemble" + flavor_name + build_type + build_mode
apk_task_name = ":servoapp" + variant
aar_task_name = ":servoview" + variant
Expand Down
2 changes: 1 addition & 1 deletion support/android/apk/servoview/build.gradle
Expand Up @@ -111,7 +111,7 @@ android {

sourceSets {
main {
assets.srcDirs = ['../../../../resources']
assets.srcDirs = [rootDir.absolutePath + "/../../../target/android/resources"]
}
armDebug {
jniLibs.srcDirs = [getJniLibsPath(true, 'arm')]
Expand Down

0 comments on commit d171daa

Please sign in to comment.