Skip to content

Commit

Permalink
autoinstall unimodules in Expo Client (#3578)
Browse files Browse the repository at this point in the history
# Why

Follow-up unimodules/react-native-unimodules#2

# How

- Added minimal `unimodule.json` configs to all React Native unimodule packages.
- Used autoinstallation functions from `react-native-unimodules` on iOS and Android

# Test Plan

- [x] Gradle sync on Android project
- [x] `cd tools-public && ./generate-files-ios.js && cd ../ios && pod install`
  • Loading branch information
tsapeta committed Mar 11, 2019
1 parent 78d4df1 commit 0475ef8
Show file tree
Hide file tree
Showing 88 changed files with 646 additions and 356 deletions.
87 changes: 28 additions & 59 deletions android/expoview/build.gradle
Expand Up @@ -107,6 +107,11 @@ configurations.all {
}
}

// WHEN_DISTRIBUTING_REMOVE_FROM_HERE
// Import gradle helpers for unimodules.
apply from: "../../node_modules/react-native-unimodules/gradle.groovy"
// WHEN_DISTRIBUTING_REMOVE_TO_HERE

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api 'com.android.support:multidex:1.0.3'
Expand Down Expand Up @@ -184,67 +189,31 @@ dependencies {
api project(':ReactAndroid')

// Universal modules
api project(':expo-app-loader-provider')
api project(':expo-core')
api project(':expo-constants')
api project(':expo-constants-interface')
api project(':expo-document-picker')
api project(':expo-errors')
api project(':expo-permissions')
api project(':expo-permissions-interface')
api project(':expo-react-native-adapter')
api project(':expo-sensors-interface')
api project(':expo-task-manager')
api project(':expo-task-manager-interface')

// Optional universal modules
// They're defined as "api" so we don't have to define them again in app/build.gradle
// In distribution they're "compileOnly" and it's the app/build.gradle who manages them.
api project(':expo-ads-admob')
api project(':expo-ads-facebook')
api project(':expo-analytics-amplitude')
api project(':expo-analytics-segment')
api project(':expo-app-auth')
api project(':expo-av')
api project(':expo-background-fetch')
api project(':expo-barcode-scanner')
api project(':expo-barcode-scanner-interface')
api project(':expo-brightness')
api project(':expo-calendar')
api project(':expo-camera')
api project(':expo-camera-interface')
api project(':expo-contacts')
api project(':expo-crypto')
api project(':expo-facebook')
api project(':expo-face-detector')
api project(':expo-file-system')
api project(':expo-file-system-interface')
api project(':expo-font')
api project(':expo-gl')
api project(':expo-gl-cpp')
api project(':expo-google-sign-in')
api project(':expo-haptics')
api project(':expo-image-loader-interface')
api project(':expo-image-manipulator')
api project(':expo-image-picker')
api project(':expo-intent-launcher')
api project(':expo-keep-awake')
api project(':expo-linear-gradient')
api project(':expo-local-authentication')
api project(':expo-localization')
api project(':expo-location')
api project(':expo-mail-composer')
api project(':expo-media-library')
api project(':expo-payments-stripe')
api project(':expo-print')
api project(':expo-random')
api project(':expo-secure-store')
api project(':expo-sensors')
api project(':expo-sharing')
api project(':expo-sms')
api project(':expo-speech')
api project(':expo-sqlite')
api project(':expo-web-browser')
useUnimodules([
modulesPaths: ['../../packages'],
configuration: 'api',
target: 'react-native',
exclude: [
'expo-firebase-analytics',
'expo-firebase-app',
'expo-firebase-auth',
'expo-firebase-crashlytics',
'expo-firebase-database',
'expo-firebase-firestore',
'expo-firebase-functions',
'expo-firebase-instance-id',
'expo-firebase-invites',
'expo-firebase-links',
'expo-firebase-messaging',
'expo-firebase-notifications',
'expo-firebase-performance',
'expo-firebase-remote-config',
'expo-firebase-storage',
'expo-module-template',
]
])

// Versioned react native
// WHEN_PREPARING_SHELL_REMOVE_FROM_HERE
Expand Down
94 changes: 25 additions & 69 deletions android/settings.gradle
Expand Up @@ -18,73 +18,29 @@ project(':ReactAndroid').projectDir = new File(rootDir, 'ReactAndroid')
project(":expoview-$abiVariant").projectDir = new File(rootDir, "versioned-abis/expoview-$abiVariant")
})

