Skip to content

Commit

Permalink
Closes MozillaReality#1397: Megazord support
Browse files Browse the repository at this point in the history
(currently built against local versions of a-c, since upstream work is still inflight)

This PR upgrades a-c to 5.0.0, which is now using 0.35.0 appservices release
that introduces a "default megazord", which is what the consuming application
now uses by default.

See megazord docs: https://mozilla.github.io/application-services/docs/applications/consuming-megazord-libraries.html

TODO
- we want to use Gecko's network stack
  • Loading branch information
Grisha Kruglov committed Jul 18, 2019
1 parent dd0f53c commit 78a5f4f
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 48 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ dependencies {
implementation deps.android_components.ui_autocomplete
implementation deps.android_components.concept_fetch
implementation deps.android_components.lib_fetch
implementation deps.android_components.rusthttp
implementation deps.android_components.rustlog

// TODO this should not be necessary at all, see Services.kt
implementation deps.work.runtime
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.mozilla.vrbrowser

import android.app.Application

import org.mozilla.vrbrowser.browser.Places
import org.mozilla.vrbrowser.browser.Services
import org.mozilla.vrbrowser.db.AppDatabase
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper

import mozilla.components.lib.fetch.httpurlconnection.HttpURLConnectionClient
import mozilla.components.support.base.log.Log
import mozilla.components.support.base.log.sink.AndroidLogSink
import mozilla.components.support.rusthttp.RustHttpConfig
import mozilla.components.support.rustlog.RustLog

class VRBrowserApplication : Application() {

private var appExecutors: AppExecutors? = null
lateinit var services: Services
private set
lateinit var places: Places
private set

private val database: AppDatabase
get() = AppDatabase.getInstance(this, appExecutors)

val repository: DataRepository
get() = DataRepository.getInstance(database, appExecutors)

override fun onCreate() {
super.onCreate()

// Enable android-components and application-services logging.
Log.addSink(AndroidLogSink())
RustLog.enable()

// Specify network stack to be used by application-services libraries.
RustHttpConfig.setClient(lazy { HttpURLConnectionClient() })

appExecutors = AppExecutors()
places = Places(this)
services = Services(this, places)

TelemetryWrapper.init(this)
}
}
5 changes: 4 additions & 1 deletion versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def versions = [:]
// GeckoView versions can be found here:
// https://maven.mozilla.org/?prefix=maven2/org/mozilla/geckoview/
versions.gecko_view = "70.0.20190710094220"
versions.android_components = "4.0.0"
versions.android_components = "5.0.0-SNAPSHOT"
versions.mozilla_speech = "1.0.6"
versions.openwnn = "1.3.7"
versions.google_vr = "1.190.0"
Expand Down Expand Up @@ -59,6 +59,8 @@ android_components.service_accounts = "org.mozilla.components:service-firefox-ac
android_components.ui_autocomplete = "org.mozilla.components:ui-autocomplete:$versions.android_components"
android_components.concept_fetch = "org.mozilla.components:concept-fetch:$versions.android_components"
android_components.lib_fetch = "org.mozilla.components:lib-fetch-httpurlconnection:$versions.android_components"
android_components.rustlog = "org.mozilla.components:support-rustlog:$versions.android_components"
android_components.rusthttp = "org.mozilla.components:support-rusthttp:$versions.android_components"
deps.android_components = android_components

deps.mozilla_speech = "com.github.mozilla:mozillaspeechlibrary:$versions.mozilla_speech"
Expand Down Expand Up @@ -145,6 +147,7 @@ def addRepos(RepositoryHandler handler) {
handler.google()
handler.jcenter()
handler.maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
handler.maven { url 'https://snapshots.maven.mozilla.org/maven2' }
handler.maven { url 'https://maven.mozilla.org/maven2' }
handler.maven { url 'https://download.servo.org/nightly/maven' }
}
Expand Down

0 comments on commit 78a5f4f

Please sign in to comment.