Commit Graph

41 Commits

Author SHA1 Message Date
Aaron Chiu 1feb462f44 Add LazyReactPackage
Summary:
LazyReactPackage is an extension of ReactPackage that allows us to lazily construct native modules.
It's a separate class to avoid breaking existing packages both internally and in open source.

Reviewed By: astreet

Differential Revision: D3334258

fbshipit-source-id: e090e146adc4e8e156cae217689e2258ab9837aa
2016-08-10 17:13:27 -07:00
Think Wu 37df151562 fix cleanReactNdkLib task failure caused by module not found
Summary:
The `clean` task always fail due to the failure of the `cleanReactNdkLib` task, error messages:

```
:ReactAndroid:cleanReactNdkLib
Android NDK: /my/react-native/ReactAndroid/src/main/jni/react/jni/Android.mk: Cannot find module with tag 'react' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make: Entering directory `/my/react-native/ReactAndroid/src/main/jni/react/jni'
make: Leaving directory `/my/react-native/ReactAndroid/src/main/jni/react/jni'
/my/react-native/ReactAndroid/src/main/jni/react/jni/Android.mk:31: *** Android NDK: Aborting.    .  Stop.
:ReactAndroid:cleanReactNdkLib FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ReactAndroid:cleanReactNdkLib'.
> Process 'command '/usr/local/opt/android-ndk/ndk-build'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info
Closes https://github.com/facebook/react-native/pull/7935

Differential Revision: D3646120

Pulled By: bestander

fbshipit-source-id: c869ff4a2d3407643fdeec431f454071747eb429
2016-07-29 17:58:26 -07:00
Andrew Jack c47f7457c0 Update OkHttp to 3.4.0 and Okio to 1.9.0
Summary:
- 3.3.1 wasn't compatible with Robolectric 3.0, however 3.4.0 [fixes](https://github.com/square/okhttp/issues/2533#issuecomment-230198063) this issue.
- Few other fixes to OkHttp mentioned in the [CHANGELOG.md](https://github.com/square/okhttp/blob/master/CHANGELOG.md)

> Fixes: #7743
>
- Android apps can recover from a `REFUSED_STREAM` in HTTP/2.
- A few other fixes mentioned in the [CHANGELOG.md](https://github.com/square/okhttp/blob/master/CHANGELOG.md)

- CircleCi
- Test with `/Examples` 
Closes https://github.com/facebook/react-native/pull/8672

Reviewed By: alsutton

Differential Revision: D3541293

Pulled By: bestander

fbshipit-source-id: 76429861b4f4df15cb9c18ab0f177daee3e1459d
2016-07-20 06:43:33 -07:00
Michał Gregorczyk dd06b74157 Make SoLoader an external dependency
Reviewed By: bestander

Differential Revision: D3535233

fbshipit-source-id: 9fddb654123a7606d46069a98e2f68dec7f520fa
2016-07-08 16:48:13 -07:00
Marc Horowitz 7f790dc0de Pull an updated version of fbjni into RN OSS
Differential Revision: D3521227

fbshipit-source-id: 57db97ea2af2b2c9e55f380ce05d9e78a5f9d48c
2016-07-06 12:58:42 -07:00
Chris Hopman c1f7aa3824 Change gradle ndk build inputs back to what they were
Reviewed By: bestander

Differential Revision: D3442666

fbshipit-source-id: 735cb7e908670fa9b1ec58a533a2c59008ccc154
2016-06-30 14:28:23 -07:00
leeight 658acba0b6 Add missing `java` directory in ReactAndroid/build.gradle
Summary:
Fix Android Studio warnings for https://github.com/facebook/SoLoader package.
Closes https://github.com/facebook/react-native/pull/8221

Differential Revision: D3492863

Pulled By: bestander

fbshipit-source-id: 984c24f3a3bc084adf1b79e24b33da0c01a6e4c6
2016-06-28 04:28:23 -07:00
Andrei Coman 675c55e8ad Update fresco from 0.10.0 to 0.11.0
Summary: Updating to new release from 16.06.2016.

Reviewed By: bestander

Differential Revision: D3444598

fbshipit-source-id: d8c14b3d088bab6c08effcdacde9bf2eccb20d68
2016-06-17 02:58:24 -07:00
Konstantin Raev 192f6ddf82 another fix to OSS tests
Summary: Closes https://github.com/facebook/react-native/pull/8151

Differential Revision: D3444091

fbshipit-source-id: a8a43a56332c66b0af84695aa54fb1e4c5d659f6
2016-06-16 04:14:28 -07:00
Chris Hopman d344963123 Invert native dependency of new bridge -> old bridge
Reviewed By: mhorowitz

Differential Revision: D3409230

fbshipit-source-id: 541309ec953843477197e5a2b13730b8a38f608d
2016-06-13 18:43:42 -07:00
Chris Hopman 5e8f1716fc Build new bridge with gradle
Reviewed By: bestander

Differential Revision: D3324351

fbshipit-source-id: 41fa18a23c8661440a7deff244c93278f418e1d9
2016-05-27 16:13:37 -07:00
Andrew Jack 6bbaff2944 Upgrade to OkHttp3
Summary:
Update to [OkHttp](https://github.com/square/okhttp) to [OkHttp3](https://publicobject.com/2015/12/12/com-squareup-okhttp3/)

We must also update:
- Fresco to 0.10.0
- okio to 1.8.0

**Motivation**
Reasons for upgrading:
* Issue #4021
* "We discovered that RN Android sometimes fails to connect to the latest stable version of NGINX when HTTP/2 is enabled. We aren't seeing errors with other HTTP clients so we think it's specific to RN and OkHttp. Square has fixed several HTTP/2 bugs over the past eight months." - ide
* OkHttp3 will be maintained & improved, but OkHttp2 will only receive [security fixes](https://publicobject.com/2016/02/11/okhttp-certificate-pinning-vulnerability/)
* Cleaner APIs - "Get and Set prefixes are avoided"
* Deprecated/Removed - HttpURLConnection & Apache HTTP
* React Native apps are currently being forced to bundle two versions of OkHttp (v2 & v3), if another library uses v3
* Improved WebSocket performance - [CHANGELOG.md](https://github.com/square/okhttp/blob/master
Closes https://github.com/facebook/react-native/pull/6113

Reviewed By: andreicoman11, lexs

Differential Revision: D3292375

Pulled By: bestander

fbshipit-source-id: 7c7043eaa2ea63f95854108b401c4066098d67f7
2016-05-17 12:43:39 -07:00
Andy Street 6a2603745e Fix build break of react native exopackage apps
Reviewed By: lexs

Differential Revision: D3229733

fb-gh-sync-id: e74a2d4fbbdf019f898f87a05bdbd31b4e233463
fbshipit-source-id: e74a2d4fbbdf019f898f87a05bdbd31b4e233463
2016-04-27 08:02:24 -07:00
Martin Konicek bc32e06e56 Add an option to load the Boost library from the filesystem
Summary:Building React Native for Android from source the first time is quite slow. A large part of the time is spent downloading the Boost C++ library. If the code is already present on the system, there's no need to download it.
**Test plan**

CircleCI tests on this pull request. The env variable is not defined on CircleCI so this pull request should have no effect.
Closes https://github.com/facebook/react-native/pull/7116

Differential Revision: D3207397

Pulled By: mkonicek

fb-gh-sync-id: 3454947f6c90fda0d8d2cbb17a1af518e45b47fd
fbshipit-source-id: 3454947f6c90fda0d8d2cbb17a1af518e45b47fd
2016-04-21 06:48:22 -07:00
Konstantin Raev b2ecc83ead fixed test dependency broken in D3168150
Summary:fixes Circle
Closes https://github.com/facebook/react-native/pull/6978

Differential Revision: D3179133

fb-gh-sync-id: 6558168735b4097a68bf7423a7c249a45cc2684a
fbshipit-source-id: 6558168735b4097a68bf7423a7c249a45cc2684a
2016-04-14 07:50:22 -07:00
Saurabh Aggarwal 3c488afb0f Remove stetho dependency in OSS react native's NetworkingModule
Reviewed By: astreet

Differential Revision: D3038280

fb-gh-sync-id: 169e21b9276f928b7144ebf2f3b8487b5e87c073
shipit-source-id: 169e21b9276f928b7144ebf2f3b8487b5e87c073
2016-03-23 12:41:24 -07:00
Michael Lee e4eb84fa70 Upgrade folly dependency
Summary: Folly deprecated the brace initialization for dynamic::array, so point to a more recent tarball and fix it.

Reviewed By: bestander

Differential Revision: D3066402

fb-gh-sync-id: aaf70423886cb0cbc14aba7878a1d4e32bce82b1
shipit-source-id: aaf70423886cb0cbc14aba7878a1d4e32bce82b1
2016-03-18 10:34:26 -07:00
Dave Miller db7a154360 Open source Modal
Summary: This open sources an internal Modal View

Reviewed By: mkonicek

Differential Revision: D3065229

fb-gh-sync-id: 763996aef375883d94f70e617bfc7835a9cecb6f
shipit-source-id: 763996aef375883d94f70e617bfc7835a9cecb6f
2016-03-18 04:21:48 -07:00
Konstantin Raev f827f7b79a instrumentation tests are executed with BUCK
Summary:Added ability to run instrumentation tests with BUCK.

This change uses BUCK to build and run instrumentation tests facebook style.
The gains are that we can execute the same tests internally at FB and in OSS.
Also running tests not via graddle:connect command is 1.5 minutes faster.

I'll keep keep an eye on stability Gradle and BUCK builds for a while.
Closes https://github.com/facebook/react-native/pull/6176

Differential Revision: D2999878

Pulled By: bestander

fb-gh-sync-id: d715ba231769e57100685a1256f2e530c589921c
shipit-source-id: d715ba231769e57100685a1256f2e530c589921c
2016-03-02 06:55:35 -08:00
Konstantin Raev 5112a63953 Added ability to run Movies app with BUCK
Reviewed By: mkonicek

Differential Revision: D2874873

fb-gh-sync-id: 9feface8d9a18742e68206dbafb804de25f53ed8
shipit-source-id: 9feface8d9a18742e68206dbafb804de25f53ed8
2016-02-25 17:15:58 -08:00
Konstantin Raev 6ecfb61147 fixes gradle dependencies for compile and test
Summary: Closes https://github.com/facebook/react-native/pull/5676

Reviewed By: svcscm

Differential Revision: D2886944

Pulled By: androidtrunkagent

fb-gh-sync-id: 9cb68883cd38c31e588222bc746b5e296962c845
2016-02-01 13:23:36 -08:00
Konstantin Raev f6187565ac fixed gradle deps
Summary: Closes https://github.com/facebook/react-native/pull/5670

Reviewed By: svcscm

Differential Revision: D2885815

Pulled By: androidtrunkagent

fb-gh-sync-id: 670f731b0b12ca2f1b31f0a982f109ce4f736836
2016-02-01 09:42:29 -08:00
Martin Konicek 9fea485138 Build React Native with Buck
Reviewed By: bestander

Differential Revision: D2834002

fb-gh-sync-id: ebd5303a05fe9a01545365e4205d4cb8724a77a8
2016-01-18 12:39:16 -08:00
Alexander Blom 57f6cbb3dc Add annotation processor for @ReactProp
Summary:
The annotation processor finds subclasses of ViewManager and ShadowNode and generates classes that can both provide a mapping of property names to their type as well as a way of setting these properties.

This avoids having to do reflection to find the properties.

The annotation processor is currently not working when building with Gradle.

public

Reviewed By: astreet

Differential Revision: D2748958

fb-gh-sync-id: ded5b072d236ebf19fb43eaf704fc7f221a82c26
2016-01-07 03:52:58 -08:00
Konstantin Raev 88baaa1239 increased stability of circleCI e2e tests
Summary:
Out of 57 builds in the 5 days during Christmas only 15 were successful.
15 of the failed ones were caused by `com.android.ddmlib.ShellCommandUnresponsiveException` when running unstrumentation tests.
Another 10 were because of crashes probably related to memory usage.

This PR follows ideas from https://github.com/Originate/guide/blob/master/android/guide/Continuous%20Integration.md

So far I've made 6 successful builds with this setup.
Need to run it for a few more days to get accurate stats.
Closes https://github.com/facebook/react-native/pull/5021

Reviewed By: svcscm

Differential Revision: D2795713

Pulled By: androidtrunkagent

fb-gh-sync-id: 33373fed7ca7c5fb83b35cf551f8501286e33d7b
2015-12-30 11:39:32 -08:00
Konstantin Raev 308612314e added emulator support to circle.ci
Summary: Closes https://github.com/facebook/react-native/pull/4911

Reviewed By: svcscm

Differential Revision: D2789142

Pulled By: androidtrunkagent

fb-gh-sync-id: 9fd9520c27fc9acb7b139de6843a71ca3f918249
2015-12-24 10:40:28 -08:00
Konstantin Raev a99c5160ee Android Instrumentations tests are ready to be run in github/CI open source environment
Reviewed By: mkonicek

Differential Revision: D2769217

fb-gh-sync-id: 7469af816241d8b642753cca21f6542b971e9572
2015-12-21 09:39:57 -08:00
Martin Konicek 3a3af8a385 Open souce the Android Dialog module
Summary:
public

The `DialogModule` requires `android.support.v4.app.FragmentManager` which means
every app that wants to use Dialogs would need to have its Activity extend the legacy
`android.support.v4.app.FragmentActivity`.

This diff makes the `DialogModule` work with both the Support `FragmentManager`
(for AdsManager & potentially other fb apps) and the `android.app.FragmentManager`
(for new apps with no legacy dependencies).

Also wrap the native module in the same `Alert` API that we have on iOS and provide
a cross-platform example. In my opinion the iOS Alert API is quite nice and easy to use.

We still keep `AlertIOS` around because of its `prompt` function which is iOS-specific
and also for backwards compatibility.

Reviewed By: foghina

Differential Revision: D2647000

fb-gh-sync-id: e2280451890bff58bd9c933ab53cd99055403858
2015-12-17 11:11:13 -08:00
Krzysztof Magiera 2f56c0c90a Upgrade gradle to 2.9
Summary:
public

New version of gradle has a better support for zipTree copy task. Since we have a few of those including one for boost library which used to take very long, after upgrading we no longer need 6a656a1.

Also seems like many improvements made to gradle since 2.2 made it perform better on incremental builds (around 10% improvement on my laptop).

Command used to upgrade gradle version:

    gradle wrapper --gradle-version 2.9

Some of the plugins require updating as well since the previous versions were incompatible with gradle 2.9.

Closes https://github.com/facebook/react-native/pull/4462

Reviewed By: mkonicek

Differential Revision: D2754786

Pulled By: mkonicek

fb-gh-sync-id: 92c07d29aec6d5b4b2c55205b42b135c4d9479a9
2015-12-14 06:37:34 -08:00
Konstantin Raev 01983c2f0a Ability to run unit tests in react-android-github via gradle
Reviewed By: mkonicek

Differential Revision: D2699804

fb-gh-sync-id: 7b31287407bacf2e8e3de6ee1c723a11bb2a0f27
2015-11-27 04:20:19 -08:00
Saurabh Aggarwal a7c4ed106b Adds stetho interceptor to the OSS react native networking module
Reviewed By: mkonicek

Differential Revision: D2669416

fb-gh-sync-id: d061711a412348b16ffb877e0178a05460fd95f2
2015-11-20 09:44:27 -08:00
Krzysztof Magiera d8032b1c7d Upgrading okio and fresco.
Reviewed By: foghina

Differential Revision: D2636757

fb-gh-sync-id: 82dee46232ac2654870f727633604c86d569005e
2015-11-11 01:55:30 -08:00
Krzysztof Magiera caf111eb23 Update okhhtp version to 2.5
Reviewed By: andreicoman11

Differential Revision: D2636394

fb-gh-sync-id: 1f4df9ae879e16f13c5343baed85a91469d88cff
2015-11-10 03:20:29 -08:00
Krzysztof Magiera 6a656a1491 Speedup gradle builds by setting explicit deps on prepareBoost task.
Differential Revision: D2625574

fb-gh-sync-id: db0887e184a6d098699c9f84a2c3cb0d3b7e7b0f
2015-11-06 00:22:28 -08:00
Krzysztof Magiera 643769fc8e Fix dependency on recycler view in OSS.
Differential Revision: D2546027

fb-gh-sync-id: 7a2c2298332400fb216c18b8c569a859d1a3e1d0
2015-10-16 03:40:55 -07:00
Bret Johnson 5b0dd6432a Added a more explicit error message when ndk.dir / ANDROID_NDK is set,
Summary: but the NDK build command can't be found in that directory.   This
more explicit error now shows the full NDK path where it's looking
and (importantly) includes a hint that backslashes need to be escaped
on Windows for ndk.dir.   When I built on Windows the first time,
I didn't realize ndk.dir backslashes needed to be escaped and the
generic "not found" error made the root cause harder to track
down.   This change should help others that build on Windows & run into
the same.
Closes https://github.com/facebook/react-native/pull/2960

Reviewed By: @​svcscm

Differential Revision: D2470761

Pulled By: @kmagiera
2015-09-23 05:57:24 -07:00
Martin Konicek 6b733bdcf1 Minor fixes in comments
Reviewed By: @mkonicek

Differential Revision: D2463595

committer: Service User <svcscm@fb.com>
2015-09-21 14:39:36 -07:00
Martin Konicek 27ab039b6a Export latest Android changes 2015-09-17 14:33:28 +01:00
facebook-github-bot-6 6277a88555 Restore unintended sync 2015-09-16 10:38:42 -07:00
facebook-github-bot-6 0d09f22dbf Get back 100% in sync with fb codebase 2015-09-16 10:30:53 -07:00
Martin Konicek 42eb5464fd Release React Native for Android
This is an early release and there are several things that are known
not to work if you're porting your iOS app to Android.

See the Known Issues guide on the website.

We will work with the community to reach platform parity with iOS.
2015-09-14 18:13:39 +01:00