Skip to content
This repository was archived by the owner on Nov 1, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ allprojects {
google()
jcenter()

mavenLocal()

maven {
url "https://maven.mozilla.org/maven2"
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object Config {

// This version number should follow semantic versioning (MAJOR.MINOR.PATCH).
// See https://semver.org/
const val componentsVersion = "0.29.0"
const val componentsVersion = "0.28.0-SNAPSHOT"

// Maven group ID used for all components
const val componentsGroupId = "org.mozilla.components"
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ object Deps {

const val mozilla_fxa = "org.mozilla.fxa_client:fxa_client:${Versions.mozilla_app_services}"
const val mozilla_sync_logins = "org.mozilla.sync15:logins:${Versions.mozilla_app_services}"
const val mozilla_places = "org.mozilla.places:places:0.7.1" // should be a -snapshot
const val mozilla_servo = "org.mozilla.servoview:servoview-armv7:${Versions.servo}"

const val thirdparty_sentry = "io.sentry:sentry-android:${Versions.sentry}"
Expand Down
26 changes: 26 additions & 0 deletions components/service/sync-places/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Building the Places component

This is very much a WIP, but should still offer enough so that we can discuss
the general shape of the component and how it is used in the reference-browser.

## Building the Rust pieces

* Check out the [master branch of the application-services repo](https://github.com/mozilla/application-services/) repo
(although please check [this PR](https://github.com/mozilla/application-services/pull/324) has been merged)

* Follow the [build instructions](https://github.com/mozilla/application-services/wiki/Building-the-Android-Components)
to setup a build environment for the rust code.

* In the root of the application-services repo, execute `./gradlew service-sync-places:install`

* Sanity check that `~/.m2/repository/org/mozilla/places/places/0.7.1/` exists.

## Publish this new component to your local maven repository

Please read [this guide](https://mozilla-mobile.github.io/android-components/contributing/testing-components-inside-app) for all the gritty details, but, roughly:

* Note that this branch has already modified `buildSrc/src/main/java/Config.kt` by appending `-SNAPSHOT` to the components version.

* Execute `gradlew service-sync-places:install` to publish it locally. Sanity check that there is stuff under `~/.m2/repository/org/mozilla/components/sync-places/`

* Use the reference-browser branch, which includes a change so the local maven repository is used for that component - and you should have a very basic auto-complete in the reference browser!
54 changes: 54 additions & 0 deletions components/service/sync-places/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion Config.compileSdkVersion

defaultConfig {
minSdkVersion Config.minSdkVersion
targetSdkVersion Config.targetSdkVersion
}

lintOptions {
warningsAsErrors true
abortOnError true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules-consumer.pro'
}
}
}

configurations {
jnaForTest
}

dependencies {
jnaForTest Deps.jnaForTest

api Deps.mozilla_places

implementation Deps.kotlin_stdlib
implementation Deps.jna
implementation Deps.kotlin_coroutines

testImplementation files(configurations.jnaForTest.files)

// testImplementation Deps.mozilla_sync_places

testImplementation Deps.testing_junit
testImplementation Deps.testing_robolectric
testImplementation Deps.testing_mockito
}

archivesBaseName = "sync-places"

apply from: '../../../publish.gradle'
ext.configurePublish(
'org.mozilla.components',
'sync-places',
'A library for sync-enabled Places.')
7 changes: 7 additions & 0 deletions components/service/sync-places/proguard-rules-consumer.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ProGuard rules for consumers of this library.

# JNA specific rules
# See https://github.com/java-native-access/jna/blob/master/www/FrequentlyAskedQuestions.md#jna-on-android
-dontwarn java.awt.*
-keep class com.sun.jna.* { *; }
-keepclassmembers class * extends com.sun.jna.* { public *; }
2 changes: 2 additions & 0 deletions components/service/sync-places/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mozilla.places" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This directory is where the "high level" places API will live.

However, at this stage we are still using the low-level API directly, so
there are no kotlin source files here yet.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">sync-places</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.mozilla.components.sync.places;

import org.junit.Test;

import static org.junit.Assert.*;

/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
2 changes: 2 additions & 0 deletions samples/browser/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ dependencies {

servoImplementation project(':browser-engine-servo')

implementation project(':service-sync-places')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sync-logins we have a separate sample app. We'd likely not add all sync features to the sample browser, I think. So, we'd have a sync specific sample app and the reference-browser (having all features.)


geckoNightlyImplementation project(':browser-engine-gecko-nightly')
geckoNightlyArmImplementation Gecko.geckoview_nightly_arm
geckoNightlyX86Implementation Gecko.geckoview_nightly_x86
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ setupProject(':ui-tabcounter', 'components/ui/tabcounter', 'A tab counter for br

setupProject(':service-firefox-accounts', 'components/service/firefox-accounts', 'A library for integrating with Firefox Accounts.')
setupProject(':service-sync-logins', 'components/service/sync-logins', 'A library for integrating with Firefox Sync - Logins.')
setupProject(':service-sync-places', 'components/service/sync-places', 'A library for integrating with Firefox Sync - History and Bookmarks.')
setupProject(':service-fretboard', 'components/service/fretboard', 'An Android framework for segmenting users in order to run A/B tests and rollout features gradually.')
setupProject(':service-glean', 'components/service/glean', 'A client-side telemetry SDK for collecting metrics and sending them to Mozilla\'s telemetry service')
setupProject(':service-telemetry', 'components/service/telemetry', 'A generic library for generating and sending telemetry pings from Android applications to Mozilla\'s telemetry service.')
Expand Down