This repository was archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 476
Do Not Merge WIP towards a places component #1107
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d31fef7
WIP towards a places component
mhammond cd31952
Merge remote-tracking branch 'origin/master' into autocomplete-places
mhammond c4a9e07
Update to use the new packaging process from application-services
mhammond 4aaae87
Merge remote-tracking branch 'origin/master' into autocomplete-places
mhammond fb74b67
Merge remote-tracking branch 'origin/master' into autocomplete-places
mhammond 792b368
Merge remote-tracking branch 'origin/master' into autocomplete-places
mhammond File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,8 @@ allprojects { | |
| google() | ||
| jcenter() | ||
|
|
||
| mavenLocal() | ||
|
|
||
| maven { | ||
| url "https://maven.mozilla.org/maven2" | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 *; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" /> |
4 changes: 4 additions & 0 deletions
4
...vice/sync-places/src/main/java/mozilla/components/service/sync/places/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
3 changes: 3 additions & 0 deletions
3
components/service/sync-places/src/main/res/values/strings.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <resources> | ||
| <string name="app_name">sync-places</string> | ||
| </resources> |
17 changes: 17 additions & 0 deletions
17
...vice/sync-places/src/test/java/mozilla/components/service/sync/places/SyncPlacesTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.)