Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android] Added community linking to bare-expo #6705

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions apps/bare-expo/android/app/build.gradle
Expand Up @@ -184,11 +184,8 @@ android {
}

dependencies {
implementation project(':react-native-reanimated')
implementation project(':react-native-gesture-handler')
implementation project(":react-native-screens")
implementation project(':react-native-safe-area-context')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules

def packageJsonFile = new File(rootProject.projectDir, '../package.json')
Expand Down Expand Up @@ -253,5 +250,9 @@ class GenerateDynamicMacrosPlugin implements Plugin<Project> {
}
}

apply from: file("../../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
applyNativeModulesAppBuildGradle(project)

// [Custom]: Add Google Services file
apply plugin: GenerateDynamicMacrosPlugin
apply plugin: 'com.google.gms.google-services'
Expand Up @@ -2,17 +2,21 @@

import android.app.Application;

import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.swmansion.reanimated.ReanimatedPackage;
import com.th3rdwave.safeareacontext.SafeAreaContextPackage;

import org.unimodules.adapters.react.ReactAdapterPackage;
import org.unimodules.adapters.react.ModuleRegistryAdapter;
import org.unimodules.adapters.react.ReactModuleRegistryProvider;
import org.unimodules.core.interfaces.Package;
import org.unimodules.core.interfaces.SingletonModule;
import expo.modules.constants.ConstantsPackage;
import expo.modules.permissions.PermissionsPackage;
import expo.modules.filesystem.FileSystemPackage;

import java.util.Arrays;
import java.util.List;
Expand All @@ -21,8 +25,8 @@

public class MainApplication extends Application implements ReactApplication {
private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(
new BasePackageList().getPackageList(),
null
new BasePackageList().getPackageList(),
Arrays.<SingletonModule>asList()
);

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
Expand All @@ -33,15 +37,12 @@ public boolean getUseDeveloperSupport() {

@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ReanimatedPackage(),
new RNGestureHandlerPackage(),
new SafeAreaContextPackage(),
new ModuleRegistryAdapter(mModuleRegistryProvider)
);
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
return packages;
}


@Override
protected String getJSMainModuleName() {
return "index";
Expand Down
4 changes: 3 additions & 1 deletion apps/bare-expo/android/build.gradle
Expand Up @@ -16,7 +16,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.android.tools.build:gradle:3.5.2'

// Copied version from the Exponent Android project.
// Newer versions suffer either from "play-services-basement was supposed to be 15.0.1,
Expand All @@ -32,11 +32,13 @@ buildscript {
def packageJsonFile = new File(rootProject.projectDir, '../package.json')
def packageJson = new JsonSlurper().parseText(packageJsonFile.text)

// [Custom]
ext {
reactNativeVersion = packageJson.dependencies["react-native"]
}

allprojects {
// [Custom]
configurations.all {
resolutionStrategy.force "com.facebook.react:react-native:${reactNativeVersion}"
}
Expand Down
13 changes: 2 additions & 11 deletions apps/bare-expo/android/settings.gradle
Expand Up @@ -2,17 +2,8 @@ import groovy.json.JsonSlurper

apply from: '../../../node_modules/react-native-unimodules/gradle.groovy'

include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-gesture-handler/android')

include ':react-native-reanimated'
project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-reanimated/android')

include ':react-native-screens'
project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-screens/android')

include ':react-native-safe-area-context'
project(':react-native-safe-area-context').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-safe-area-context/android')
apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
applyNativeModulesSettingsGradle(settings)

// Unimodules

Expand Down