Skip to content
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

chore: configure and build Dev Container for flutter development #1144

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

ZauberNerd
Copy link
Contributor

@ZauberNerd ZauberNerd commented Jan 5, 2025

This commit adds a Dev Container configuration to allow building and testing the Android Flutter application without additional setup on the host.
It also presents a method of using the Dev Container in a cloud workspace (GitHub Codespaces) while still being able to push the builds to a connected Android device.

Summary by Sourcery

Build:

  • Add a Dev Container configuration with necessary dependencies and tools for Flutter and Android development.

Copy link
Contributor

sourcery-ai bot commented Jan 5, 2025

Reviewer's Guide by Sourcery

This pull request introduces a Dev Container configuration for building and testing the Android Flutter application, simplifying the development setup and enabling usage in cloud workspaces like GitHub Codespaces. It also includes instructions for connecting to Android devices via ADB for debugging and running the application.

Sequence diagram for Dev Container setup and device connection

sequenceDiagram
    participant Dev as Developer
    participant DC as Dev Container
    participant ADB as ADB Server
    participant AD as Android Device

    Dev->>DC: Open repository in VS Code
    DC->>DC: Initialize container
    DC->>DC: Install Flutter SDK
    DC->>DC: Install Android SDK

    alt USB Pass-through
        Dev->>AD: Connect via USB
        DC->>AD: Detect device via ADB
    else Host ADB Server
        Dev->>ADB: Start ADB server on all interfaces
        DC->>ADB: Connect to host ADB (tcp:5037)
        ADB->>AD: Connect to device
    else Wireless Connection
        Dev->>AD: Enable wireless debugging
        DC->>AD: Pair device (adb pair)
        DC->>AD: Connect to device (adb connect)
    end

    DC->>AD: Deploy Flutter app
Loading

File-Level Changes

Change Details Files
Added Dev Container configuration files.
  • Created a Dockerfile to define the Dev Container environment, including installing necessary dependencies like Flutter SDK, Android SDK, and build tools.
  • Created a devcontainer.json file to configure the Dev Container settings and extensions in VSCode and other supported IDEs.
.devcontainer/Dockerfile
.devcontainer/devcontainer.json
Updated the README file with Dev Container usage instructions.
  • Added a new section to the README explaining how to use the Dev Container.
  • Provided instructions for connecting to Android devices via ADB using various methods like USB pass-through, host ADB server, and wireless debugging.
  • Included details on how to set up ADB for different operating systems and network configurations.
README.md

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.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a 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. You can also use
    this command to specify where the summary should be inserted.

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
Collaborator

@adityastic adityastic left a comment

Choose a reason for hiding this comment

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

Would make development really convenient! Thanks for looking after dev xp

This commit adds a Dev Container configuration to allow building and
testing the Android Flutter application without additional setup on the
host.
It also presents a method of using the Dev Container in a cloud
workspace (GitHub Codespaces) while still being able to push the builds
to a connected Android device.
@adityastic adityastic enabled auto-merge (squash) January 6, 2025 00:19
@adityastic adityastic merged commit 60773d7 into fossasia:flutter_app Jan 6, 2025
5 checks passed
@ZauberNerd ZauberNerd deleted the devcontainer branch January 6, 2025 11:17
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.

2 participants