Fix build.gradle file paths in Kotlin migration guide#13342
Fix build.gradle file paths in Kotlin migration guide#13342lsaudon wants to merge 1 commit intoflutter:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Kotlin migration guide for app developers by correcting the file paths for Android build configuration files to include the app directory. The review feedback suggests extending these updates to the plugin authors' guide for consistency and refining the path placeholders for add-to-app host projects to more accurately reflect native Android project structures.
| It is likely located in the `plugins` block of the | ||
| `<app-src>/android/build.gradle` or the | ||
| `<app-src>/android/build.gradle.kts` file. | ||
| `<app-src>/android/app/build.gradle` or the |
There was a problem hiding this comment.
The PR title indicates a fix for the 'Kotlin migration guide', but it currently only updates for-app-developers.md. The for-plugin-authors.md file in the same directory also contains incorrect paths (e.g., using <app-src> instead of <plugin-project> and missing the correct directory structure) and should be updated to ensure the entire guide is accurate.
There was a problem hiding this comment.
Irrelevant. Path is good for plugin.
| **Before**: | ||
|
|
||
| ```kotlin title="<app-src>/android/build.gradle(.kts)" | ||
| ```kotlin title="<app-src>/android/app/build.gradle(.kts)" |
There was a problem hiding this comment.
For add-to-app host apps, the project structure is typically that of a native Android project where the app module is located directly in the app/ directory of the project root. Therefore, the path should be <host-app-project>/app/build.gradle(.kts) instead of <app-src>/android/app/build.gradle(.kts). This also maintains consistency with the placeholder used on line 37.
There was a problem hiding this comment.
Not related to my edit.
| Next, remove the `kotlin-android` plugin and the `kotlinOptions` block: | ||
|
|
||
| ```kotlin diff title="<app-src>/android/build.gradle.kts" | ||
| ```kotlin diff title="<app-src>/android/app/build.gradle.kts" |
There was a problem hiding this comment.
Not related to my edit.
| Add the `kotlin.compilerOptions{}` DSL block with the following: | ||
|
|
||
| ```kotlin diff title="<app-src>/android/build.gradle.kts" | ||
| ```kotlin diff title="<app-src>/android/app/build.gradle.kts" |
There was a problem hiding this comment.
Not related to my edit.
| **After**: | ||
|
|
||
| ```kotlin title="<app-src>/android/build.gradle(.kts)" | ||
| ```kotlin title="<app-src>/android/app/build.gradle(.kts)" |
There was a problem hiding this comment.
Not related to my edit.
|
/gcbrun @lsaudon, can you address the bot's comments? |
|
Visit the preview URL for this PR (updated for commit 5d40448): |
|
Hi @sfshaza2, The comments are either wrong or not directly related to my edit. |
Description of what this PR is changing or adding, and why:
Fixes incorrect file paths in the Kotlin migration guide.
The
build.gradle/build.gradle.ktsreferences pointed to<app-src>/android/build.gradleinstead of the correct<app-src>/android/app/build.gradle.The
kotlin-androidplugin andkotlinOptionsblock live in the app-level Gradle file, not the project-level one.Presubmit checklist
of 80 characters or fewer.