Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1690 from Plant-for-the-Planet-org/feature/update…
Browse files Browse the repository at this point in the history
…-react-native-packages

Feature/update react native packages
  • Loading branch information
norbertschuler authored Dec 5, 2019
2 parents 9e31e98 + 46de235 commit 957484c
Show file tree
Hide file tree
Showing 43 changed files with 493 additions and 2,509 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:react/recommended"
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ DerivedData
*.ipa
*.xcuserstate
project.xcworkspace
Podfile.lock
ios/Pods/*

# Android/IntelliJ
#
Expand Down
157 changes: 0 additions & 157 deletions android/app/bin/build.gradle

This file was deleted.

47 changes: 26 additions & 21 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import com.android.build.OutputFile
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
Expand Down Expand Up @@ -73,11 +76,15 @@ import com.android.build.OutputFile
*/

project.ext.react = [
entryFile: "index.native.js"
entryFile: "index.native.js",
enableHermes: true,
root: "../../",
]
def jscFlavor = 'org.webkit:android-jsc:+'
def useIntlJsc = false
def enableHermes = project.ext.react.get("enableHermes", true);

apply from: "../../node_modules/react-native/react.gradle"

project.ext.vectoricons = [
iconFontNames: ['FontAwesome.ttf', 'FontAwesome5_Brands.ttf', 'FontAwesome5_Regular.ttf', 'FontAwesome5_Solid.ttf',
'MaterialIcons.ttf'] // Name of the font files you want to copy
Expand Down Expand Up @@ -145,7 +152,7 @@ android {
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
// https://developer.android.com/studio/build/configure-apk-splits.html
def versionCodes = ["armeabi-v7a":5, "x86":6, "arm64-v8a": 7, "x86_64": 8]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
Expand All @@ -166,27 +173,23 @@ android {
}

dependencies {
implementation project(':react-native-vector-icons')
//implementation project(':react-native-paypal-wrapper')
implementation project(':@react-native-community_async-storage')
implementation project(':react-native-fs')
implementation project(':react-native-pdf')
implementation project(':rn-fetch-blob')
implementation project(':react-native-vector-icons')
implementation project(':react-native-image-crop-picker')
implementation project(':react-native-document-picker')
implementation project(':react-native-linear-gradient')
implementation project(':bugsnag-react-native')
implementation project(':react-native-youtube')
//compile project(':tipsi-stripe')
implementation project(':react-native-device-info')
implementation project(':react-native-image-picker')
implementation project(':react-native-i18n')
implementation project(':react-native-svg')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "androidx.appcompat:appcompat:1.0.0"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.facebook.fresco:animated-gif:1.10.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha03'
if (useIntlJsc) {
implementation 'org.webkit:android-jsc-intl:+'
} else {
implementation 'org.webkit:android-jsc:+'
}
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}

// Run this once to be able to run the application with BUCK
Expand All @@ -195,3 +198,5 @@ task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
13 changes: 13 additions & 0 deletions android/app/src/main/java/org/pftp/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package org.pftp;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

public class MainActivity extends ReactActivity {

Expand All @@ -12,4 +15,14 @@ public class MainActivity extends ReactActivity {
protected String getMainComponentName() {
return "TreecounterApp";
}

@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
}
87 changes: 26 additions & 61 deletions android/app/src/main/java/org/pftp/MainApplication.java
Original file line number Diff line number Diff line change
@@ -1,81 +1,46 @@
package org.pftp;

import android.app.Application;
import com.facebook.react.PackageList;

import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
//import com.taessina.paypal.RNPaypalWrapperPackage;
import com.rnfs.RNFSPackage;
import org.wonday.pdf.RCTPdfView;
import com.RNFetchBlob.RNFetchBlobPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import io.github.elyx0.reactnativedocumentpicker.DocumentPickerPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.bugsnag.BugsnagReactNative;
import com.inprogress.reactnativeyoutube.ReactNativeYouTube;
//import com.gettipsi.stripe.StripeReactPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.imagepicker.ImagePickerPackage;
import com.AlexanderZaytsev.RNI18n.RNI18nPackage;
import com.horcrux.svg.SvgPackage;

import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
// import com.reactlibrary.RNTooltipsPackage;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}

@Override
protected String getJSMainModuleName() {
return "index";
}
};

@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new AsyncStoragePackage(),
//new RNPaypalWrapperPackage(),
new RNFSPackage(),
new RCTPdfView(),
new RNFetchBlobPackage(),
new VectorIconsPackage(),
new PickerPackage(),
new DocumentPickerPackage(),
new LinearGradientPackage(),
BugsnagReactNative.getPackage(),
new ReactNativeYouTube(),
// new StripeReactPackage(),
new RNDeviceInfo(),
new ImagePickerPackage(),
new RNI18nPackage(),
new SvgPackage()
// new RNTooltipsPackage()
);
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}

@Override
protected String getJSMainModuleName() {
return "index";
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
};

@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}

@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
Loading

0 comments on commit 957484c

Please sign in to comment.