Commit Graph

47 Commits

Author SHA1 Message Date
Pritesh Nandgaonkar
37c973d0c9 Crash reporting plugin android (#328)
Summary:
This PR adds the barebone of a crash reporting plugin in android. Since there is no easy way to stack the PR's in git, creating a new PR, but this depends on the [iOS PR](https://github.com/facebook/flipper/pull/322)
Pull Request resolved: https://github.com/facebook/flipper/pull/328

Reviewed By: jknoxville, passy

Differential Revision: D13137447

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 3b86cebbb1ea01601405dd7ba58e1caa2b506065
2018-11-26 03:43:26 -08:00
Pritesh Nandgaonkar
e02420ac78 Make android project compile with new gradle and build tools
Summary:
If this is not done. I get
```
Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1).
Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar
```
I follwed the suggestion given on [stack overflow](https://stackoverflow.com/questions/52944598/could-not-find-aapt2-proto-jar)

Reviewed By: jknoxville

Differential Revision: D12839581

fbshipit-source-id: aa02620c7e4c52899b2c2c4805fd8a6f168d946a
2018-11-15 06:37:55 -08:00
Ian Childs
7b569a1692 Remove getBaseContext
Summary:
We have getAndroidContext() instead.

This will probably take a few iterations to land, but getting it out there so that I can try :)

Reviewed By: muraziz

Differential Revision: D12921523

fbshipit-source-id: 038ecf8c411fdbde6831051b219a43716007ac49
2018-11-07 04:20:13 -08:00
Pascal Hartig
a7fd546f0e Add basic integration test
Summary:
Just a quick startup test that can save you the time of manually
opening the app.

I don't have any plans of hooking this up in Circle, but it's
still kinda useful to have.

Reviewed By: jknoxville

Differential Revision: D12901590

fbshipit-source-id: a16a1814574d9f27770dcf98c6b238517c589930
2018-11-02 07:09:51 -07:00
Ian Childs
f3833a6e5a More prep for ComponentContext not extending Context
Summary: Per title

Reviewed By: astreet

Differential Revision: D12839032

fbshipit-source-id: c69805fd68a6530d1e56edad3bb5edf4089ee98a
2018-10-31 07:29:32 -07:00
Pascal Hartig
cb186d2af3 Fix sample app style issues
Summary:
Start adding Nullable and finals in some places to
make our sample app (and hopefully rest of the codebase) follow
some of the standards we have in place elsewhere.

Reviewed By: jknoxville

Differential Revision: D10463816

fbshipit-source-id: 7df6758919331ba8a334c94214b9e02bbab8cd2d
2018-10-20 05:11:14 -07:00
John Knox
6cc7f60cde Add sample js and android plugin
Summary:
The start of an example plugin.

My intention is for this to be a place that we keep up to date with the current best practice for doing things.

For example, with the introduction on persistedStateReducer, there are two ways to receive incoming messages, but only one of them works in the background. This should act as a guideline.

For this reason, don't hold back on reviewing it. I want it to be 👌

Reviewed By: priteshrnandgaonkar

Differential Revision: D10448592

fbshipit-source-id: d5fa978c14e47a7fa3c9a29d0929d5a6109267af
2018-10-19 09:44:05 -07:00
Hilal Alsibai
34c55262ce Reformat sample android app with google-java-format
Summary: Prettier code

Reviewed By: sjkirby

Differential Revision: D10181909

fbshipit-source-id: 05e4c2417dc04e65a95b69beb3694f240c9d954a
2018-10-06 11:41:35 -07:00
Hilal Alsibai
c7e0a26876 Update sample android app to use multiple shared preference files
Summary: Demonstrates the ability to have multiple shared preference files appear in Flipper

Reviewed By: sjkirby

Differential Revision: D10181910

fbshipit-source-id: 02acc02c722315da74dfb69542ca3ab1f26fa2e5
2018-10-06 11:41:35 -07:00
Pascal Hartig
90cf003035 Rename shared preferences plugin
Summary: Sonar -> Flipper

Reviewed By: priteshrnandgaonkar

Differential Revision: D9991095

fbshipit-source-id: 685775e373ae22abbb06b979fea8461c35de74b5
2018-09-23 04:13:55 -07:00
Pascal Hartig
c7f6893cb4 Rename network plugin
Summary: Sonar -> Flipper. Class names only for now.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9991029

fbshipit-source-id: b96dbab7acc89586c1ee67b64bef1c9490b560b5
2018-09-22 16:43:26 -07:00
Pascal Hartig
52fb0fc1b8 Rename LithoFlipperDescriptors
Summary:
As titled.
The controller you requested could not be found.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9990862

fbshipit-source-id: 459420adf400fd4504035fc36b14c5595f431f6a
2018-09-22 09:38:43 -07:00
Pascal Hartig
bd27a624cd Rename LeakCanarySonarPlugin to LeakCanaryFlipperPlugin
Summary: As before.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9990841

fbshipit-source-id: 4517d6949c3eb408b86b2b520d369134b006cf4f
2018-09-22 09:38:43 -07:00
Pascal Hartig
235916666b Rename InspectorSonarPlugin to InspectorFlipperPlugin
Summary: Per title.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9990824

fbshipit-source-id: f40a769a2f46e5051e09523939ba1034b21e88cb
2018-09-22 09:38:42 -07:00
Pascal Hartig
470ac6f6f7 AndroidSonarClient -> AndroidFlipperClient
Summary:
Per title.

The controller you requested could not be found.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9966768

fbshipit-source-id: 224ff9d02d6a01a6f7ee28788ddd9167d15aafee
2018-09-21 17:37:12 -07:00
Pascal Hartig
8780cff8ca Rename SonarDiagnosticActivity to FlipperDiagnosticActivity
Summary: Per title.

Reviewed By: danielbuechele

Differential Revision: D9966619

fbshipit-source-id: 52934813903f1d48c1ee35938848320b54a50a0f
2018-09-21 11:45:28 -07:00
Pascal Hartig
0a20d95195 Rename java core classes
Summary:
Rename everything `Sonar*.java` in `core/`.

Biggest chunk of the rename happened with

```fish
for name in (cat names.txt)
    ambr --no-interactive --regex '\b'"$name"'\b' (echo $name | sed 's/Sonar/Flipper/') fbandroid/java/com/facebook
end
```

names.txt:
```
SonarArray
SonarClient
SonarConnection
SonarDynamic
SonarObject
SonarPlugin
SonarReceiver
SonarResponder
SonarStateUpdateListener
SonarValue

```

The controller you requested could not be found.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9940900

fbshipit-source-id: 4a1342fac02513025d80dcb0af62c26ea38b5086
2018-09-20 10:33:43 -07:00
Pascal Hartig
88ca69a13f Rename Java packages from sonar to flipper
Summary:
This soft-breaks Android Studio support because folder names no longer map to package names, but this will be mitigated by future diffs.

Steps taken for rename:

```
cd xplat/sonar/android/;
ambr 'com.facebook.sonar' 'com.facebook.flipper'
```

Reviewed By: danielbuechele

Differential Revision: D9850009

fbshipit-source-id: d26d8ab783e7050e4e2fbdd0c35eae3f97879464
2018-09-19 09:12:06 -07:00
Pascal Hartig
c495c53cd4 Fix sample app build
Summary:
Two fixes included in this one. The debug flag is obvious, the annotations
less so. I'll try and find the right place to document this, but the reason
we need this here is because we reflect on `Prop.class`, so these need to be
available at runtime.

Reviewed By: jknoxville

Differential Revision: D9766713

fbshipit-source-id: 269b5a60c0df644f4fda0ea289ef9dc392ee352b
2018-09-11 07:57:16 -07:00
Pascal Hartig
69cd889b71 Fix Litho plugin package (#247)
Summary:
The plugin was part of the wrong package based on its directory. This
confuses Gradle and I'm frankly a bit surprised this ever built before.
Pull Request resolved: https://github.com/facebook/flipper/pull/247

Reviewed By: danielbuechele

Differential Revision: D9420595

Pulled By: passy

fbshipit-source-id: fd8e47ff242c4535b36e379df93b672eb8bb840d
2018-08-21 04:29:08 -07:00
Pascal Hartig
cded1ceead Switch to Litho snapshot releases
Summary:
This allows breaking changes in Litho to be landed.
I'm also adding some helpers to determine if Flipper itself
is currently in a release or snapshot release train.

N.B. We don't publish snapshot releases for Flipper
right now, but will in the future where this will come in
handy.

Reviewed By: jknoxville

Differential Revision: D9359035

fbshipit-source-id: d21b607eca5d57caf4cc34234f6ba3cb0d8f307d
2018-08-16 06:56:30 -07:00
John Knox
89c89e219c Expose Diagnostic screen in sample app
Summary: Adds a link on MainActivitiy that opens the diagnostic screen

Reviewed By: danielbuechele

Differential Revision: D9267065

fbshipit-source-id: 1b44134de0e57f8021b19d76644dac6389c88b65
2018-08-13 03:58:53 -07:00
John Knox
531a47535b Add SonarDiagnosticActivity to android
Summary:
Open the screen by running adb shell
am start -n com.facebook.samples.litho/com.facebook.sonar.android.diagnostics.SonarDiagnosticActivity

Reviewed By: danielbuechele

Differential Revision: D9150556

fbshipit-source-id: 534583cfa5e90af6fd0d2a50572e3763b8888da2
2018-08-07 09:59:27 -07:00
Pascal Hartig
4e5122d664 Fix RootComponentSpec formatting
Summary: pusheen_big_and_beautiful

Reviewed By: danielbuechele

Differential Revision: D9178922

fbshipit-source-id: 5d8e1b01086e337b9f9d3b714bb1e6c879a43f55
2018-08-06 04:41:29 -07:00
Pascal Hartig
0c536b3188 Set up LeakCanary plugin in sample app
Summary: Per title.

Reviewed By: danielbuechele

Differential Revision: D9178886

fbshipit-source-id: c48411cdd2a28d182644bf2278ee8414812d6034
2018-08-06 03:14:20 -07:00
Daniel Abramowitz
fadd392349 Revert D8954095: [sonar] Add SonarDiagnosticActivity to android
Differential Revision:
D8954095

Original commit changeset: b4a638bc0ba2

fbshipit-source-id: 6165b7429477e80520fb0e149da1c2ef893e1d90
2018-08-03 08:27:42 -07:00
John Knox
3237b60ff1 Add SonarDiagnosticActivity to android
Summary:
Open the screen by running adb shell
am start -n com.facebook.wakizashi/com.facebook.sonar.android.diagnostics.SonarDiagnosticActivity

Reviewed By: passy

Differential Revision: D8954095

fbshipit-source-id: b4a638bc0ba2f69a69c121c7c1c00fbe47476ee3
2018-08-03 07:42:17 -07:00
John Knox
a6d8493330 Grammar fix in android sample app
Summary: Fixing grammar.

Reviewed By: passy

Differential Revision: D9082223

fbshipit-source-id: d3bf4e345f0fd13c5ef5c418c41e4a07620bd86f
2018-08-01 06:12:04 -07:00
Pritesh Nandgaonkar
07d75ce848 Rename Sample app from Sonar to Flipper
Summary: Renamed sonar sample app with flipper

Reviewed By: passy

Differential Revision: D9050608

fbshipit-source-id: 4e76e4c6cc8febb997ce32b4f78a2fab9792310d
2018-07-31 14:02:58 -07:00
Pascal Hartig
07b083e570 Move sample source and resources to gradle dirs
Summary: Follow standard Gradle paths.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8890133

fbshipit-source-id: 062331b6b3d5f118f07cb5ca14cdec871f75867b
2018-07-19 09:50:04 -07:00
Pascal Hartig
cd6a5f9ff8 Reorganize native dep download and extraction (#154)
Summary:
This moves the native setup to a separate gradle file and unpacks everything outside the build folder. That way we don't throw everything away on every incremental build.

This is an intermediate step to get to a more declarative setup like Fresco has it and get rid of the individual hacks we have for every download.
Pull Request resolved: https://github.com/facebook/Sonar/pull/154

Reviewed By: jknoxville

Differential Revision: D8833812

Pulled By: passy

fbshipit-source-id: 2424c9d6e22e6092c04af344e06939b4a6aba041
2018-07-16 10:26:10 -07:00
Pascal Hartig
fcd1b1e773 Clean up dependencies (#153)
Summary:
Remove unused dependencies and centralise the remaining ones in the
global project config.
Pull Request resolved: https://github.com/facebook/Sonar/pull/153

Reviewed By: priteshrnandgaonkar

Differential Revision: D8820462

Pulled By: passy

fbshipit-source-id: 1c845898930eb62942379fddec6da39dbdc426d0
2018-07-12 09:05:55 -07:00
Hilal Alsibai
c6eb0d6b1a Integrate shared preferences plugin in sample Android app
Summary: Adds the shared preferences plugin to the sample Android app

Reviewed By: sjkirby

Differential Revision: D8661572

fbshipit-source-id: 490a19938b9dd1c87f9200027d3395d719013d21
2018-07-02 11:05:14 -07:00
Pascal Hartig
0515ddb76e Setup fbjni sub-project for maven (#119)
Summary:
Set up our fbjni sub-project to be published to Maven Central.
This removes a bunch of abiFilters that we no longer make use of, too.
Closes https://github.com/facebook/Sonar/pull/119

Reviewed By: priteshrnandgaonkar

Differential Revision: D8694537

Pulled By: passy

fbshipit-source-id: de246fbda99c02856fbc7806b78df2114cb82acb
2018-07-02 01:19:35 -07:00
Pascal Hartig
167792e7d8 Remove NDK build from fbjni sub-project (#116)
Summary:
We're already building this as dependency via CMake of sonar itself and
bundle the resulting `.so` files in there.

This project only contains the java files so we can ship them as
separate JAR.

Importantly, this avoids having to use `pickFirst` as we bundle multiple
incompatible `.so` files in both AARs.
Closes https://github.com/facebook/Sonar/pull/116

Reviewed By: priteshrnandgaonkar

Differential Revision: D8691119

Pulled By: passy

fbshipit-source-id: 82303d6c2b5d7e12dcd8f49300090ce8e4570e47
2018-06-29 06:47:31 -07:00
Pritesh Nandgaonkar
110ff1c353 Package prebuilt libraries in android target (#105)
Summary:
package prebuilt libraries in `:android` rather than in sample app
Closes https://github.com/facebook/Sonar/pull/105

Reviewed By: passy

Differential Revision: D8639064

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 4da20b046e2e55f0f605f91bf8809a4efd6848d9
2018-06-26 07:32:46 -07:00
Pritesh Nandgaonkar
64a61a37d4 Fix Broken sample app (#103)
Summary:
With this fix the entire android setup builds with gradle . To try out the sample app, run `./gradlew :sample:installDebug`
Closes https://github.com/facebook/Sonar/pull/103

Reviewed By: danielbuechele

Differential Revision: D8618622

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 62a038f95c37cbadf48636a58ca222c8162e256e
2018-06-25 11:33:44 -07:00
Pritesh Nandgaonkar
edfdd64950 [WIP] gradle builds but app freezes, updated fbjni so file is the possible culprit 2018-06-21 16:27:18 +01:00
Pritesh Nandgaonkar
88a6cff373 Fix merge conflicts 2018-06-19 15:31:33 +01:00
Pritesh Nandgaonkar
7405cd268a Merge branch 'master' of https://github.com/facebook/Sonar into Fix-Android 2018-06-19 14:13:59 +01:00
Pritesh Nandgaonkar
ffa6e744c2 update 2018-06-19 14:08:12 +01:00
Pritesh Nandgaonkar
88ecb9b494 app builds but not with sonarfb 2018-06-18 18:45:37 +01:00
Pascal Hartig
e820beba83 Centralize sample dependencies (#77)
Summary:
The support libraries where out of sync between the projects, causing
the sample build to fail with

```
> Android dependency 'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution
```

This makes sure that the sample submodule uses the top-level
dependencies and same versions.
Closes https://github.com/facebook/Sonar/pull/77

Reviewed By: emilsjolander

Differential Revision: D8447186

Pulled By: passy

fbshipit-source-id: e391501edd97fdbe6456b32cd7305d8be26e20db
2018-06-15 09:40:22 -07:00
Pritesh Nandgaonkar
4cbaeb3e32 Android target and sample builds 👏 2018-06-15 16:53:58 +01:00
Daniel Buchele
6f95ad512f fbshipit-source-id: b14273e883aba6de7b817801a1b04e54a29a6366 2018-06-15 02:23:48 -07:00
Daniel Buchele
f7d487dd76 fbshipit-source-id: 2cd940396d650342920b28835f6e672febe6b55c 2018-06-12 03:39:09 -07:00
Daniel Büchele
fbbf8cf16b Initial commit 🎉
fbshipit-source-id: b6fc29740c6875d2e78953b8a7123890a67930f2
Co-authored-by: Sebastian McKenzie <sebmck@fb.com>
Co-authored-by: John Knox <jknox@fb.com>
Co-authored-by: Emil Sjölander <emilsj@fb.com>
Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com>
2018-06-01 11:03:58 +01:00