mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: This PR adds the basic `ktfmt` setup in OSS to lint Kotlin files before they're imported into the Meta codebase, making collaboration with external contributors smoother for Android related PRs. I tried to put together certain rules that mimic the current code style and it seems to work well as I get no errors for properly formatted files but this still might need some input to have the correct configuration. Added two scripts to the main package.json: - To check the files format you can run: `yarn lint-kotlin-check` - To apply formatting fixes, run: `yarn lint-kotlin` ## Changelog: [INTERNAL] - Kotlin: Set up ktfmt in OSS Pull Request resolved: https://github.com/facebook/react-native/pull/52064 Test Plan: Unformat any random Kotlin file inside ReactAndroid and then run: ```sh yarn lint-kotlin-check yarn lint-kotlin ``` Reviewed By: cipolleschi Differential Revision: D78272876 Pulled By: cortinico fbshipit-source-id: 0cf6b976968dfc5c6c478e88d17eb21c18961a34
@react-native/gradle-plugin
A Gradle Plugin used to support development of React Native applications for Android.
Installation
yarn add @react-native/gradle-plugin
Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like
Testing
To run the tests in this package, run the following commands from the React Native root folder:
yarnto install the dependencies. You just need to run this once./gradlew -p packages/gradle-plugin test.