[autolinking] Resolve cli for isolated modules before running node scripts (#23926)# Why This is the last fix to make `expo-modules-autolinking` work with isolated modules (e.g. pnpm). > ~~⚠
[autolinking] Resolve cli for isolated modules before running node scripts (#23926)# Why This is the last fix to make `expo-modules-autolinking` work with isolated modules (e.g. pnpm). > ~~⚠️ Note: this only fixes the iOS part, since we can use `__dir__`. I haven't found a proper alternative for Android's gradle unfortunately.~~ Android is now also fixed, see comments for more info. With isolated modules, we can only require direct project or package dependencies. Meaning that for `expo-modules-autolinking`, we have two options: 1. Resolve `expo-modules-autolinking` from the actual `.../expo-modules-autolinking/scripts` folder (parent folder is the module) 2. Resolve the full dependency chain from the root of the project: `expo > expo-modules-autolinking` # How - Resolve `expo-modules-autolinking` from script's directory before executing Node command from iOS cocoapods script (option 1) - Resolve `expo` > `expo-modules-autolinking` from the project root before executing Node command in gradle (option 2 - no viable option 1 alternative in gradle) # Test Plan - `$ pnpm create expo ./test-isolated-modules -t tabs` - `$ cd ./test-isolated-modules` - Patch autolinking - `$ pnpm expo install expo-dev-client` _(or any other module, containing other modules)_ - `$ pnpm expo run:ios` _(should work and include all nested dependencies of `expo-dev-client`)_ Or see this repo: https://github.com/byCedric/expo-pnpm-tests/blob/main/patches/expo-modules-autolinking%401.5.0.patch # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
show more ...
[core][Android] Made `generateExpoModulesPackageList` task cacheable (#23847)# Why Made the `generateExpoModulesPackageList` task cache friendly to save a little time during compilation. It's
[core][Android] Made `generateExpoModulesPackageList` task cacheable (#23847)# Why Made the `generateExpoModulesPackageList` task cache friendly to save a little time during compilation. It's not much - on my M1, it saves around 1.7 seconds. # How Added task `inputs` and `outputs`. # Test Plan - bare-expo ✅
[build-properties][autolinking] add extraPods and extraMavenRepos (#22785)# Why some third-party libraries require developers to add extra cocoapods or maven dependencies. this pr adds this cust
[build-properties][autolinking] add extraPods and extraMavenRepos (#22785)# Why some third-party libraries require developers to add extra cocoapods or maven dependencies. this pr adds this customization to expo-build-properties. unlike other properties which are processed by the config-plugins, the dependencies are added by expo-modules-autolinking. close ENG-8503 # How - [build-properties] add `android.extraMavenRepos` and `ios.extraPods` configs and validations. - [autolinking] read the expo-build-properties from config and add the dependencies through autolinking - [docs] `et generate-docs-api-data -p expo-build-properties` # Test Plan - ci passed - integration test on bare-expo 1. add the following properties to **apps/bare-expo/app.json** ```json "plugins": [ [ "expo-build-properties", { "android": { "extraMavenRepos": ["https://customers.pspdfkit.com/maven/"] }, "ios": { "extraPods": [ { "name": "Protobuf" } ] } } ] ] ``` 2. add `implementation 'com.pspdfkit:libraries-java:1.4.1'` to **apps/bare-expo/android/app/build.gradle** 2. Run `npx pod-install` and verify whether Protobuf is added to Podfile.lock 3. Run `./gradlew :app:assembleDebug` and see if the pspdfkit artifact is resolved --------- Co-authored-by: Tomasz Sapeta <[email protected]> Co-authored-by: Aman Mittal <[email protected]>
[autolinking] Introduce gradle plugin autolinking (#21377)# Why for #21327 because it introduces a gradle plugin inside expo-dev-launcher # How add android gradle plugin autolinking suppor
[autolinking] Introduce gradle plugin autolinking (#21377)# Why for #21327 because it introduces a gradle plugin inside expo-dev-launcher # How add android gradle plugin autolinking support. ~for security reasons, currently only support expo-dev-launcher.~ updates: we will have a highlighted log: # Test Plan ci passed
[autolinking] Suppress node warnings about deprecated exports mapping (#21222)
[autolinking] Support multiple podspecs and gradle projects in a package (#16511)# Why - support the case where a package has multiple podspecs, e.g. [react-native-maps](https://github.com/reac
[autolinking] Support multiple podspecs and gradle projects in a package (#16511)# Why - support the case where a package has multiple podspecs, e.g. [react-native-maps](https://github.com/react-native-maps/react-native-maps/blob/master/docs/installation.md#enabling-google-maps) - being less intrusive to 3rd party libraries when we proposing expo integration. for example, current integration to [reanimated add one line to existing code](https://github.com/software-mansion/react-native-reanimated/blob/a870aa28092322b627695f8cf2ea0dce4db34a53/android-npm/build.gradle#L111) and [turn reanimated gradle project to a different form](https://github.com/software-mansion/react-native-reanimated/blob/a870aa28092322b627695f8cf2ea0dce4db34a53/android-npm/expo/linking.gradle#L15-L45). - expo reanimated integration had introduced some issues as following. based on this, i think we should have a dedicated gradle project. - https://github.com/software-mansion/react-native-reanimated/issues/2711 - https://github.com/software-mansion/react-native-reanimated/pull/2713#issuecomment-1024341773 # How - support multiple podspec linking - `*/*.podspec` - support multiple build.gradle linking - `*/build.gradle` - ~introduce special expo adapter integration where we can put all stuffs including `expo-module.config.json` in `expo/` folder in this case, rn-cli's autolinking will link `RNThirdParty.podspec` and `android/build.gradle`. expo autolinking will link `RNThirdPartyExpoAdapter.podspec` and `expo/android/build.gradle`~ - add expo-module.config.js `android.gradlePath` support to specify custom gradle file paths. # Test Plan ## Unit Tests ``` PASS src/platforms/__tests__/android-test.ts resolveModuleAsync ✓ should resolve android/build.gradle (2 ms) ✓ should resolve multiple gradle files (1 ms) convertPackageNameToProjectName ✓ should strip invalid characters (1 ms) ✓ should convert scoped package name to dash ✓ should have differentiated name for multiple projects ✓ should support expo adapter name PASS src/autolinking/__tests__/findModules-test.ts findModulesAsync ✓ should link top level package (2 ms) ✓ should link scoped level package (1 ms) PASS src/platforms/__tests__/ios-test.ts resolveModuleAsync ✓ should resolve podspec in ios/ folder ✓ should resolve multiple podspecs (1 ms) ``` ## Integration Tests - create extra `ios2/EXApplication2.podspec` in expo-application - create extra `android2/build.gradle` in expo-application - check rn-cli autolinking and expo autolinking co-existence compatibility - move `use_native_modules!` before `use_expo_modules!` in Podfile - create extra `ios2/RNReanimated2.podspec` in reanimated and check whether it's linked. Co-authored-by: Tomasz Sapeta <[email protected]>
[autolinking][android] Fix `cannot cast object 'ExpoAutolinkingManager@' with class 'ExpoAutolinkingManager' to class 'ExpoAutolinkingManager'` (#16545)# Why Closes ENG-4204. # How If a pr
[autolinking][android] Fix `cannot cast object 'ExpoAutolinkingManager@' with class 'ExpoAutolinkingManager' to class 'ExpoAutolinkingManager'` (#16545)# Why Closes ENG-4204. # How If a project is using `buildSrc`, the Gradle will use different class loaders for `settings.gradle` and for `build.gradle` scripts in modules. Because of that, we can't cast manager created in `settings.gradle` to `ExpoAutolinkingManager` in the `build.gradle` of expo package. I didn't find any workaround, but we don't have to make that cast. # Test Plan - build project with `buildSrc` ✅
[android] Fix building error from outside of project root (#15109)# Why our gradle script will break if building from outside of the project root. especially for appcenter to build a monorepo pr
[android] Fix building error from outside of project root (#15109)# Why our gradle script will break if building from outside of the project root. especially for appcenter to build a monorepo project, the gradle execution is in this case: `./packages/sdk43mono/android/gradlew -p packages/sdk43mono/android :app:assembleDebug` fixes #14944 # How passing working directory for [`String.execute`](https://docs.groovy-lang.org/latest/html/groovy-jdk/java/lang/String.html#execute(java.lang.String[],%20java.io.File)) # Test Plan 1. monorepo test repo: https://gitlab.com/kudochien/rnmono and run with `./packages/sdk43mono/android/gradlew -p packages/sdk43mono/android :app:assembleDebug`. note that this repo is include the fixes. 2. test from bare-expo: ```sh cd $HOME /path/to/expo/apps/bare-expo/android/gradlew -p /path/to/expo/apps/bare-expo/android :app:assembleDebug ``` Co-authored-by: Tomasz Sapeta <[email protected]>
[modules-autolinking] Fix used expo modules output list in gradle (#14442)
Revert "[modules-autolinking] Fix used expo modules output list in gradle"This reverts commit de1b60ba609960a51b96638d994d69bdc8802890.
[modules-autolinking] Fix used expo modules output list in gradle
Make expo package linkable by RN instead of expo-modules-core (#14277)
[auto-linking] Parameters audit (#14318)# Why Makes parameter audit before release. # How Made sure that every parameter is written in the camel case notation and added the `modulesPaths`
[auto-linking] Parameters audit (#14318)# Why Makes parameter audit before release. # How Made sure that every parameter is written in the camel case notation and added the `modulesPaths` parameter on Android for backward compatibility. - Added `modulesPaths` (doing the same as `searchPaths` on Android). - Replaced `provider_name` with `providerName`. - Removed unsed filed from `ResolveOptions` - `packageListTarget`. # Test Plan - bare-expo ✅
[autolinking] Fix circular dependency (#14111)# Why Fixes circular dependency caused by auto-linking. # How For some reason, sometimes Gradle calls `addExpoModulesDependencies` with the in
[autolinking] Fix circular dependency (#14111)# Why Fixes circular dependency caused by auto-linking. # How For some reason, sometimes Gradle calls `addExpoModulesDependencies` with the incorrect project (`expo-modules-core` instead of `expo-modules-linker`) which leads to a circular dependency. For now, we just ignore that case and wait for the correct invocation of `addExpoModulesDependencies`. # Test Plan - bare-expo ✅ - run `Android Shell App` task ✅
[autolinking][android] Move autolinking.gradle to `expo-modules-autolinking` (#14082)# Why Part of migration to `expo-modules-core` # How Move content of the `autolinking.gradle` to `expo-
[autolinking][android] Move autolinking.gradle to `expo-modules-autolinking` (#14082)# Why Part of migration to `expo-modules-core` # How Move content of the `autolinking.gradle` to `expo-modules-autolinking`. # Test Plan - bare-expo ✅