Skip to content

Commit 8a4e89e

Browse files
authored
Add script for managing versions (#78)
1 parent 49e5b7b commit 8a4e89e

File tree

7 files changed

+52
-11
lines changed

7 files changed

+52
-11
lines changed
File renamed without changes.

flutter_launcher_mcp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To use `flutter_launcher_mcp`, add it as a dependency to your `pubspec.yaml`:
2222

2323
```yaml
2424
dependencies:
25-
flutter_launcher_mcp: ^0.1.0
25+
flutter_launcher_mcp: ^0.2.1
2626
```
2727
2828
Then, run `dart pub get`.

flutter_launcher_mcp/lib/src/server.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ final class FlutterLauncherMCPServer extends MCPServer
5050
}) : super.fromStreamChannel(
5151
implementation: Implementation(
5252
name: 'Flutter Launcher MCP Server',
53-
version: '0.1.0',
53+
version: const String.fromEnvironment(
54+
'FLUTTER_LAUNCHER_VERSION',
55+
defaultValue: '0.0.0-dev',
56+
),
5457
),
5558
instructions:
5659
'Provides tools to launch and manage Flutter applications.',

flutter_launcher_mcp/pubspec.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
# Copyright 2025 The Flutter Authors.
2-
# Use of this source code is governed by a BSD-style license that can be
3-
# found in the LICENSE file.
4-
51
name: flutter_launcher_mcp
62
description: An MCP server for launching and managing Flutter applications.
73
version: 0.2.1
8-
94
environment:
105
sdk: ^3.9.0
11-
126
dependencies:
137
args: ^2.7.0
148
async: ^2.13.0
@@ -20,7 +14,6 @@ dependencies:
2014
stream_channel: ^2.1.4
2115
unified_analytics: ^8.0.5
2216
yaml: ^3.1.3
23-
2417
dev_dependencies:
2518
fake_async: ^1.3.3
2619
lints: ^6.0.0

scripts/build_release.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ $exeFile = "flutter_launcher_mcp.exe"
55

66
Push-Location flutter_launcher_mcp
77
dart pub get
8-
dart compile exe bin/flutter_launcher_mcp.dart -o "../$exeFile"
8+
$version = (Get-Content pubspec.yaml | Select-String -Pattern "version:\s*(\S+)" | ForEach-Object { $_.Matches[0].Groups[1].Value })
9+
dart compile exe bin/flutter_launcher_mcp.dart -o "../$exeFile" --define=FLUTTER_LAUNCHER_VERSION=$version
910
Pop-Location
1011

1112
$tempDir = "temp_archive"

scripts/build_release.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ compile_log="$(mktemp --tmpdir compile_log_XXXX)"
3030
function build_exe() (
3131
CDPATH= cd flutter_launcher_mcp && \
3232
dart pub get && \
33-
dart compile exe bin/flutter_launcher_mcp.dart -o "../$exe_file" 2>&1 > "$compile_log"
33+
version=$(yq -r '.version' pubspec.yaml) && \
34+
dart compile exe bin/flutter_launcher_mcp.dart -o "../$exe_file" --define=FLUTTER_LAUNCHER_VERSION=$version 2>&1 > "$compile_log"
3435
)
3536

3637
build_exe || \

scripts/bump_version.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
3+
# Bumps the version number to the given version number.
4+
5+
set -e
6+
7+
if [ "$#" -ne 1 ]; then
8+
echo "Usage: $0 <new_version>"
9+
exit 1
10+
fi
11+
12+
NEW_VERSION="$1"
13+
14+
# Get the absolute path to the directory containing this script.
15+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
16+
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
17+
18+
# Update gemini-extension.json
19+
jq --arg version "$NEW_VERSION" '.version = $version' "$REPO_ROOT/gemini-extension.json" > "$REPO_ROOT/gemini-extension.json.tmp" && command mv -f "$REPO_ROOT/gemini-extension.json.tmp" "$REPO_ROOT/gemini-extension.json"
20+
21+
# Update pubspec.yaml
22+
yq -y ".version = \"$NEW_VERSION\"" "$REPO_ROOT/flutter_launcher_mcp/pubspec.yaml" > "$REPO_ROOT/flutter_launcher_mcp/pubspec.yaml.tmp" && mv "$REPO_ROOT/flutter_launcher_mcp/pubspec.yaml.tmp" "$REPO_ROOT/flutter_launcher_mcp/pubspec.yaml"
23+
24+
# Check and update CHANGELOG.md
25+
CHANGELOG_FILE="$REPO_ROOT/CHANGELOG.md"
26+
if ! grep -q "## $NEW_VERSION" "$CHANGELOG_FILE"; then
27+
echo "Adding version $NEW_VERSION to $CHANGELOG_FILE"
28+
TEMP_FILE=$(mktemp)
29+
{
30+
echo "## $NEW_VERSION"
31+
echo ""
32+
echo "- TODO: Describe the changes in this version."
33+
echo ""
34+
cat "$CHANGELOG_FILE"
35+
} > "$TEMP_FILE"
36+
mv "$TEMP_FILE" "$CHANGELOG_FILE"
37+
fi
38+
39+
# Update README.md
40+
sed -i.bak 's/ flutter_launcher_mcp: \^.*/ flutter_launcher_mcp: ^'"$NEW_VERSION/g" "$REPO_ROOT/flutter_launcher_mcp/README.md" && \
41+
rm "$REPO_ROOT/flutter_launcher_mcp/README.md.bak"
42+
43+
echo "Version bumped to $NEW_VERSION"

0 commit comments

Comments
 (0)