// Universal modules
// Import gradle helpers for unimodules.
apply from: '../node_modules/react-native-unimodules/gradle.groovy'

def modulesDir = new File(rootDir, "../packages")

def includeUniversalModule = { name ->
include ":$name"
project(":$name").projectDir = new File(modulesDir, "$name/android")
}

[
'expo-ads-admob',
'expo-ads-facebook',
'expo-analytics-amplitude',
'expo-analytics-segment',
'expo-app-auth',
'expo-app-loader-provider',
'expo-av',
'expo-background-fetch',
'expo-barcode-scanner',
'expo-barcode-scanner-interface',
'expo-brightness',
'expo-calendar',
'expo-camera',
'expo-camera-interface',
'expo-constants',
'expo-constants-interface',
'expo-contacts',
'expo-core',
'expo-crypto',
'expo-document-picker',
'expo-errors',
'expo-face-detector',
'expo-face-detector-interface',
'expo-facebook',
'expo-file-system',
'expo-file-system-interface',
'expo-font',
'expo-font-interface',
'expo-gl',
'expo-gl-cpp',
'expo-google-sign-in',
'expo-haptics',
'expo-image-loader-interface',
'expo-image-manipulator',
'expo-image-picker',
'expo-intent-launcher',
'expo-keep-awake',
'expo-linear-gradient',
'expo-local-authentication',
'expo-localization',
'expo-location',
'expo-mail-composer',
'expo-media-library',
'expo-payments-stripe',
'expo-permissions',
'expo-permissions-interface',
'expo-print',
'expo-random',
'expo-react-native-adapter',
'expo-secure-store',
'expo-sensors',
'expo-sensors-interface',
'expo-sharing',
'expo-sms',
'expo-speech',
'expo-sqlite',
'expo-task-manager',
'expo-task-manager-interface',
'expo-web-browser'
].forEach({ moduleName -> includeUniversalModule(moduleName) })
// Include unimodules.
includeUnimodules([
modulesPaths: ['../../packages'],
target: 'react-native',
exclude: [
'expo-firebase-analytics',
'expo-firebase-app',
'expo-firebase-auth',
'expo-firebase-crashlytics',
'expo-firebase-database',
'expo-firebase-firestore',
'expo-firebase-functions',
'expo-firebase-instance-id',
'expo-firebase-invites',
'expo-firebase-links',
'expo-firebase-messaging',
'expo-firebase-notifications',
'expo-firebase-performance',
'expo-firebase-remote-config',
'expo-firebase-storage',
'expo-module-template',
]
])
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Expand Up @@ -2102,6 +2102,6 @@ SPEC CHECKSUMS:
yogaABI31_0_0: 7978689ddccec43cffd5914889304cf3b7fd7c77
yogaABI32_0_0: b6e0ba3796cd5e47ccea0454694e605a1cfc817a

PODFILE CHECKSUM: 26e74b09df5ac17e748b2d15f7d5785bea524727
PODFILE CHECKSUM: ce0101a624a69a0a88530ef162d81d176c4e4fe5

COCOAPODS: 1.5.3
2 changes: 1 addition & 1 deletion ios/Pods/Headers/Private/EXSQLite/EXSQLite.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ios/Pods/Headers/Public/EXSQLite/EXSQLite.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ios/Pods/Local Podspecs/EXAppAuth.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ios/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0475ef8

Please sign in to comment.