-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert gradle scripts to Kotlin #14
Convert gradle scripts to Kotlin #14
Conversation
|
||
This is not a breaking change because it affects only gradle scripts used to build RN for Android. | ||
|
||
I converted build.gradle and settings.gradle in root directory, see at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you link to specific files in the repo, so that they are easier to consume ?
|
||
## Detailed design | ||
|
||
Convert only gradle scripts in ReactAndroid, and maybe RNTester, to Kotlin DSL, so we don't introduce breaking changes to RN based projects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also consider scenarios where React Native is embedded into existing android apps. How will that work ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may also want to consider the changes coming in React Fabric and Turbo Modules. In both cases, there would be code-gen solutions, possible in JS. How would that integrate with the build system? These Code gen solutions are not finalized, so I may not yet have specific examples.
Also, we may need to run annotation processors, like ReactModuleInfoSpecProcessor
that we don't run today. Should we address that also ?
* auto-completion and content assist | ||
* quick documentation | ||
* navigation to source | ||
* refactoring and more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to explicitly list all the advantages here, linking to the official reason that Gradle has given may be sufficient.
|
||
## Drawbacks | ||
|
||
Currently, RN use Gradle 4.4 which has partial but enough support for Kotlin DSL. Until we have 4.10, which has stable Kotlin DSL, we have to make sure that gradle scripts works and might require changes to work with landed Gradle version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, does it make sense to wait till Gradle 4.10 and then do the upgrade ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dulmandakh - ping. What do you think about addressing this later when Gradle 4.10 comes around ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gradle 6.7.1 is already out now, so how is it going
|
||
## How we teach this | ||
|
||
This change won't affect RN based projects and RN developers, but RN core contributors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should still consider how we can get core contributors up to speed here.
* navigation to source | ||
* refactoring and more | ||
|
||
Also, nowadays there are more Android developers who knows Kotlin than Groovy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this impacts only contributors, this would also require commitment from core contributors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also impact all users of React Native with Android, as they also make changes to the gradle config in the template android project which is generated by RN.
Thank you all for feedbacks, I'll try update my proposal ASAP to reflect the feedbacks and I'll do some research on questions. |
date: 2018-08-11 | ||
--- | ||
|
||
# RFC0003: Use Kotlin DSL in gradle scripts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is RFC0004.
What's the status of this RFC? I think we use gradle 4.10+ now in RN so we can move ahead with this, no? |
The usage of the old gradle script synctax such as We can not use the full kotlin dsl and features like There are no workarounds for the incompatibilities caused by the way react native uses gradle. As a result react native is a blocker for the whole build tools ecosystem. No one can move forward without react native doing the first step to support the "new" gradle features and dropping the old syntax. |
Thanks for raising this point @Legion2. We're currently working on revamping how we integrate with Gradle. Some of the work is already available inside https://github.com/facebook/react-native/tree/main/packages/react-native-gradle-plugin Once that is fully released, you won't need a EDIT: A more wider explanation on the direction we're taking with Gradle is described in detail by @fkgozali here #273 |
No description provided.