Граф коммитов

84 Коммитов

Автор SHA1 Сообщение Дата
Nicola Corti 5f75e9b90d Bump NDK to 26.1 (#42656)
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
2024-01-26 00:34:55 -08:00
David Vacca fa470ef6ae Rename prefix of binaryCompatibilityValidator properties (#42041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42041

binaryCompatibilityValidator is a generic library, it shouldn't have referecences to react. I'm renaming:

```
react.internal.binaryCompatibilityValidator...
```

by

```
binaryCompatibilityValidator...
```

changelog: [internal] internal

Reviewed By: philIip

Differential Revision: D52380035

fbshipit-source-id: fc71595939e7f71b135acc44a9918f09361a604f
2023-12-21 15:49:29 -08:00
Nicola Corti f11608da4e Remove the installArchives task (#41832)
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
2023-12-12 10:55:32 -08:00
David Vacca 704f07b98e Extract binaryCompatibilityValidator into gradle.properties file (#41811)
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
2023-12-05 13:36:34 -08:00
David Vacca e9b80971c7 Integrate binary-compatibility-validator into RN Android build system
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
2023-12-04 12:22:58 -08:00
Gijs Weterings d4ad19c969 Revert D49370200: Migrate codegen to shared build setup, remove package build pre-step from RNTester
Differential Revision:
D49370200

Original commit changeset: 992913155169

Original Phabricator Diff: D49370200

fbshipit-source-id: e8232c97c22065fb54ac940ee2351b2155eb51e0
2023-10-23 12:00:54 -07:00
Alex Hunt 4db31a3110 Migrate codegen to shared build setup, remove package build pre-step from RNTester (#39540)
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
2023-10-23 08:32:33 -07:00
Nicola Corti 171a479150 Remove ReactNative/Flipper Integration (#40935)
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
2023-10-16 05:32:55 -07:00
Riccardo Cipolleschi 02e53ebc42 Fix Nightlies
Summary:
## Changelog:
[Internal] - Fix Nighlties that were broken due to changes for double publishing

Reviewed By: cortinico

Differential Revision: D50225219

fbshipit-source-id: dd1b96a956bb282caa40bd6f99b9a82554958746
2023-10-12 07:22:23 -07:00
Nick Gerleman 9ce7b56413 Use modern Android libc++ in Yoga and React Native OSS (#39795)
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
2023-10-04 19:57:14 -07:00
Nicola Corti a24990c878 Remove unused downloadAll task (#39443)
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
2023-09-18 04:46:42 -07:00
Nicola Corti 54033fd334 Introduce react.internal.useHermesNightly (#38886)
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
2023-08-14 00:45:07 -07:00
Nicola Corti 6aed446886 Consolidate Gradle Plugin versions inside the version catalog (#38946)
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
2023-08-11 08:34:37 -07:00
Nicola Corti 41af21b42d Fix warnings for Gradle 9 (#38927)
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
2023-08-11 04:58:19 -07:00
Nicola Corti 6cd1da94b8 Bump AGP to 8.1.0 (#38638)
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
2023-07-26 11:02:05 -07:00
szymonrybczak 28deaa3a71 Bump NDK to 25 (#37974)
Summary:
Bumps NDK to current LTS Release.

## Changelog:

[Android] [Changed] - Bump NDK to 25

Pull Request resolved: https://github.com/facebook/react-native/pull/37974

Test Plan: CI Green 

Reviewed By: christophpurrer

Differential Revision: D47754763

Pulled By: cortinico

fbshipit-source-id: 24fbca503b3814c28a05aada5223c741e14bda28
2023-07-25 09:57:30 -07:00
Nicola Corti 16201f8be3 Move Flipper integration to a separate Gradle module inside `ReactAndroid` (#37688)
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
2023-07-04 06:01:09 -07:00
Nicola Corti 9f7dddf1ac AGP to 8.0.2 (#37019)
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
2023-06-20 08:00:05 -07:00
Nicola Corti 74987b6fca Kotlin to 1.8.0 and JDK Toolchain to 11 (#37220)
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
2023-05-04 11:12:00 -07:00
Nicola Corti 01100a2fc8 Rename cleanAll to clean and refine it (#36832)
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
2023-04-06 05:54:15 -07:00
Nicola Corti 5cbabe30d3 Use the default `build` task rather than `buildAll`
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
2023-03-17 10:26:34 -07:00
Nicola Corti a389373442 Enable JVM Unit Tests for Gradle
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
2023-03-17 10:26:34 -07:00
Ruslan Lesiutin 714b502b0c | RN Monorepo | Migrate to package (#36434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36434

Changelog: [Internal]

This is a squashed stack of 18 commits, starting from D43202126

allow-large-files

Reviewed By: cortinico

Differential Revision: D43977381

fbshipit-source-id: 0da552ddb85f2f61a0be0ef071915b35f3f8555c
2023-03-17 05:03:25 -07:00
Nicola Corti 4b8b9cc838 AGP to 7.4.2
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
2023-02-28 08:39:21 -08:00
Nicola Corti 270584ac79 Kotlin to 1.7.22 for Gradle (#36227)
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
2023-02-22 07:13:47 -08:00
Nicola Corti 39e1a3c3a6 RNGP - Fix RNTester crashing for JSC and safeguard against fetching JSC from Maven Central (#36232)
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
2023-02-21 09:22:09 -08:00
Nicola Corti 40c687c132 Allow for Android offline mirrors to be executed on developer's laptops
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
2023-02-16 04:38:36 -08:00
Nicola Corti b67a4ae90f Do not use a mixture of plugins{} and buildscript{}
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
2023-02-10 10:04:55 -08:00
Nicola Corti 5647d79dc9 RNGP - Bump AGP to 7.4.1 (#36039)
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
2023-02-02 07:07:45 -08:00
Nicola Corti 50c6ee40ea Build RNTester Release inside buildAll (#35464)
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
2022-11-24 11:22:54 -08:00
Nicola Corti 1f42ff0815 Bump AGP to 7.3.1 (#35100)
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
2022-10-27 03:33:29 -07:00
Nicola Corti c96c76eb91 Update the template to use RNGP (#35075)
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
2022-10-25 13:13:14 -07:00
Rui Ying f8cd9f187d Fix ReactAndroid not found in rn-tester build (#35058)
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
2022-10-24 10:43:02 -07:00
Nicola Corti 3d05bac587 Unbreak Nightly job by providing a GPG key as base64 encoded.
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
2022-10-17 04:07:37 -07:00
Nicola Corti 60869d0885 Setup gradle-nexus to automate closing and releasing staging repositories (#34970)
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
2022-10-13 09:45:11 -07:00
Nicola Corti 0e2f090631 Setup publishing for Snapshot and Stable on Maven (#34967)
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
2022-10-13 03:08:22 -07:00
Nicola Corti 9f6711fda0 Bump AGP to 7.3.0 inside ReactAndroid (#34707)
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
2022-09-20 10:30:40 -07:00
Nicola Corti 4ba9d0ecb1 Make the Android unitTests compile (#34690)
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
2022-09-15 07:00:43 -07:00
LeoTM 53c8fc9488 Bump AGP from 7.2.0 to 7.2.1 (#34166)
Summary:
- Fix: https://github.com/facebook/react-native/issues/34103
- Follow-up: https://github.com/facebook/react-native/pull/33817

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Changed] - Bump Android Gradle Plugin to 7.2.1

Pull Request resolved: https://github.com/facebook/react-native/pull/34166

Test Plan: Everything builds and runs as expected

Reviewed By: javache

Differential Revision: D37747754

Pulled By: cortinico

fbshipit-source-id: b51f26d773ddfbdaf4490f89f3b207a41b225a82
2022-07-12 03:57:14 -07:00
Nicola Corti a0e6ffebbf Format .kts files with ktfmt
Summary:
I'm extending ktfmt setup to run on kotlin script files as well.

Changelog:
[Internal] [Changed] - Reformat .kts files with ktfmt

skip-linter-coverage-verification

Reviewed By: zertosh

Differential Revision: D36967010

fbshipit-source-id: a83f3facbb5f30b935b69fc70a5588e4da5996b2
2022-06-09 02:50:45 -07:00
Nicola Corti afb0307036 Setup a toplevel downloadAll task (#33852)
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
2022-05-17 15:31:48 -07:00
Nicola Corti 4994b8b5de Setup a top level buildAll Gradle task (#33838)
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
2022-05-16 09:27:54 -07:00
Dulmandakh c274456e5b Bump Android Gradle Plugin to 7.2.0 (#33817)
Summary:
Bump Android Gradle Plugin to 7.2.0 (May 2022), which supported by latest Android Studio (Chipmunk). See https://developer.android.com/studio/releases/gradle-plugin#7-2-0

## Changelog

[Android] [Changed] - Bump Android Gradle Plugin to 7.2.0

Pull Request resolved: https://github.com/facebook/react-native/pull/33817

Test Plan: Everything builds and runs as expected

Reviewed By: hramos

Differential Revision: D36379964

Pulled By: cortinico

fbshipit-source-id: ea35cbea0b1a27bceafddd06ed91711d74e281e9
2022-05-16 07:25:03 -07:00
Nicola Corti bfc39353d1 Do not specify a Kotlin version in the RN rootProject (#33589)
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
2022-04-08 03:44:56 -07:00
Nicola Corti 4befd2a29c Improve support for Android users on M1 machine (#33588)
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
2022-04-07 10:55:32 -07:00
Nicola Corti 694eb0f0b1 Add further folders to the cleanAll Gradle task.
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
2022-04-07 05:51:55 -07:00
Nicola Corti a3d9892ed9 Build Hermes from Source (#33396)
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
2022-03-11 15:23:36 -08:00
Gabriel Donadel Dall'Agnol 200488e87c build: Bump AGP to 7.1.1 and fix bundle inclusion in release mode (#33057)
Summary:
Upgrade Android Gradle to 7.1.0 on template and fix a bug where the bundle was not getting included when building the app in release mode

Closes https://github.com/facebook/react-native/issues/33002
Closes https://github.com/facebook/react-native/issues/33018
Closes https://github.com/facebook/react-native/issues/33046
Potentially fixes https://github.com/facebook/react-native/issues/33029

## Changelog

[Android] [Changed] - Bump AGP to 7.1.0 and fix bundle inclusion in release mode

Pull Request resolved: https://github.com/facebook/react-native/pull/33057

Test Plan:
1. Run `./scripts/test-manual-e2e.sh`
2. Select `A new RN app using the template` and `Android`
3. Test app on the emulator
4. Open Android studio build the app using release variant
4. Check the release apk using Android studio "Analyze APK" tool and ensure the bundle is included

![image](https://user-images.githubusercontent.com/11707729/152700410-3bcb80b0-35b6-4bdc-bf57-98a42a29e5a6.png)

Reviewed By: ShikaSD

Differential Revision: D34076884

Pulled By: cortinico

fbshipit-source-id: da4392af37e08e22dbcafba38476fd712141474a
2022-02-21 06:23:31 -08:00
Michel Kraemer a86cae7aac Update gradle-download-task to 5.0.1 (#32995)
Summary:
This enables concurrent task exection and parallel downloads

See also https://github.com/michel-kraemer/gradle-download-task/issues/138

## Changelog

[General] [Changed] - Update gradle-download-task to 5.0.1 to support concurrent downloads

Pull Request resolved: https://github.com/facebook/react-native/pull/32995

Test Plan: Build runs successfully.

Reviewed By: ShikaSD

Differential Revision: D33892817

Pulled By: cortinico

fbshipit-source-id: 515443573e17a5c2b16a1cf3cea4bf3c5c2d96a7
2022-02-02 10:33:43 -08:00
Lorenzo Sciandra ac206aa814 removing unused Detox (#32907)
Summary:
I realized while checking for a few other things that Detox's presence in the repo is actually not really motivated - since Jul 2020 the few tests that were using it were disabled 120ff7ccde never to be reactivated since.

I noticed this while attempting to updating the Detox version to latest... which made me notice that the repo is still on a 16.x version while latest is 19.x (there are like 10 pages of releases between them: https://github.com/wix/Detox/releases) and I came to the conclusion that it's probably easier to just remove the old dusty code and eventually reintroduce it in the future if we ever consider it necessary.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Removed] - Removing Detox from CI.

Pull Request resolved: https://github.com/facebook/react-native/pull/32907

Test Plan: CI - nothing breaks.

Reviewed By: lunaleaps

Differential Revision: D33623199

Pulled By: cortinico

fbshipit-source-id: 7d8d133629b62b66959b309f2ca21852d396c9fc
2022-01-20 08:51:47 -08:00