-
Notifications
You must be signed in to change notification settings - Fork 640
dataconnect: fix some gradle configuration warnings, like targetSdk and kotlinOptions being deprecated #7332
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
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
Summary of Changes
Hello @dconeybe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request focuses on modernizing the Gradle build configurations for the dataconnect
project. The primary goal is to eliminate deprecation warnings by adopting updated syntax for Android's targetSdk
and Kotlin's compiler options, ensuring the project remains compatible with the latest build tools and best practices.
Highlights
- Gradle Configuration Updates: Updated Gradle build scripts across multiple modules to address deprecation warnings related to
targetSdk
andkotlinOptions
. - Kotlin Compiler Options Migration: Migrated Kotlin compiler configurations from the deprecated
kotlinOptions
block to the newkotlin { compilerOptions { ... } }
DSL, ensuring compatibility with newer Gradle and Kotlin versions. - Android Target SDK Relocation: Relocated the
targetSdk
property fromdefaultConfig
totestOptions
andlint
blocks, aligning with modern Android Gradle Plugin recommendations. - Explicit API Mode Refinement: Refined the configuration for Kotlin's 'Explicit API Mode' by updating the task type from
KotlinCompile
toKotlinJvmCompile
and simplifying the addition of compiler arguments.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request effectively addresses several Gradle configuration warnings by updating deprecated properties like targetSdk
and kotlinOptions
. The changes are consistent across all modified modules and adopt the modern, recommended approach for configuring Kotlin compiler options. This improves the maintainability of the build scripts. I've found one potential issue in the Spotless configuration that could break the build, for which I've left a specific comment.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
…ns so that it's easier to fix warnings based on the logs from github actions
…precated "project" property at execution time.
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.
Pull Request Overview
This PR modernizes Gradle and Kotlin build configurations for the dataconnect
project to eliminate deprecation warnings and align with current best practices. The changes ensure compatibility with newer build tools while maintaining existing functionality.
- Migrated deprecated
kotlinOptions
to the newkotlin { compilerOptions { ... } }
DSL for better Kotlin compiler configuration - Relocated deprecated
targetSdk
property fromdefaultConfig
to appropriate blocks (testOptions
andlint
) for Android libraries - Updated Gradle task dependencies to use injected services instead of deprecated project methods
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
firebase-dataconnect/testutil/testutil.gradle.kts | Updated Kotlin compiler options and moved targetSdk to testOptions/lint blocks |
firebase-dataconnect/firebase-dataconnect.gradle.kts | Migrated to new Kotlin compiler options DSL and updated explicit API mode configuration |
firebase-dataconnect/connectors/connectors.gradle.kts | Applied Kotlin compiler modernization and targetSdk relocation |
firebase-dataconnect/androidTestutil/androidTestutil.gradle.kts | Updated Kotlin configuration and targetSdk placement |
firebase-dataconnect/demo/build.gradle.kts | Migrated Kotlin compiler options and updated spotless configuration |
firebase-dataconnect/gradleplugin/plugin/src/main/kotlin/* | Added dependency injection for ExecOperations and FileSystemOperations |
.github/workflows/*.yml | Added warning mode flags to Gradle commands for better build visibility |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.../src/main/kotlin/com/google/firebase/dataconnect/gradle/plugin/DataConnectRunEmulatorTask.kt
Outdated
Show resolved
Hide resolved
...src/main/kotlin/com/google/firebase/dataconnect/gradle/plugin/DataConnectGenerateCodeTask.kt
Outdated
Show resolved
Hide resolved
...otlin/com/google/firebase/dataconnect/gradle/plugin/DataConnectMergeConfigDirectoriesTask.kt
Show resolved
Hide resolved
Summary of ChangesThis pull request modernizes the Gradle build configurations across the dataconnect project. The changes primarily focus on resolving deprecation warnings related to Android's targetSdk and Kotlin's compiler options, ensuring the project aligns with the latest build tool recommendations and maintains compatibility. Highlights
Changelog
Activity
|
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.
Code Review
This pull request does an excellent job of addressing Gradle deprecation warnings and modernizing the build scripts. The migration from kotlinOptions
to the compilerOptions
DSL and updating the targetSdk
location for Android libraries are well-executed across all modules. The refactoring of Gradle tasks to use injected services like FileSystemOperations
and ExecOperations
instead of direct project
access is a significant improvement for build cacheability and correctness. I have a few suggestions to further improve the Gradle task implementations by using the recommended APIs for file operations, which will enhance build caching and reliability.
This PR fixes some Gradle build warnings for the
dataconnect
project. The primary goal is to eliminate deprecation warnings by adopting updated syntax for Android'stargetSdk
and Kotlin's compiler options, ensuring the project remains compatible with the latest build tools and best practices.Highlights
targetSdk
andkotlinOptions
.kotlinOptions
block to the newkotlin { compilerOptions { ... } }
DSL, ensuring compatibility with newer Gradle and Kotlin versions.targetSdk
property fromdefaultConfig
totestOptions
andlint
blocks in Android libraries, as thattargetSdk
property in libraries is deprecated and scheduled for removal (only for libraries though, Android application DSL is not affected).KotlinCompile
toKotlinJvmCompile
and simplifying the addition of compiler arguments.DefaultTask.project
attribute in the execution phase, which is deprecated and will be removed in a future version of Gradle. UsingExecOperations
andFileSystemOperations
instead.See https://issuetracker.google.com/issues/230625468 for details about the removal of
targetSdk
from the DSL for Android libraries.See https://kotlinlang.org/docs/gradle-compiler-options.html for details about the Kotlin compiler options change.