Skip to content

Conversation

@LucasXu0
Copy link
Collaborator

@LucasXu0 LucasXu0 commented Jul 14, 2025

Feature Preview


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Update Android build tooling and configuration by upgrading AGP and Gradle versions, raising compileSdk levels, and aligning Java/Kotlin compilation settings alongside adding module namespaces.

Enhancements:

  • Increase Android compileSdkVersion to 35 for the app module
  • Add Java 1.8 source/target compatibility and set Kotlin JVM target to 1.8 in backend module
  • Declare explicit Android namespaces for backend and flowy_infra_ui modules

Build:

  • Upgrade Android Gradle Plugin to 8.1.0 across relevant modules
  • Update Gradle wrapper distribution to Gradle 8.1

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jul 14, 2025

Reviewer's Guide

This PR upgrades the Android Gradle Plugin to 8.1.0 and Gradle wrapper to 8.1, bumps compileSdk levels, and adds required namespace and compile option configurations to support the updated toolchain across multiple Android modules.

Class diagram for updated Android module build configurations

classDiagram
    class AppModule {
        +compileSdkVersion: 35
        +ndkVersion: "24.0.8215888"
    }
    class BackendModule {
        +compileSdkVersion: 33
        +namespace: 'com.plugin.appflowy_backend'
        +compileOptions: Java 1.8
        +kotlinOptions: JVM 1.8
    }
    class InfraUIModule {
        +compileSdkVersion: 33
        +namespace: 'com.example.flowy_infra_ui'
    }
    AppModule <|-- BackendModule
    AppModule <|-- InfraUIModule
Loading

File-Level Changes

Change Details Files
Bump Android Gradle Plugin version
  • Upgraded AGP classpath from 7.4.2 to 8.1.0
frontend/appflowy_flutter/packages/appflowy_backend/android/build.gradle
frontend/appflowy_flutter/android/build.gradle
Update Gradle wrapper distribution
  • Switched Gradle wrapper from 7.5 to 8.1-all distribution
frontend/appflowy_flutter/android/gradle/wrapper/gradle-wrapper.properties
Increase compileSdkVersion
  • Raised compileSdk from 34 to 35 in the app module
frontend/appflowy_flutter/android/app/build.gradle
Configure namespace and Java/Kotlin compile options
  • Added Android namespace to backend and infra UI modules
  • Set sourceCompatibility and targetCompatibility to Java 1.8
  • Set Kotlin jvmTarget to 1.8
frontend/appflowy_flutter/packages/appflowy_backend/android/build.gradle
frontend/appflowy_flutter/packages/flowy_infra_ui/android/build.gradle

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @LucasXu0 - I've reviewed your changes - here's some feedback:

  • AGP 8.1 requires JDK 11+, please ensure your local and CI environments are using Java 11 to avoid build failures.
  • The flowy_infra_ui module adds compileOptions but is missing a kotlinOptions jvmTarget block—add it to keep the Kotlin JVM target consistent across modules.
  • Double-check that the namespaces ('com.plugin.appflowy_backend' and 'com.example.flowy_infra_ui') correctly match your package structure to prevent resource/R-class conflicts.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- AGP 8.1 requires JDK 11+, please ensure your local and CI environments are using Java 11 to avoid build failures.
- The flowy_infra_ui module adds compileOptions but is missing a kotlinOptions jvmTarget block—add it to keep the Kotlin JVM target consistent across modules.
- Double-check that the namespaces ('com.plugin.appflowy_backend' and 'com.example.flowy_infra_ui') correctly match your package structure to prevent resource/R-class conflicts.

## Individual Comments

### Comment 1
<location> `frontend/appflowy_flutter/android/gradle/wrapper/gradle-wrapper.properties:3` </location>
<code_context>
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
 networkTimeout=10000
 validateDistributionUrl=true
</code_context>

<issue_to_address>
Switching to gradle-8.1-all.zip increases distribution size.

The '-all' distribution includes sources and docs. If you don't need these, use '-bin' to minimize download size.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
=======
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Switching to gradle-8.1-all.zip increases distribution size.

The '-all' distribution includes sources and docs. If you don't need these, use '-bin' to minimize download size.

Suggested change
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip

@LucasXu0 LucasXu0 merged commit 6b84c4b into AppFlowy-IO:main Jul 14, 2025
10 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant