Skip to content

Conversation

@gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Jan 5, 2026

Description

Converts the scripts to be Dart scripts instead, so they can be more cross platform and more maintainable by the Flutter team (no more powershell, for instance).

Also adds tests for the scripts.

Fixes #45

Summary of Changes

This pull request undertakes a significant refactoring effort by migrating the project's build, versioning, and local update scripts from various shell languages to Dart. The primary goal is to enhance the scripts' cross-platform compatibility and ease of maintenance for the Flutter team. This change involves the removal of old shell scripts and the introduction of new, well-structured Dart equivalents, complete with a dedicated utility layer and unit tests to ensure reliability.

Highlights

  • Script Language Conversion: The existing shell scripts (Bash and PowerShell) have been entirely replaced with new Dart scripts, aiming for improved cross-platform compatibility and maintainability.
  • New Dart Scripts: Three primary Dart scripts have been introduced: build_release.dart for creating release archives, bump_version.dart for updating project versions, and update_local.dart for managing local installations.
  • Shared Utilities and Testability: A new utils.dart file provides shared functionalities and a ScriptContext for dependency injection, significantly enhancing the testability of the scripts. Unit tests for the new Dart scripts have also been added.
  • Robustness Improvements: Several suggestions from automated review comments were addressed, including more robust JSON parsing, explicit home directory checks, simplified changelog updates, and dynamic architecture detection for platform information.
Changelog
  • scripts/bin/build_release.dart
    • Added new Dart script for building release archives.
  • scripts/bin/bump_version.dart
    • Added new Dart script for bumping project versions in gemini-extension.json and CHANGELOG.md.
  • scripts/bin/update_local.dart
    • Added new Dart script for updating local extension installations.
  • scripts/build_release.ps1
    • Removed old PowerShell script for building releases.
  • scripts/build_release.sh
    • Removed old Bash script for building releases.
  • scripts/bump_version.sh
    • Removed old Bash script for bumping versions.
  • scripts/lib/src/build_release_command.dart
    • Added core logic for building release archives, including OS/architecture detection and archive creation.
  • scripts/lib/src/bump_version_command.dart
    • Added core logic for updating version numbers in gemini-extension.json and CHANGELOG.md.
  • scripts/lib/src/update_local_command.dart
    • Added core logic for updating local installations, leveraging the build release command.
  • scripts/lib/src/utils.dart
    • Added a utility file containing ScriptContext for dependency injection, ExitException for controlled exits, and helper functions for finding the repository root, getting platform info, and running/capturing process output.
  • scripts/pubspec.lock
    • Added new file to manage Dart package dependencies.
  • scripts/pubspec.yaml
    • Added new file to define Dart project dependencies and metadata.
  • scripts/test/scripts_test.dart
    • Added unit tests for BuildReleaseCommand, BumpVersionCommand, and UpdateLocalCommand using mock file systems and process managers.
  • scripts/update_local.sh
    • Removed old Bash script for updating local installations.

gemini-code-assist[bot]

This comment was marked as resolved.

@gspencergoog gspencergoog requested a review from johnpryan January 5, 2026 21:43
gspencergoog and others added 2 commits January 5, 2026 13:45
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
gemini-code-assist[bot]

This comment was marked as resolved.

@gspencergoog gspencergoog requested review from johnpryan and removed request for johnpryan January 13, 2026 19:11
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.

Scripts in Dart?

1 participant