Commit 99aaaedd authored by Tibor Goldschwendt's avatar Tibor Goldschwendt Committed by Commit Bot

[build:android] Add a module for VR in Chrome Modern

Bug: 862694
Change-Id: I4ab7cb60c8e397964f88449c31ff4fd0d6f4e253
Reviewed-on: https://chromium-review.googlesource.com/1173252Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Commit-Queue: Tibor Goldschwendt <tiborg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584070}
parent 0b460e2f
...@@ -25,6 +25,9 @@ import("static_initializers.gni") ...@@ -25,6 +25,9 @@ import("static_initializers.gni")
if (enable_arcore) { if (enable_arcore) {
import("//chrome/android/modules/ar/ar_module_tmpl.gni") import("//chrome/android/modules/ar/ar_module_tmpl.gni")
} }
if (enable_vr) {
import("//chrome/android/modules/vr/vr_module_tmpl.gni")
}
manifest_package = "org.chromium.chrome" manifest_package = "org.chromium.chrome"
...@@ -1715,6 +1718,13 @@ if (enable_arcore) { ...@@ -1715,6 +1718,13 @@ if (enable_arcore) {
} }
} }
if (enable_vr) {
vr_module_tmpl("vr_public_module") {
manifest_package = manifest_package
module_name = "VrPublicModule"
}
}
# Chrome Android application bundles. # Chrome Android application bundles.
android_app_bundle("chrome_public_bundle") { android_app_bundle("chrome_public_bundle") {
bundle_name = "ChromePublicBundle" bundle_name = "ChromePublicBundle"
...@@ -1731,6 +1741,14 @@ android_app_bundle("chrome_modern_public_bundle") { ...@@ -1731,6 +1741,14 @@ android_app_bundle("chrome_modern_public_bundle") {
bundle_name = "ChromeModernPublicBundle" bundle_name = "ChromeModernPublicBundle"
base_module_target = ":chrome_modern_public_base_module" base_module_target = ":chrome_modern_public_base_module"
proguard_enabled = !is_java_debug proguard_enabled = !is_java_debug
if (enable_vr) {
extra_modules = [
{
name = "vr"
module_target = ":vr_public_module"
},
]
}
} }
android_app_bundle("monochrome_public_bundle") { android_app_bundle("monochrome_public_bundle") {
......
...@@ -179,7 +179,7 @@ template("chrome_public_common_apk_or_module_tmpl") { ...@@ -179,7 +179,7 @@ template("chrome_public_common_apk_or_module_tmpl") {
deps += [ ":$_unwind_asset" ] deps += [ ":$_unwind_asset" ]
} }
if (enable_vr) { if (enable_vr && _target_type == "android_apk") {
deps += [ "//chrome/browser/android/vr:java" ] deps += [ "//chrome/browser/android/vr:java" ]
} }
} }
...@@ -263,6 +263,12 @@ template("monochrome_public_common_apk_or_module_tmpl") { ...@@ -263,6 +263,12 @@ template("monochrome_public_common_apk_or_module_tmpl") {
png_to_webp = true png_to_webp = true
} }
# TODO(crbug.com/862719): Remove Java VR code from the monochrome base
# module once we can conditionally install the VR DFM.
if (enable_vr) {
deps += [ "//chrome/browser/android/vr:java" ]
}
if (invoker.target_type == "android_apk") { if (invoker.target_type == "android_apk") {
if (enable_arcore) { if (enable_arcore) {
deps += [ "//third_party/arcore-android-sdk:libdynamite_client_java" ] deps += [ "//third_party/arcore-android-sdk:libdynamite_client_java" ]
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="{{manifest_package}}">
<!-- Chrome VR is only supported on Android L+. -->
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="{{target_sdk_version}}" />
<!-- TODO(crbug.com/862689): Set dist:onDemand="true" once we can on-demand
install modules. -->
<!-- TODO(crbug.com/875059): Use @string reference for dist:title. -->
<dist:module
dist:onDemand="false"
dist:title="VR">
<dist:fusing dist:include="false" />
</dist:module>
<application>
</application>
</manifest>
cjgrant@chromium.org
mthiesse@chromium.org
tiborg@chromium.org
# TEAM: xr-dev@chromium.org
# COMPONENT: Internals>XR>VR
# OS: Android
\ No newline at end of file
The VR dynamic feature module contains code necessary to support VR in Chrome.
This folder contains the template for creating an VR DFM target as well as the
required Android manifest.
\ No newline at end of file
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/rules.gni")
import("//device/vr/buildflags/buildflags.gni")
assert(enable_vr)
template("vr_module_tmpl") {
assert(defined(invoker.manifest_package))
assert(defined(invoker.module_name))
_manifest = "$target_gen_dir/$target_name/AndroidManifest.xml"
_manifest_target = "${target_name}__manifest"
jinja_template(_manifest_target) {
input = "//chrome/android/modules/vr/AndroidManifest.xml"
output = _manifest
variables = [
"target_sdk_version=$android_sdk_version",
"manifest_package=${invoker.manifest_package}",
]
}
android_app_bundle_module(target_name) {
module_name = invoker.module_name
android_manifest = _manifest
android_manifest_dep = ":${_manifest_target}"
deps = [
"//chrome/browser/android/vr:java",
]
proguard_enabled = !is_java_debug
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment