Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49301
The hermesc logging is extremely noisy and not relevant for the users. I'm disabling it for the task that runs metro+hermesc (only for the hermesc) part.
Changelog:
[Internal] [Changed] - Disable console logging for hermesc
Reviewed By: robhogan
Differential Revision: D69399156
fbshipit-source-id: e5f8722b33d30675aba5a8aa82c456be21254b0c
Summary:
I wanted to test exclusion of .d.ts files in https://github.com/facebook/react-native/pull/49227, but it also has node_modules so it will not test that condition correctly.
## Changelog:
[INTERNAL] [FIXED] - Fix exclude .d.ts test in GenerateCodegenSchemaTaskTest
Pull Request resolved: https://github.com/facebook/react-native/pull/49238
Test Plan: Run tests
Reviewed By: cipolleschi
Differential Revision: D69291695
Pulled By: cortinico
fbshipit-source-id: 46b9367f3466b9cd49232a0565e5778a06b43990
Summary:
In some projects we have conventions of using .tsx extension even for files without react components, we had issues where codegen wasn't updated properly.
I debugged the files included in a large project and made some improvements:
- Include tsx and jsx files
- exclude nested node_modules
- exclude ts type def files
## Changelog:
[ANDROID] [FIXED] - Improve input files for codegen gradle task
Pull Request resolved: https://github.com/facebook/react-native/pull/49227
Test Plan: Tested in a large app using codegen. I inspected the files that are included in the task inputs and made sure it works with first party and 3rd party modules.
Reviewed By: cipolleschi
Differential Revision: D69254204
Pulled By: cortinico
fbshipit-source-id: 368408e9719e9b5c9839dd873430b86ae4a062c7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49118
We finished the migration away from CircleCI, so we are cleaning up the codebase.
This change updates references to CircleCI from gradle.
## Changelog:
[Internal] - Remove references from CircleCI in RNGP
Reviewed By: cortinico
Differential Revision: D69047484
fbshipit-source-id: 4ab40be62e6769eb3a8f65136464eed6628d47a4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48896
This comment is not exact and should be updated.
Changelog:
[Internal] [Changed] -
Reviewed By: yungsters
Differential Revision: D68556425
fbshipit-source-id: 67427ff325809907fdeba1c6a90b84b97713bf5e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48745
This is the first step in a series of diff to make RNGP more Gradle-compliant (specifically for the sake of configuration caching).
Specifically the problem in those 2 tasks is that we're accessing `project.copy()` and other
functions from the `project` field.
The project should never be accessed at execution time. See more on this here:
https://docs.gradle.org/8.12/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
This diff fixes it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D68282777
fbshipit-source-id: 6d474f266b5bc50fba57c8cd478173c995864bbc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48689
We don't intent to use the prealpha logic in the near future so it makes sense to remove it for
to simplify our already complicated release process. We can always revive it if we wish.
Changelog:
[Internal] [Changed] - RNGP - Cleanup prealpha logic from the Gradle Plugin
Reviewed By: cipolleschi
Differential Revision: D68205665
fbshipit-source-id: 81d5257544df97b566421164944e3b6e71f06635
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48595
Historically React Native used to include the JitPack repository be default in the default repositories.
This sadly exposes React Native projects to supply chain attacks as explained here:
https://blog.oversecured.com/Introducing-MavenGate-a-supply-chain-attack-method-for-Java-and-Android-applications/
Moreover, artifacts on Jitpack are not GPG signed it's complicated to verify the identity of artifact authors.
I'm introducing a Gradle property to control if Jitpack should be included by default or not.
User can control this behavior by changing their `gradle.properties` file as such:
```
includeJitpackRepository=false
```
The default value of this property is currently true, but we're looking into changing it to false in the future.
Changelog:
[Android] [Added] - Make the addition of JitPack repository configurable
Reviewed By: cipolleschi
Differential Revision: D68016028
fbshipit-source-id: 392513fef389a4835b4e00a8184459e00d51fdd0
Summary:
building RN tester with 0.77 rc-0 doesn't work now because of `java.io.IOException: No such file or directory` on line 48.
`buildDirectory` is a Gradle property representing a file
https://github.com/facebook/react-native/pull/47552 removes this file altogether so feel free to close if that one is the "right one"
## Changelog:
[ANDROID] [FIXED] - fix IOException in `BuildCodegenCLITask`
Pull Request resolved: https://github.com/facebook/react-native/pull/48008
Test Plan: After this change, building RN tester works.
Reviewed By: cortinico
Differential Revision: D66650038
Pulled By: robhogan
fbshipit-source-id: 11cd83493fa118c6b79d11c9113228dd3971a803
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46958
This will make it easier to link against custom C++ TM which will most likely live inside ./shared or
some other paths outside of ./android.
CMake will have access to `PROJECT_ROOT_DIR` which points to ./android (the folder where the settings.gradle file exists).
Changelog:
[Internal] [Changed] - RNGP - Pass PROJECT_ROOT_DIR to CMake
Reviewed By: cipolleschi
Differential Revision: D64183641
fbshipit-source-id: 347256c04f10e92cf5a13e9c70db16aa29bcb741
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46756
prepareGlog was firing a warning due to a duplicate config.h file. Here I'm setting so that the file is always overridden (which is the desired behavior) to suppress this warning.
Changelog:
[Internal] [Changed] - Fix build warning for prepareGlog
Reviewed By: cipolleschi
Differential Revision: D63696664
fbshipit-source-id: 83b78afea09c4a5d39f341dd5b604cec466470ae
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46704
Our build log for Gradle is extremely noisy due to Hermes.
Here I'm suppressing all the build output from Hermes as we can't really do much from that side of the build.
This should make it easier for folks on GitHub Actions to immediately spot where are failures.
Changelog:
[Internal] [Changed] - Silence unnecessary Gradle outputs
Reviewed By: GijsWeterings
Differential Revision: D63541175
fbshipit-source-id: d1a60098c317ff9e8c9575b5b8b2aab639f28f2f
Summary:
Hey.
The react-native gradle plugin didn't properly filter out [Pure](https://github.com/react-native-community/cli/pull/2387) C++ TurboModules for autolinking, which caused build failures as a non-existing gradle dependency would be emitted.
This makes Pure C++ TurboModules work again for Android.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID][FIXED] Fix autolinking issues for Pure C++ TurboModules
Pull Request resolved: https://github.com/facebook/react-native/pull/46381
Test Plan:
https://github.com/hsjoberg/rn75autolinkregression
Try running this repro project to observe the error:
```
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/coco/Projects/Blixt/rn75autolinkregression/example/android/app/build.gradle' line: 54
* What went wrong:
A problem occurred evaluating project ':app'.
> Project with path ':react-native-cxx-turbomodule' could not be found in project ':app'.
```
Simply add the 1-line code from this PR to make the build succeed.
Cheers.
Reviewed By: cipolleschi
Differential Revision: D62377757
Pulled By: cortinico
fbshipit-source-id: 9e3fa3777b4e6e4d3f2eb0f996ac0ac7676eedbe
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46097
I've noticed we still have some tests here and there that were not migrated to AssertJ. This finishes them all.
Changelog:
[Internal] [Changed] - Finalize AssertJ migration
Reviewed By: javache
Differential Revision: D61473682
fbshipit-source-id: 3d51bfeb0e5ba3fd8cd4f3667dc88de3d88a3dbc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46059
This merges all the remaining dynamic libraries into libreactnative.so.
Sadly I couldn't split this in smaller diffs as all the libraries are connected with each other.
I also had to introduce 2 other SOs: `libhermestooling.so` and `libjsctooling.so` which contains
all the necessary libs used when loading either JSC or Hermes. They need to be isolated
as RNGP will remove those libraries based on the library the user decides to pick.
Changelog:
[Android] [Breaking] - Merge all the remaining .so libraries into libreactnative.so
Reviewed By: hezi
Differential Revision: D61376496
fbshipit-source-id: ab9e725b7acbebdfd8fa3ff36ad34d080044bf0e
Summary:
Issue: https://github.com/facebook/react-native/issues/45596
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [CHANGED] - Migrated `packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateCodegenArtifactsTaskTest.kt` to assertj.
Pull Request resolved: https://github.com/facebook/react-native/pull/45845
Test Plan: Run `./gradlew -p packages/gradle-plugin test`
Reviewed By: hezi
Differential Revision: D60597025
Pulled By: cortinico
fbshipit-source-id: 4228b958c7b9e1506640b9ff217f098e2626ea81
Summary:
Issue: https://github.com/facebook/react-native/issues/45596
## Changelog:
[INTERNAL] [CHANGED] - Migrate `BundleHermesCTaskTest.kt` to AssertJ testing library
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/45806
Test Plan: Run `./gradlew -p packages/gradle-plugin test`
Reviewed By: mdvacca
Differential Revision: D60522760
Pulled By: cortinico
fbshipit-source-id: f7847143d182b29e1bbbba738a0ddae9bf3ee59c
Summary:
Issue: https://github.com/facebook/react-native/issues/45596
## Changelog:
[INTERNAL] [CHANGED] - Migrate `GenerateCodegenSchemaTaskTest.kt` to AssertJ testing library
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/45807
Test Plan: Run `./gradlew -p packages/gradle-plugin test`
Reviewed By: andrewdacenko
Differential Revision: D60509334
Pulled By: cortinico
fbshipit-source-id: 0702958f0c9d03994b0c9a6a1c743f5db84e5703
Summary:
Issue: https://github.com/facebook/react-native/issues/45596
## Changelog:
[INTERNAL] [CHANGED] - Migrate `PreparePrefabHeadersTaskTest.kt` to AssertJ testing library
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/45808
Test Plan: Run `./gradlew -p packages/gradle-plugin test`
Reviewed By: andrewdacenko
Differential Revision: D60509282
Pulled By: cortinico
fbshipit-source-id: 1b7d9f0c24bb0e8e573f685582c532a38e6b3b13
Summary:
Issue: https://github.com/facebook/react-native/issues/45596
## Changelog:
[INTERNAL] [CHANGED] - Migrate `GeneratePackageListTaskTest.kt` to AssertJ testing library
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/45790
Test Plan: Run `./gradlew -p packages/gradle-plugin test`
Reviewed By: sammy-SC
Differential Revision: D60382287
Pulled By: cortinico
fbshipit-source-id: 338c771db9d407f0d83e1c62a8c13ac26d898926
Summary:
`getGradleDependenciesToApply` tries to call `implementation:` in all libraries, including the ones that are not supported on Android.
## Changelog:
[INTERNAL] [FIXED] - Filter out platform-specific libraries from the auto-linking gradle plugin
Pull Request resolved: https://github.com/facebook/react-native/pull/45749
Test Plan: CI should be green
Reviewed By: cipolleschi
Differential Revision: D60374769
Pulled By: cortinico
fbshipit-source-id: 33c83e9cc39d81b0e5c497570a936831ebb345f9
Summary:
https://github.com/facebook/react-native/issues/45596
Migrated all the assertions to use `assertThat()` function from AssertJ.
Also updated the `prepareBoostTask_withMissingConfiguration_fails` test to use `assertThatThrownBy` to check if the tested task throws a given exception.
## Changelog:
Migrate tests to assertj in these files:
- `packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PrepareBoostTaskTest.kt`
[INTERNAL] [CHANGED] - Migrated PrepareBoostTaskTest from junit.Assert to assertj.core.api.Assertions.
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/45718
Test Plan:
All tests pass when `./gradlew -p packages/gradle-plugin test` command is ran.
<img width="454" alt="image" src="https://github.com/user-attachments/assets/9e954f7b-2208-48a9-ae15-ab642252e6da">
Reviewed By: GijsWeterings
Differential Revision: D60284566
Pulled By: cortinico
fbshipit-source-id: 11af0a0ca574f935e6aab3a7855b5daaeab1a718
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45598
I've noticed we attempt to load JSC from the Sonatype Snapshot repository.
That is inefficient as we already know that JSC is available only inside node modules.
This change makes the repository resolution stricter by better specifying which
repo can download which dependency.
Changelog:
[Internal] [Changed] - Do not attempt to load JSC from other repositories
Reviewed By: cipolleschi
Differential Revision: D60116002
fbshipit-source-id: 21a2213708f5b0103860a59f3342f1bc0f59cdb9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45572
0.75-rc.5 is currently broken on Windows.
This is due to us invoking `npx react-native-community/cli config` without
a `cmd /c` prefix.
This fixes it by using our function `windowsAwareCommandLine`.
The problem is that this required a lot of refactoring since that util was not available for the settings plugin.
Fixes#45403
Changelog:
[Internal] [Changed] - Fix core autolinking not working on Windows
Reviewed By: cipolleschi
Differential Revision: D60037587
fbshipit-source-id: eefeda7aafc43b9ce08f0f9225b0847fad2f46b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45510
This is just a quality of life improvement, where we test the C++ autolinking
code generation a bit more.
Changelog:
[Internal] [Changed] - Improve tests for GenerateAutolinkingNewArchitecturesFileTask
Reviewed By: blakef
Differential Revision: D59907847
fbshipit-source-id: e6367cc3b1c01700310437b73bc984e3666b3499
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