Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45468
This should greatly reduce the time spent on build_npm_package
because we're moving all the publishing logic to build_android.
I need to do a bit more testing with nightlies to make sure that everything is published correctly.
Changelog:
[Internal] [Changed] - Make build_android publish to the stating repositories
Reviewed By: cipolleschi
Differential Revision: D59804015
fbshipit-source-id: be3f0b6e16f5fdbf760ec7a5e16c8e258e06dd28
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44832
I'm renaming this folder as now we have 2 gradle plugins + we currently have
`package/react-native-gradle-plugin/react-native-gradle-plugin/` which is confusing so we can just call this folder `packages/gradle-plugin/`
to be consistent with the NPM package name
Changelog:
[Internal] [Changed] - packages/react-native-gradle-plugin/ -> packages/gradle-plugin/
Reviewed By: blakef
Differential Revision: D58284883
fbshipit-source-id: 5a7bb40a5d80f6fbab4ffb29e44107453f1013ec
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42656
I'm bumping the NDK to 26.1. As we already have a bump lined up to 26.0 on main,
it makes sense to go to .1 as it's declared the LTS:
https://github.com/android/ndk/wiki
Changelog:
[Android] [Changed] - Android NDK to 26.1
Reviewed By: NickGerleman
Differential Revision: D53083606
fbshipit-source-id: 12290efcfa8a72ab88c21ffe9507d08d5512d61b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41832
I'm removing the `installArchives` task and all the setup to publish
the Maven Local inside the NPM package as we're not using this entirely
and we won't be able to use it anyway (as the Maven Local is too big to fit an NPM package).
Changelog:
[Internal] [Changed] - Remove the installArchives task
Reviewed By: GijsWeterings
Differential Revision: D51890224
fbshipit-source-id: 3ffdc67a9fe931118596f6f74a5a2df0313ca3f2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41811
In this diff I'm extracting binaryCompatibilityValidator configuration into gradle.properties file. The goal is to reuse these properties from BUCK
changelog:[Internal] internal
Reviewed By: cortinico
Differential Revision: D51402033
fbshipit-source-id: 9b585dd07c5c00a39caadac47a2f0d605c5419f2
Summary:
In this diff I'm integrating 'org.jetbrains.kotlinx.binary-compatibility-validator' into RN Android build gradle system.
The tool allows dumping binary API of a JVM part of a Kotlin library that is public in the sense of Kotlin visibilities and ensures that the public binary API wasn't changed in a way that makes this change binary incompatible
More context on https://github.com/Kotlin/binary-compatibility-validator#building-the-project-locally
bypass-github-export-checks
Reviewed By: cortinico
Differential Revision: D51262577
fbshipit-source-id: 1894f4e55a4019e3ce1585e9df12dee69944e5ce
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39540
This simplifies the use of Codegen when creating dev builds of `rn-tester` in the monorepo. It now runs from source for this internal scenario, and this package is now built using the shared monorepo build setup.
Changes:
- Migrate `packages/react-native-codegen` to the shared `yarn build` setup.
- Update package to use `"exports"` field and wrap entry point modules with `babel-register` (NOTE: This is only required for each entry point internally used in the monorepo).
- Fixup small Flow syntax quirks that fail under `hermes-parser`.
- Remove `BuildCodegenCLITask` task from Android build.
- Remove Codegen `build.sh` call from iOS build, use `require.resolve` for `combine-js-to-schema-cli.js` entry point.
Externally significant FYIs:
- `react-native/codegen` is converted to use the `"exports"` field — it should export all `.js` files, as before.
- `codegenPath` is now ignored and marked as deprecated on `ReactExtensions.kt`.
NOTE: TypeScript auto-generation is not yet enabled on this package, since it uses CommonJS `module.exports` syntax (unsupported by `flow-api-translator`).
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D49370200
fbshipit-source-id: 992913155169912ea1a3cb24cb26efbd3f783058
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40935
This is scheduled to land in 0.74, so I'm removed the native integration as this is not needed anymore.
The only thing I left is a stub class to ease the migration out of `ReactNativeFlipper`.
Changelog:
[Android] [Removed] - Remove ReactNative/Flipper Integration
Reviewed By: mdvacca, huntie, cipolleschi
Differential Revision: D50259817
fbshipit-source-id: 28427425340896635607202cd78936f6030e78e0
Summary:
## Changelog:
[Internal] - Fix Nighlties that were broken due to changes for double publishing
Reviewed By: cortinico
Differential Revision: D50225219
fbshipit-source-id: dd1b96a956bb282caa40bd6f99b9a82554958746
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39795
X-link: https://github.com/facebook/yoga/pull/1412
Android NDK 25 uses a version of libc++ that is more than three years old, missing a lot of basic features of C++ 20. This is rectified in NDK 26 (latest LTS NDK), which brings us up to date with latest Clang (17, released this year), and adds a new policy where future NDK versions will bump libc++ as part of bumping LLVM/Clang.
This requires an a beta AGP version (and corresponding Android Studio Preview). Based on how far we are historically, it wouldn't be a surprise if we see the stable release this month (well before the RN 0.74/Yoga 3.0 cut, even in the worse case).
Changelog:
[Android][Changed] - Use NDK 26
Reviewed By: yungsters
Differential Revision: D49895949
fbshipit-source-id: 37bb4d1fdf81137be7f14f6675b4e079c6f861e4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39443
This task is unused in CI now and we can safely remove it from our build files.
Changelog:
[Internal] [Changed] - Remove unused downloadAll task
Reviewed By: mdvacca, cipolleschi
Differential Revision: D49233339
fbshipit-source-id: 558b44612b71bb1cb220cc21b8339835ae235302
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38886
This change introduces a property called `react.internal.useHermesNightly`
This allows users building RN-Tester or just ReactAndroid to fetch Hermes from the latest
nightly, without having to build it from source.
The change could be useful to speedup local development, but it should not be enabled on CI or when doing releases.
Changelog:
[Internal] [Changed] - Introduce react.internal.useHermesNightly
Reviewed By: mdvacca, cipolleschi
Differential Revision: D48188769
fbshipit-source-id: cb4330cb9082e9db0c7ba82e48b2d10030637353
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38946
I'm doing another pass of moving all the various version numbers of the Gradle Plugin inside the `[plugins]` section of the version catalog.
Changelog:
[Internal] [Changed] - Consolidate Gradle Plugin versions inside the version catalog
Reviewed By: mdvacca
Differential Revision: D48233147
fbshipit-source-id: afd12e5377d2d88c53cef4e6913b5c49b3da5bbb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38927
I've done a pass and fixed most of the warnings for Gradle 9:
- project.buildDir is deprecated in favor of project.layout.buildDirectory
- I've updated 3rd party Gradle Plugins that we depend on
There are still two warnings which are outside of our control:
1. One is inside AGP and will be fixed with AGP 8.2 - Source https://issuetracker.google.com/issues/279306626
2. Another one is inside nexus-publish and should ideally be fixed by 2.0 https://github.com/gradle/gradle/issues/25206 Will bump the release once it's out
Changelog:
[Internal] [Changed] - Fix warnings for Gradle 9
Reviewed By: mdvacca
Differential Revision: D48231760
fbshipit-source-id: 27d704324ea33cfc8aa0164fa437b80aab425960
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38638
A new stable version of Android Gradle Plugin has just been released which I'm bumping over here, and applying all the required changes.
Changelog:
[Internal] [Changed] - Bump AGP to 8.1.0
Reviewed By: cipolleschi
Differential Revision: D47798273
fbshipit-source-id: 57672b10444ffb6079aa5881ff09d033d2a5e895
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37688
This moves the `ReactNativeFlipper` classes used to configure Flipper on Android from the template to
a separate Gradle artifact that will be published under the coordinates:
```
com.facebook.react:flipper-integration:0.73.x
```
This reduces the footprint of Flipper on the app template and makes easier for user on 0.73 to migrate
to Kotlin (as they will now have to migrate only 2 files rather than 4).
Changelog:
[Android] [Changed] - Move Flipper integration to a separate Gradle module inside `ReactAndroid`
Reviewed By: huntie
Differential Revision: D46441588
fbshipit-source-id: e197f29b7386b52091b8d38ed09bbd8f74a997df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37019
This bumps the version of AGP to the latest stable.
There was a breaking change in how buildConfig are built which I had to handle.
This also requires a bump of RNGP to work correctly.
Moreover, we now required Java 17 to build Android apps (as that's a AGP requirement).
Changelog:
[Android] [Changed] - Java to 17 and AGP to 8.0.2
Reviewed By: cipolleschi
Differential Revision: D45178748
fbshipit-source-id: 0f302e1f2f2ee56bd3566202fbb5ef67c9b220db
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37220
I'm bumping Kotlin to 1.8.0 to align to the version used internally.
On top of this, I had to configure the JDK toolchain to 11 as Kotlin 1.8
was changing the default version of the stdlib it ships with by default.
This also shields us against problems once we'll bump to AGP 8 which requires
JDK 17 but still allows to produce libraries that are JDK 11 compatible.
Changelog:
[Android] [Changed] - Kotlin to 1.8.0 and JDK Toolchain to 11
Reviewed By: cipolleschi
Differential Revision: D45524689
fbshipit-source-id: 2558b5b6727b5d6e0e1e3cc58f0c6a85ddcefc4d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36832
We used to use `cleanAll` instead of `clean` to do cleaning of everything due to a bug on AGP on how clean was performed.
The bug is resolved, so we can now use `clean` properly.
Moreover, we have sporadic failures when the codegen/lib/ folder is not cleaned up. This fixes it.
Changelog:
[Internal] [Changed] - Rename cleanAll to clean and refine it
Reviewed By: cipolleschi
Differential Revision: D44745849
fbshipit-source-id: 4da5d34bcb0ee5c9f6b0e0f4e5b919bcc3171270
Summary:
We can now use the `build` lifecycle task rather than a custom buildAll.
This task will also run linters and other checks on our builds.
Speficially I realized we were missing some permission in the manifest of RN-Tester
which were missed once we bumped to SDK 33.
Changelog:
[Internal] [Changed] - Use the default `build` task rather than `buildAll`
Reviewed By: cipolleschi
Differential Revision: D44055845
fbshipit-source-id: c9adbbeaaaf7ab8a8000fc1dce84ec39427fb26e
Summary:
This makes sure all the tests are executed inside the `ReactAndroid/src/test` folder.
Currently, we're not executing those tests as they're broken. In this diff I took care of:
- Re-enabling them as much as I could
- Ignoring the ones that are ignored also on BUCK
Those tests will have to be entirely re-written as they're using PowerMock which is
unmaintained and not working well with JDK 17+ (that's also why I had to add
the `--illegal-access=permit` and the `--add-opens` directing to allow mocking).
In general, I believe this is a net positive change as it allows us to add new JUnit tests
that are effectively executed, while the current status is ignoring all of them.
Changelog:
[Internal] [Changed] - Enable JVM Unit Tests for Gradle
Reviewed By: cipolleschi
Differential Revision: D41523697
fbshipit-source-id: dc9f2c4c93d0e6b231e8240a583ca31220152d3f
Summary:
This is just a minor bump before 0.72 and it brings AGP up to date
with the latest stable.
allow-large-files
Changelog:
[Internal] [Changed] - AGP to 7.4.2
Reviewed By: cipolleschi
Differential Revision: D43659180
fbshipit-source-id: d57ea8fb6ae902412b542e0125d3b15168d0e123
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36227
This is needed for the next Gradle major (8.x) and re-aligns us with the
Kotlin version in fbsource
Changelog:
[Android] [Changed] - Kotlin to 1.7.22 for Gradle
allow-large-files
Reviewed By: rybalkinsd
Differential Revision: D43445999
fbshipit-source-id: 85be1bbb4b5ac1664b5090688b688a4e50c3d80a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36232
Seems like RN Tester is crashing for JSC debug/release.
This happens because RN Tester ends up fetching JSC from Maven Central which contains older versions
of the artifacts (r17) which are not compatible with our setup AND are missing `libjsc.so`.
This is happening as our file layout is a bit different than a regular NPM project so
the repository declaration for JSC, being `../jsc-android/dist` from React Native root ends
in the wrong folder.
In this specifically I:
- Add an excludeModule for "org.webkit:android-jsc" on Maven Central inside RNGP
- Remove the allproject{repositories{}} block which was overriding RNGP configuration
- Add a specific repository declaration inside RN Tester to point to where JSC effectively lives
Changelog:
[Internal] [Changed] - RNGP - Fix RNTester crashing for JSC and safeguard against fetching JSC from Maven Central
Reviewed By: sshic
Differential Revision: D43462015
fbshipit-source-id: db830d7567bbf7dd91412df417418aa61a0ca8fe
Summary:
Before this change, the only way to update the offline mirror was to run it on a devmachine
(OD won't work either due to network restriction).
Developer's laptop also won't work as they would download AAPT2 for MacOS.
In the offline mirror instead we need AAPT2 for Linux as that's Sandcastle runner type.
This relaxes this requirement so the next time a developer has to update the offline
mirror they will see the message on the diff with the command to execute, and they should
be able to run the command locally (or on their devbox).
Changelog:
[Internal] [Changed] - Allow for Android offline mirrors to be executed on developer's laptops
allow-large-files
Reviewed By: cipolleschi
Differential Revision: D43344651
fbshipit-source-id: 3e91adb2db45cf94d3f947aaab501d98580dc43d
Summary:
In our build logic we're mixing `plugins{}` and `buildscript{}`
which have unpredictable side-effect on the build classpath.
I'm moving over everything to use `plugins{}`. This is possible now
that we don't use build from source for New Architecture anymore.
Changelog:
[Internal] [Changed] - Do not use a mixture of plugins{} and buildscript{}
allow-large-files
Reviewed By: cipolleschi
Differential Revision: D43186768
fbshipit-source-id: dcd115bd9d7aadf5cb837b3a28598e274a092873
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36039
This change bumps AGP to 7.4.1 so we can remove a lot of the unnecessary changes
we had to do to support AGP 7.3.x
I've also removed the explicit version in the template as now the AGP version
is provided by RNGP. That means that the user will get the correct version they need.
This also bumps the default CMake version in user space to 3.22 which resolves a lot
of warning when users are building with the New Architecture enabled.
Changelog:
[Android] [Changed] - Bump AGP to 7.4.1
allow-large-files
Reviewed By: cipolleschi
Differential Revision: D42960353
fbshipit-source-id: 9065f975c1694d266a86b2d3fe805e6e2b1c4aa1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35464
This extends the buildAll task to build both RNTester Debug and Release
We can finally do this now as debug and release are fully isolated
and don't clash on each other.
Changelog:
[Internal] [Changed] - Build RNTester Release inside buildAll
Reviewed By: cipolleschi
Differential Revision: D41521995
fbshipit-source-id: 37ec5e3b55080372f01f2736c1bb020b3776b193
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35100
That's just a minor bump of AGP before the branch cut.
Changelog:
[Android] [Changed] - Bump AGP to 7.3.1
allow-large-files
Reviewed By: cipolleschi
Differential Revision: D40752006
fbshipit-source-id: 4856bc7ca275cf46d3afcc7c24928c5f1d5e6e33
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35075
This diff updates the New App template for Android to use the React Native Gradle Plugin.
With this we can:
1. Get rid of all the C++ code.
2. Remove a lot of New Architecture logic in the build.gradle
3. Reuse the prebuilts of React Native/Hermes via prefab
Changelog:
[Android] [Changed] - Update the template to use RNGP
Reviewed By: cipolleschi
Differential Revision: D40673732
fbshipit-source-id: 70935248993d1e24904c982e75f12ad580faa9d8
Summary:
I tried to build the source locally to test changes with `rn-tester`. However, the gradle build failed due to "./ReactAndroid/gradle.properties (No such file or directory)". I believe this error was introduced by 3d05bac587.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Internal] [Fixed] - Fix ReactAndroid not found in rn-tester build
Pull Request resolved: https://github.com/facebook/react-native/pull/35058
Test Plan:
- Clone the react-native repo.
- Run `cd packages/rn-tester`.
- Run `yarn install-android-jsc` and encounter the error.
- Apply the fix.
- Run `yarn install-android-jsc` and build succeeds.
Reviewed By: cipolleschi
Differential Revision: D40639856
Pulled By: cortinico
fbshipit-source-id: 58b51bcad0af7a21cac032c98484c5942a203e4c
Summary:
It seems like CircleCI is not handling well env variables with \n in it.
I'm moving it over to a base64 encoded string and I'm extending the publish
scripts to base64 decode the key.
Changelog:
[Internal] [Changed] - Unbreak Nightly job by providing a GPG key as base64 encoded.
Reviewed By: cipolleschi
Differential Revision: D40426438
fbshipit-source-id: a60a7e7ad71580e81e675c84008d2712712e42a6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34970
I'm setting up `gradle-nexus` on our build to simplify the closing and releasing of staging repositories.
As of now, you'll have to go to Sonatype UI and manually click the release button.
With this plugin, we can instruct CircleCI to do the publishing automatically for us as
part of the nightly/stable release process.
Changelog:
[Internal] [Changed] - Setup gradle-nexus to automate closing and releasing staging repositories
Reviewed By: cipolleschi
Differential Revision: D40342759
fbshipit-source-id: 72e80f4bcc80058d5a6ea562ae136a91b2aeedbb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34967
This diff is a preparatory work for publishing artifacts on Maven Central.
What it does is:
1. It sets up all the 3 modules (react-native, hermes-engine, external-artifacts) for publishg
2. Adds coordinates to publish on the Snapshot repository
3. Adds support for appendign -SNAPSHOT version if invoked with `-PisNightly=true`
4. Configures GPG signing of artifacts.
I haven't touched the CircleCI and JS code yet. I'll do it in another diff.
Changelog:
[General] [Changed] - Setup publishing for Snapshot and Stable on Maven
Reviewed By: mdvacca, cipolleschi
Differential Revision: D40146212
fbshipit-source-id: 9321e16f6c18b35bc3ae785749d613085c56e7bc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34707
AGP 7.3.0 just got released which is glorious!
This allows us to remove a lot of unnecessary boilerplate to handle correct task ordering
on both React Android & the template
Changelog:
[Android] [Changed] - Bump AGP to 7.3.0
Reviewed By: mdvacca
Differential Revision: D39553534
fbshipit-source-id: 9680893e9f48cac867206aeb7eb468dbf91c1643
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34690
While working on another part of the codebase I realized that
our Unit Tests are not compiling due to references to missing classes.
I'm cleaning them up + hooking the compileTest task inside the
`buildAll` task so at least they will be compiled on both CIs.
Changelog:
[Internal] [Changed] - Make the Android unitTests compile
Reviewed By: cipolleschi
Differential Revision: D39501945
fbshipit-source-id: 03d3e4872d6c738b8b85d1fef9302ac230e857d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33852
Similarly to buildAll and cleanAll, I'm creating a downloadlAll task
which is aligning the behavior of the download task we're doing on CIs.
I've also updated the Offline Cache as we're now storing a bigger set of dependencies.
Changelog:
[Internal] [Changed] - Setup a toplevel downloadAll task
allow-large-files
Reviewed By: cipolleschi
Differential Revision: D36441728
fbshipit-source-id: f847b5e665c64e0b4b93d984bbc1b64c00a3b4f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33838
The idea behind this diff is to set a top level `buildAll` task that will be responsible
of invoking all the tasks we want to verify both in the internal and in the external CI.
This should ideally remove the breakages of the External CI happening from internal changes.
Changelog:
[Internal] [Changed] - Setup a top level buildAll Gradle task
Reviewed By: cipolleschi
Differential Revision: D36376384
fbshipit-source-id: d810b59577340628bb49562bfedf28440bd0f792
Summary:
As we introduced KGP inside `ReactAndroid` (cc ShikaSD), we now need to specify a version for it (as users will consume that build on Android New Architecture.
Currently, the version is loaded in the RN `rootProject` which is not available on user's project. I'm cleaning this up.
## Changelog
[Internal] - Do not specify a Kotlin version in the RN rootProject
Pull Request resolved: https://github.com/facebook/react-native/pull/33589
Test Plan:
Tested on a nightly version with
```
npx react-native init RNNightly --version nightly
```
Reviewed By: mdvacca
Differential Revision: D35476777
Pulled By: cortinico
fbshipit-source-id: 5a819ef5fa9a6886d7b7b683f31d59cb05a49f29
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33588
Currently users on M1 machine can't use the New Architecture correctly as they will get build failures when building the native code.
This Diff fixes it by automatically recognizing the host architecture and switching to NDK 24 if user is runnign on `aarch64`
Changelog:
[Android] [Fixed] - Improve support for Android users on M1 machine
Reviewed By: mdvacca
Differential Revision: D35468252
fbshipit-source-id: b73f5262b9408f04f3ae4fd26458a4d17c1ec29a
Summary:
This diff adds more folders to the cleanAll gradle task,
a utility task that gets invoked when cleaning the whole project.
Just realized that after the Hermes integration project, we never
added those folders that now need to be cleaned up as well.
Changelog:
[Internal] [Changed] - Add further folders to the cleanAll Gradle task
Reviewed By: sshic
Differential Revision: D35444265
fbshipit-source-id: ee4ded9a4ee9554b5e3f0f8cb85f60a4797e9010
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33396
This commit fully unplugs the `ReactAndroid` from using hermes from the NPM package and plugs the usage of Hermes via the `packages/hermes-engine` Gradle build.
I've used prefab to share the .so between the two builds, so we don't need any extra machinery to make this possible.
Moreover, I've added a `buildHermesFromSource` property, which defaults to false when RN is imported, but is set to true when RN is opened for local development. This should allow us to distribute the `react-native` NPM package and users could potentially toggle which source to use (but see below).
Changelog:
[Android] [Changed] - Build Hermes from Source
Reviewed By: hramos
Differential Revision: D34389875
fbshipit-source-id: 107cbe3686daf7607a1f0f75202f24cd80ce64bb