Commit Graph

233 Commits

Author SHA1 Message Date
UNIDY2002 c7d969f31b Configure Java toolchains only when executing App configuration (#40757)
Summary:
Fix https://github.com/facebook/react-native/issues/40560

## Changelog:

[ANDROID] [FIXED] - Ensure that `configureJavaToolChains` is only executed once during configuration

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

Test Plan:
- Create a fresh `react-native@0.73.0-rc.1` project
- Install `react-native-webview`
- Apply [this patch](https://github.com/react-native-webview/react-native-webview/pull/3175/files) for `react-native-webview` (caused by another issue https://github.com/facebook/react-native/issues/40559)
- Edit `android/gradle.properties` and set `newArchEnabled` to true
- Build application
- (Expected) Application fail to build
- Apply this PR
- (Expected) Application build successfully

**Additional explanation:**

According to the implementation of `configureJavaToolChains`, all the subprojects (both the app and the libraries) will have their toolchains setup in one execution of the method. Therefore, it is okay for the method to be invoked only when configuring the plugin for the app.

On the other hand, invoking the method for more than one time will cause the issue stated in https://github.com/facebook/react-native/issues/40560.

Reviewed By: cipolleschi

Differential Revision: D50361871

Pulled By: cortinico

fbshipit-source-id: bd5e18df97988122788d0482dba954e517a0cb5c
2023-10-17 05:46:53 -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
Nicola Corti ab3506e609 Make sure buildConfig is turned on for all the 3rd party libraries (#40939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40939

Currently some libs on RN 0.73 are broken as the default for Build Config generation changed
from true to false since AGP 8.x. This reverts the behavior to the old flag.

Closes #40791
Closes #40559

Changelog:
[Internal] [Changed] - Make sure buildConfig is turned on for all the 3rd party libraries

Reviewed By: mdvacca

Differential Revision: D50270382

fbshipit-source-id: 02dcb031c577f65be2f41d9da0334c1b3d89e4c5
2023-10-13 10:07:10 -07:00
Alex Hunt f40bb9331c Bump package versions for next major (#39764)
Summary:
#publish-packages-to-npm

Bump all package versions to `0.74.0` (next major release) for `main`, following instructions at https://reactnative.dev/contributing/release-branch-cut-and-rc0#12-bump-minor-version-of-all-monorepo-packages-in-main.

```sh
yarn bump-all-updated-packages --release-branch-cutoff
```

Changelog: [Internal]

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

Test Plan: —

Reviewed By: robhogan

Differential Revision: D49871039

Pulled By: huntie

fbshipit-source-id: f4df6efeae4d8a9209e7aae7b9e6fea3d15793b5
2023-10-11 08:36:23 -07:00
generatedunixname89002005325672 3859eee961 Daily arc lint --take KTFMT
Reviewed By: 0x1eaf

Differential Revision: D50164739

fbshipit-source-id: a3a03735eaea41d3e7e04a73b210c6347ebd078e
2023-10-11 06:05:17 -07:00
Riccardo Cipolleschi 5c2ec558c1 Fix functions that turn on the New Architecture (#40770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40770

## Changelog:
[Internal] - Fix functions that turn on the New Architecture

Reviewed By: cortinico

Differential Revision: D50084427

fbshipit-source-id: aae0c77585929eacf8e890321e27e5049e53775e
2023-10-10 10:16:29 -07:00
Nicola Corti e9ecd3511e Fix compilation warnings introduced by Gradle 8.4 (#39959)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39959

We're still accessing project.buildDir which will be removed in Gradle 9.0
I'm cleaning it up here.

Changelog:
[Internal] [Changed] - Fix compilation warnings introduced by Gradle 8.4

Reviewed By: yungsters

Differential Revision: D50016573

fbshipit-source-id: de7a725f61b503f08991ebf85b9a002cefab221a
2023-10-06 11:38:59 -07:00
Nicola Corti 81213f6524 Bump Gradle to 8.4 (#39960)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39960

This is our usual round of bumps just after the branch cut.

Changelog:
[Android] [Changed] - Bump Gradle to 8.4

Reviewed By: yungsters

Differential Revision: D50016574

fbshipit-source-id: 781eb906f6b12f76f673e38bdcf099c9b7cefade
2023-10-06 11:38:59 -07:00
Riccardo Cipolleschi bad027c5f5 Add warning when newArchEnabled is set (#39781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39781

## Changelog
[Internal] - Add warning when newArchEnabled is set

Reviewed By: cortinico

Differential Revision: D49866356

fbshipit-source-id: 0b937b7f37010e5fbfc93b073cc70e293d61052c
2023-10-05 08:26:43 -07:00
Nicola Corti 63ca55bdcc Unblock build-from-source on nightlies (#39634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39634

Running build from source as suggested here:
https://reactnative.dev/contributing/how-to-build-from-source
is currently broken for nightly versions (and for 0.73).

This fixes it by:
- Fixing the import of the Gradle Version Catalog
- Actually adding the Gradle version catalog to the NPM package
- Fixing how the build Codegen CLI task is invoked for build-from-source
- Updating the search directories for codegenDir/reactNativeDir from build-from-source

Changelog:
[Internal] [Fixed] - Unblock build-from-source on nightlies

Reviewed By: cipolleschi

Differential Revision: D49562595

fbshipit-source-id: 9594b7d947569d41c461a7e8287d3ae68fb87b98
2023-09-26 06:26:55 -07:00
Rob Hogan 0d23ef5bde Gradle distribution type bin -> all (#39619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39619

https://github.com/facebook/react-native/pull/39603 unintentionally changed our Gradle distribution type in `gradle.properties` to `bin`. This changes it back to `all` while preserving the upgrade to 8.3.

Generated with
```
./gradlew wrapper --gradle-version=8.3 --distribution-type all
```

Changelog:
[Internal][Changed] Revert Gradle distribution type to ‘all’

Reviewed By: NickGerleman

Differential Revision: D49569492

fbshipit-source-id: fc5b2c8a2c2cea455ed5bd0dbd6743d34b527c9b
2023-09-24 06:09:53 -07:00
Rob Hogan 2613e8d9db Bump Gradle to 8.3 (#39603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39603

Bump Gradle to latest stable: 8.3.

Changelog:
[Internal] [Changed] - Gradle to 8.3

Reviewed By: christophpurrer

Differential Revision: D49537003

fbshipit-source-id: 75297f9108cd325a6118a2d416401e306cadd1b8
2023-09-22 09:19:05 -07:00
Riccardo Cipolleschi 29adb8de98 Implement version parsing and connect to RNTester (#39502)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39502

This diff adds the parsing of the package.json to retrieve the version of react native and it matches it against a regex to decide whether to enable or not the New Architecture.

This change depends on [this CLI's PR](https://github.com/react-native-community/cli/pull/2076).

## Changelog:
[Android][Added] - Parse RN Version to decide whether to enable the New Arch or not.

Reviewed By: cortinico

Differential Revision: D49270012

fbshipit-source-id: 5164a1ddd26f1822c0d717a7a9e2416ec38d78a2
2023-09-18 06:12:19 -07:00
Riccardo Cipolleschi 55a0425fb2 Add helper types and function for double publishing (#39501)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39501

This change introduce a new model to parse the React Native package.json.
The objects are not connected but they will be used in the next diff

## Changelog:
[Android][Added] - Add a couple of types in the RNGP for json parsing.

Reviewed By: cortinico

Differential Revision: D49270044

fbshipit-source-id: 42a855bb85a5f8e1b1249ab3ebee974ce3fb93fd
2023-09-18 06:12:19 -07:00
Nate Stedman 88395bb17d Update ktfmt component on FBS:master
Reviewed By: hick209

Differential Revision: D49300079

fbshipit-source-id: 7e704e2366feee3f6f2c25ac25d3daea407e71f9
2023-09-15 07:19:43 -07:00
Nicola Corti 0e5ea28905 Bump AGP to 8.1.1 (#39392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39392

This fixes a warning that would fire for all the users on 0.73 and is not actionable in any form: https://issuetracker.google.com/issues/295235385

Changelog:
[Internal] [Changed] - Bump AGP to 8.1.1

Reviewed By: luluwu2032

Differential Revision: D49155866

fbshipit-source-id: 05201b834d00b018f8680d74fe4a40884a8c5eb9
2023-09-12 09:21:08 -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 1a765b6d08 Cleanup and scope all the Gradle Properties (#38885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38885

We do have several Gradle Properties that are used to configure the build.

I've refactored them all and moved them inside the PropertyUtils file:
https://github.com/facebook/react-native/blob/main/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PropertyUtils.kt

Specifically properties should be 'scoped' under `react.` if public, and `react.internal.` if for internal usage.

Property that I cleaned up are:
- REACT_NATIVE_MAVEN_LOCAL_REPO becomes react.internal.mavenLocalRepo
- REACT_WINDOWS_BASH becomes react.internal.windowsBashPath
- GROUP becomes react.internal.publishingGroup

I've also added support for scoping for public properties with backward compat (so both the scoped and unscoped properties are accepted):
- react.newArchEnabled
- react.hermesEnabled
- react.nativeArchitectures

Changelog:
[Android] [Changed] - Cleanup and scope all the Gradle Properties

Reviewed By: mdvacca

Differential Revision: D48188310

fbshipit-source-id: 1a92d31105270a4c2f80029b7d36bcb33916d0fb
2023-08-13 23:11:29 -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 28dd1bbe0f Enable local caching for Gradle (#38882)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38882

This turns on local caching for Gradle builds.
From now on, some of the tasks of the build will be cached inside the `.gradle` folder.

This will benefit 'clean builds' and builds happening after branch/context switch.
CI will also benefit from this improvement as we're storing the cache folder on CircleCI.

After this we'll have to follow-up and enabling `Cacheable` on each of our task as
they're currently all disabled.

Changelog:
[Internal] [Changed] - Enable local caching for Gradle

Reviewed By: mdvacca

Differential Revision: D48187656

fbshipit-source-id: 25734ed692a69874721e86c50498b075af0fda19
2023-08-09 17:32:43 -07:00
Nicola Corti fdab18b0a1 Fix compilation avoidance bug with buildCodegenCLI (#38903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38903

Currently Android is not rebuilding the CLI if its content changes. This is a bug.
It's resolution is a bit more complicated as we do have various `buildCodegenCLI` tasks, also in user projects.

I've removed the tasks from the user projects, as they're practically not needed (users always consume a prebuilt codegen).

And I've also updated the setup to have only one `buildCodegenCLI` in the ReactAndroid project.
This allows us to ensure the job executes only once and has correct input/outputs.

Changelog:
[Internal] [Changed] -  Fix compilation avoidance bug with buildCodegenCLI

Reviewed By: mdvacca

Differential Revision: D48199157

fbshipit-source-id: ba3be6a0ca959ac4e1240e8feb99b8274e4e2b46
2023-08-09 14:33:00 -07:00
Nicola Corti e563f0f3fc Use version catalog to consolidate versions for JVM dependencies (#38836)
Summary:
As we had version numbers scattered all over the places, I'm consolidating them to use a version catalog: https://docs.gradle.org/current/userguide/platforms.html

## Changelog:

[INTERNAL] - Use version catalog to consolidate versions for JVM dependencies

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D48150285

Pulled By: cortinico

fbshipit-source-id: 83a1867aace5395d9a10fadd6c6ab11c31fa14b5
2023-08-08 11:37:43 -07:00
Nicola Corti b7b69c589c Enable Kotlin for RN Tester (#38820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38820

This is needed if we want to allow users to write Kotlin code inside RN Tester

Changelog:
[Internal] [Changed] - Enable Kotlin for RN Tester

Reviewed By: mdvacca, cipolleschi

Differential Revision: D48117203

fbshipit-source-id: c4a69cca95dfed936d85a45dd91f1518cfe1726f
2023-08-07 10:31:04 -07:00
Nicola Corti 2e5483e303 Add missing libreact_utils.so inside RNGP pickFirst (#38818)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38818

When building the template test on CircleCI, I've noticed we fire a warnign for `libreact_utils.so` as we're missing a pickFirst directive.
You can see an example of the warning here:
https://app.circleci.com/pipelines/github/facebook/react-native/28853/workflows/f1808b5e-fb40-4165-8885-694f88037f9f/jobs/904972

This fixes it by adding `libreact_utils.so` to the `pickFirst` list.

Changelog:
[Internal] [Changed] - Add missing `libreact_utils.so` inside RNGP pickFirst

Reviewed By: cipolleschi

Differential Revision: D48115852

fbshipit-source-id: 02e8b3172aea84360d06a1a12400fe7bc99859e5
2023-08-07 09:48:32 -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
Janic Duplessis e21c25eb91 Add missing toolchains plugin in react-native-gradle-plugin (#38292)
Summary:
I was getting the following error when trying to run RN Tester on Android.

```
A problem occurred configuring project ':packages:react-native:ReactAndroid'.
> Could not determine the dependencies of task ':react-native-gradle-plugin:compileKotlin'.
   > No matching toolchains found for requested specification: {languageVersion=17, vendor=any, implementation=vendor-specific} for MAC_OS on aarch64.
      > No locally installed toolchains match and toolchain download repositories have not been configured.
```

This is fixed by adding the `org.gradle.toolchains.foojay-resolver-convention` plugin in settings.gradle, this was done already for the root one, but not in the one in `react-native-gradle-plugin`.

## Changelog:

[INTERNAL] [FIXED] - Add missing toolchains plugin in react-native-gradle-plugin

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

Test Plan: Build RN Tester on android

Reviewed By: mdvacca

Differential Revision: D47371772

Pulled By: cortinico

fbshipit-source-id: 8eaa5de9559720a7b37d11b3ddceb5fb84753a40
2023-07-17 05:09:56 -07:00
Nicola Corti e6f77112a7 Gradle to 8.2.1 (#38271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38271

This is our usual bump to the latest stable of Gradle

Changelog:
[Internal] [Changed] - Gradle to 8.2.1

Reviewed By: yungsters

Differential Revision: D47335295

fbshipit-source-id: 36bbc1aca19b3b37852e19d3a8536f1a6c4b736a
2023-07-10 15:16:10 -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
Arushi Kesarwani 2eb25cbdbe Update Node.js to v18 in all RN packages (#37791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37791

## Bump minimum Node JS version to 18 via `react-native/package.json#engines`

In https://github.com/facebook/react-native/pull/35443 we bumped up the node version from 16 to 18.

Node 16 [ends maintenance releases on 2023-09-11](https://nodejs.org/en/blog/announcements/nodejs16-eol/), and bumping this minimum will allow other associated Node JS tools (CLI, Metro, Jest) to reduce their support burden.

This follows up by formally making Node 18 the minimum supported version.

**Docs PR:**
https://github.com/facebook/react-native-website/pull/3748

**Changelog:**
[General][Breaking] Bump minimum Node JS version to 18

Reviewed By: cortinico, NickGerleman

Differential Revision: D46583997

fbshipit-source-id: 1f31e2f205ac8b09494c2a7d3b73b9f36eff221b
2023-06-22 09:53:21 -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 84fc79f453 Bump Gradle to 8.1.1
Summary:
Just keeping our Gradle version up to date.

Changelog:
[Internal] [Changed] - Bump Gradle to 8.1.1

Reviewed By: yungsters

Differential Revision: D46769069

fbshipit-source-id: b79ae35473f40e821cf6a1b8e094e33d1b1a44d7
2023-06-16 08:40:11 -07:00
Nicola Corti b66ab2c154 Configure JDK Toolchain to 11 for all the 3rd party libraries. (#37575)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37575

This fixes the behavior reported in https://github.com/reactwg/react-native-releases/discussions/54#discussioncomment-5984629
by forcing all the libraries to compile with JDK 11.

This prevents build issues when on Gradle 8 and Kotlin 1.8

Changelog:
[Internal] [Changed] - Configure JDK Toolchain to 11 for all the 3rd party libraries

Reviewed By: cipolleschi

Differential Revision: D46190989

fbshipit-source-id: c88974d24efc2c35b01f28d41af0d0515d63d765
2023-06-01 03:24:45 -07:00
Tommy Nguyen 260bcf7f1b fix: limit diagnostics width output by hermesc (#37531)
Summary:
Limit diagnostics width output by `hermesc` as they may cause slowdowns or even crashes in Gradle/Xcode when a minified bundle is used as input. This occurs because Hermes is unable to determine the terminal width when executed by Gradle/Xcode, and falls back to "unlimited". If the input is a minified bundle, Hermes will output the whole bundle for each warning.

See issues filed:
- https://github.com/microsoft/rnx-kit/issues/2416
- https://github.com/microsoft/rnx-kit/issues/2419
- https://github.com/microsoft/rnx-kit/issues/2424

## Changelog:

[GENERAL] [FIXED] - Limit diagnostics width output by `hermesc`

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

Test Plan: See listed issues for repros.

Reviewed By: cipolleschi

Differential Revision: D46102686

Pulled By: cortinico

fbshipit-source-id: 1b821cad7ef0d561a5e1c13a7aedf9b10164620a
2023-05-23 07:51:25 -07:00
Nicola Corti b6d9217077 Add tests for getDependencySubstitutions (#37494)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37494

I'm adding some unit tests to this function that got recently added to support TvOS

Changelog:
[Internal] [Changed] - Add tests for getDependencySubstitutions

Reviewed By: cipolleschi

Differential Revision: D46029402

fbshipit-source-id: 6099242fe9e18f1a612124bc784f90047b4ee286
2023-05-22 07:13:25 -07:00
Douglas Lowder 012e4bd654 fix: [gradle-plugin] 3rd party lib dependency substitution (#37445)
Summary:
For 3rd party libraries to work with a React Native fork (such as the TV repo) that uses a different Maven group for `react-android` and `hermes-android` artifacts, an additional dependency substitution is required.

## Changelog:

[Android][fixed] RNGP dependency substitutions for fork with different Maven group

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

Test Plan:
- Manual tested with an existing project
- Unit tests pass

Reviewed By: rshest, dmytrorykun

Differential Revision: D45948901

Pulled By: cortinico

fbshipit-source-id: 4151a1d3616172a92c68812c3a0034c98b330d67
2023-05-17 11:11:30 -07:00
Nicola Corti 3a321ae2bb Make sure the -DANDROID compilation flag is always included. (#37451)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37451

It seems like starting from AGP 7.4, Android is not including the `-DANDROID` flag
anymore from the NDK toolchain.

As we do have several `#ifdef` logic that takes care of having this macro set,
I'm going to make sure it's always set for both ReactAndroid, hermes-engine
and the template.

Changelog:
[Android] [Fixed] - Make sure the -DANDROID compilation flag is always included

Reviewed By: javache

Differential Revision: D45908787

fbshipit-source-id: 07284712d7bcce73dc8ea0dffd4a9d00af4de1d2
2023-05-17 09:13:38 -07:00
Tommy Nguyen cceef57be1 fix(gradle-plugin): fix nightly build regression (#37332)
Summary:
Nightly builds of Android no longer build due to a recent version format change.

## Changelog:

[ANDROID] [FIXED] - Fixed nightly builds of Android no longer building due to a recent version format change

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

Test Plan:
```
git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version nightly
cd example
yarn android
```

Reviewed By: jacdebug

Differential Revision: D45690926

Pulled By: cortinico

fbshipit-source-id: dc935733607c2b33ba296b507a98f43ba483e348
2023-05-09 06:05:46 -07:00
Douglas Lowder 615d9aefc4 Read Maven group from GROUP property (#37204)
Summary:
The [React Native TV repo](https://github.com/react-native-tvos/react-native-tvos) shares most of the same Android code as the core repo. Beginning in 0.71, it needs to also publish Android Maven artifacts for the `react-android` and `hermes-android` libraries.

In order to avoid conflicts, it needs to publish the artifacts to a different group name. However, `react-native-gradle-plugin` uses a hardcoded group name (`com.facebook.react`).

Solution: read the group name from the existing `GROUP` property in `ReactAndroid/gradle.properties`.

## Changelog:

[Android] [Fixed] - read GROUP name in gradle-plugin dependency code

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

Test Plan:
- Android unit tests have been added for the new code and new method in `DependencyUtils.kt`.
- Existing tests should pass
- The new code defaults to the correct group (`com.facebook.react`) so no functional change is expected in the core repo.

Reviewed By: luluwu2032

Differential Revision: D45576700

Pulled By: cortinico

fbshipit-source-id: 6297ab515b4bdbb17024989c7d3035b0a2ded0ae
2023-05-05 03:12:33 -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
Pranav Yadav 14316bd635 Add missing READMEs & Update package.json in all RN packages (#37090)
Summary:
This diff adds _missing_ README files for all public RN packages.

#### Changes:
For all public RN packages:
- Add _Missing_ READMEs

Update package.json in all RN packages to add:
- Issues, Bugs urls
- Keywords and Homepage urls to respective pkgs

## Changelog:

[GENERAL][ADDED] - Add missing README files for all public RN packages.
[GENERAL][CHANGED] - Update package.json in all RN packages to add required fields.

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

Test Plan: - `yarn lint && yarn flow && yarn test-ci` --> _should be green_

Reviewed By: cortinico

Differential Revision: D45390861

Pulled By: hoxyq

fbshipit-source-id: 524a92de56a7cb553573d9f54ccf40a998dfd35f
2023-04-28 04:26:20 -07:00
Pranav Yadav a58dea1e9e Update Node.js to v16 in all RN packages (#37073)
Summary:
**NOTE**: This is a **BREAKING** change.
TLDR; Enforce minimum Node.js v16 in all RN packages.

This diff **Updates Node.js to v16** across all RN packages.

#### Context:

- For RN development and new project created; bump to node 16 was in https://github.com/facebook/react-native/pull/36217
- Recently `react-native-windows` also; updated node to v16, https://github.com/microsoft/react-native-windows/pull/11500

#### Changes:

- [BREAKING] Update Node.js to v16 across all RN packages under 'packages/' dir

## Changelog:

[GENERAL][BREAKING] - Update Node.js to v16 in all RN packages

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

Test Plan: - `yarn lint && yarn flow && yarn test-ci` --> _should be green_

Reviewed By: cipolleschi

Differential Revision: D45306108

Pulled By: jacdebug

fbshipit-source-id: e3ba7d0151b86a6a0a3d63fb29c2bd887e1ac1e7
2023-04-26 08:24:06 -07:00
Nicola Corti 74f256b6f0 Gradle to 8.1 (#37018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37018

Just bumping Gradle version to the latest stable.
This brings configuration caching as stable, which is quite of a big deal.

Changelog:
[Android] [Changed] - Gradle to 8.1

Reviewed By: yungsters

Differential Revision: D45177537

fbshipit-source-id: 6a47208b69d5591d299451e5a610cc3f5e9afe66
2023-04-21 04:52:54 -07:00
Nicola Corti 50553f4e81 Re-sync repo after ShipIt change - Removal of BUCK files (#36955) 2023-04-19 12:12:04 +01:00
Ruslan Lesiutin 8a18b53bcd bump packages for 0.73 (#36556)
Summary:
Changelog: [Internal]

Publishing to check CI if bumping and aligning in the same commit will work, since these new versions are not available on npm yet, but maybe our new monorepo setup will resolve this

**Adding back `react-native/virtualized-lists` as a workspace to `xplat/js` so that it won't be resolved from npm**

#publish-packages-to-npm

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

Reviewed By: cipolleschi

Differential Revision: D44255353

Pulled By: hoxyq

fbshipit-source-id: 21372487d6e9c0b2382b7cd9af835beed46b8ce1
2023-03-30 15:55:58 -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 5ac7c7f9a5 RNGP - Add librrc_legacyviewmanagerinterop to pickfirst config block
Summary:
This adds `librrc_legacyviewmanagerinterop.so` to the pickFirst block inside RNGP.
While testing the Fabric Interop layer, I realized that I forgot to add it here and now the build
fires a warning as follows:

```
> Task :app:mergeDebugNativeLibs
2 files found for path 'lib/arm64-v8a/librrc_legacyviewmanagerinterop.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /private/tmp/RNNightly/android/app/build/intermediates/cxx/Debug/194810a4/obj/arm64-v8a/librrc_legacyviewmanagerinterop.so
 - /Users/ncor/.gradle/caches/transforms-3/ba1c1d3560a64e70d8218910c5a43605/transformed/jetified-react-android-0.0.0-20230302-2110-caf80d442-SNAPSHOT-debug/jni/arm64-v8a/librrc_legacyviewmanagerinterop.so
```

Changelog:
[Internal] [Changed] - RNGP - Add librrc_legacyviewmanagerinterop to pickfirst config block

Reviewed By: cipolleschi

Differential Revision: D43772845

fbshipit-source-id: cf34bb128b76f18e802a94c41c773f7cb2b7ec4a
2023-03-08 15:08:15 -08:00
Nicola Corti b0863e1239 Bumping all the changes we have on main (#36355)
Summary:
This will publish several changes we have pending on main, specifically changes to React Native Gradle Plugin which are needed to unblock nightlies.

#publish-packages-to-npm

## Changelog

[INTERNAL] - Bumping all the changes we have on main

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

Test Plan: n/a

Reviewed By: hoxyq

Differential Revision: D43733634

Pulled By: cortinico

fbshipit-source-id: 9c041f7557cd8e494dfc942ae89e13e55353bb48
2023-03-02 07:11:43 -08: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 81dd3afe0b Bump Gradle to 8.x (#36269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36269

This bumps our project to build on Gradle 8.x
All the necessary issues have already been resolved so everything should be green.
Gradle version has been bumped also inside the template and RNGP.

Changelog:
[Android] [Changed] - Bump Gradle to 8.x

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D43534184

fbshipit-source-id: ca1fd6799ff6d776743de2b2d809fc54bc533440
2023-02-27 13:47:09 -08:00