Skip to content

Conversation

Akhash16
Copy link

@Akhash16 Akhash16 commented Aug 10, 2025

  • Add Windows-compatible build scripts for Android using duckscript
  • Update Android README with Windows-specific NDK configuration
  • Create comprehensive BUILD_FROM_SOURCE.md documentation
  • Update main README and Flutter README to reference centralized docs
  • Split Android build tasks into platform-specific variants

Fixes #5336: Build for Android on Windows + Documentation update

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

Add Windows support for Android builds, refactor Android build tasks into platform-specific variants, and centralize all build instructions into a comprehensive documentation guide

New Features:

  • Add Windows-specific cargo-make task for building the Android SDK

Enhancements:

  • Split Android build tasks into platform-specific variants for Unix and Windows
  • Add initial Android app entry point (MainActivity.kt) and launch splash screen layout

CI:

  • Add Windows aliases and tasks for Android CI builds

Documentation:

  • Create centralized BUILD_FROM_SOURCE.md guide covering all platforms
  • Update Android README with Windows environment variable and cargo config instructions
  • Reference centralized documentation in main README and Flutter README

- Add Windows-compatible build scripts for Android using duckscript
- Update Android README with Windows-specific NDK configuration
- Create comprehensive BUILD_FROM_SOURCE.md documentation
- Update main README and Flutter README to reference centralized docs
- Split Android build tasks into platform-specific variants

Fixes AppFlowy-IO#5336: Build for Android on Windows + Documentation update
@CLAassistant
Copy link

CLAassistant commented Aug 10, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

sourcery-ai bot commented Aug 10, 2025

Reviewer's Guide

This PR adds Windows support for Android builds by introducing new platform-specific build tasks in the mobile makefile (using duckscript for Windows), centralizes all build instructions into a comprehensive BUILD_FROM_SOURCE.md, and updates existing READMEs to reference the new documentation while enriching the Android guide with OS-specific NDK configuration.

Class diagram for new Android MainActivity and build scripts

classDiagram
    class MainActivity {
        +FlutterActivity
    }
    MainActivity --|> FlutterActivity

    class SdkBuildAndroid {
        +mac_alias
        +linux_alias
        +windows_alias
    }
    class SdkBuildAndroidUnix {
        +dependencies
        +private
        +script
        +script_runner = "@shell"
    }
    class SdkBuildAndroidWindows {
        +dependencies
        +private
        +script
        +script_runner = "@duckscript"
    }
    SdkBuildAndroid --> SdkBuildAndroidUnix
    SdkBuildAndroid --> SdkBuildAndroidWindows
Loading

File-Level Changes

Change Details Files
Introduce Windows-compatible Android build tasks
  • Add sdk-build-android-windows and sdk-build-android-ci-windows tasks with duckscript scripts
  • Map windows_alias to platform-specific tasks alongside mac_alias and linux_alias
frontend/scripts/makefile/mobile.toml
Centralize and expand documentation
  • Create BUILD_FROM_SOURCE.md with comprehensive cross-platform build steps
  • Update root README.md and appflowy_flutter/README.md to reference centralized docs
README.md
frontend/appflowy_flutter/README.md
doc/BUILD_FROM_SOURCE.md
Enhance Android README with OS-specific configuration
  • Add Windows and macOS/Linux instructions for setting ANDROID_NDK_HOME
  • Provide cargo config examples for Windows and UNIX platforms
  • Detail Clang fix steps and PATH setup per OS
frontend/appflowy_flutter/android/README.md
Add Android app entry point and launch background
  • Introduce MainActivity.kt for Flutter embedding
  • Add launch_background.xml for splash screen layer list
frontend/appflowy_flutter/android/app/src/main/kotlin/io/appflowy/appflowy/MainActivity.kt
frontend/appflowy_flutter/android/app/src/main/res/drawable/launch_background.xml

Assessment against linked issues

Issue Objective Addressed Explanation
#5336 Update documentation so that build instructions for iOS and Android are centralized and not reliant on external READMEs.
#5336 Add documentation for building Android, including Windows-specific instructions, and ensure it is available in docs.appflowy.io or the main documentation directory.
#5336 Add support for building Android on Windows (i.e., update build scripts and instructions so Android builds work on Windows as well as Linux and MacOS).

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 @Akhash16 - I've reviewed your changes - here's some feedback:

  • It looks like the editor’s .history folders are being committed – please remove those files from the PR so we don’t check in local history.
  • You’ve duplicated Android setup instructions in both BUILD_FROM_SOURCE.md and the Android README; consider centralizing or linking to one canonical doc to avoid drift.
  • The Windows build task only builds arm64-v8a, while the Unix scripts and CI cover multiple ABIs—please align the Windows scripts to support all required Android architectures.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- It looks like the editor’s `.history` folders are being committed – please remove those files from the PR so we don’t check in local history.
- You’ve duplicated Android setup instructions in both BUILD_FROM_SOURCE.md and the Android README; consider centralizing or linking to one canonical doc to avoid drift.
- The Windows build task only builds arm64-v8a, while the Unix scripts and CI cover multiple ABIs—please align the Windows scripts to support all required Android architectures.

## Individual Comments

### Comment 1
<location> `frontend/appflowy_flutter/README.md:35` </location>
<code_context>
+
+### What OS should I use for development?
+
+We support all OS for Development i.e. Linux, MacOS and Windows. We have detailed documentation on how to setup `AppFlowy_Flutter` on your local system for each operating system:
+
+- [Build from Source Guide](../../doc/BUILD_FROM_SOURCE.md) - Comprehensive setup instructions for all platforms
</code_context>

<issue_to_address>
Use 'macOS' instead of 'MacOS' for correct spelling.

Use 'macOS' with a lowercase 'm' and uppercase 'OS' to match Apple's official naming.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
We support all OS for Development i.e. Linux, MacOS and Windows. We have detailed documentation on how to setup `AppFlowy_Flutter` on your local system for each operating system:
=======
We support all OS for Development i.e. Linux, macOS and Windows. We have detailed documentation on how to setup `AppFlowy_Flutter` on your local system for each operating system:
>>>>>>> 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.

- Remove .history folders from commit
- Fix 'macOS' spelling (was 'MacOS')
- Add armeabi-v7a target to Windows Android build scripts for ABI parity
- Remove duplicated Android setup instructions, reference dedicated guide instead
- Remove unrelated Android app files from commit scope

Addresses feedback from PR AppFlowy-IO#8163
@Akhash16
Copy link
Author

Did all the stuff mentioned in the feedback.

@Akhash16 Akhash16 force-pushed the fix/android-windows-build-docs branch from f5496b8 to 0db720b Compare August 10, 2025 15:53
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@LucasXu0
Copy link
Collaborator

Please only update the code related to the Android build workflow. For documentation, please submit a PR in this repo: AppFlowy-Docs.

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.

[FR] Build for Android on Windows + Documentation update
3 participants