mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-30 22:26:42 +00:00
add flutter example app test
This commit is contained in:
36
client/flutter_ui/tool/bootstrap.sh
Executable file
36
client/flutter_ui/tool/bootstrap.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
project_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
tmp_dir="$(mktemp -d)"
|
||||
|
||||
cleanup() {
|
||||
rm -rf "$tmp_dir"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
command -v flutter >/dev/null 2>&1 || {
|
||||
echo "flutter is not installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
cp "$project_dir/pubspec.yaml" "$tmp_dir/pubspec.yaml"
|
||||
cp "$project_dir/analysis_options.yaml" "$tmp_dir/analysis_options.yaml"
|
||||
cp -R "$project_dir/lib" "$tmp_dir/lib"
|
||||
cp -R "$project_dir/test" "$tmp_dir/test"
|
||||
|
||||
flutter create \
|
||||
--platforms=windows,macos,linux \
|
||||
--project-name=netbird_flutter_ui \
|
||||
--org=io.netbird \
|
||||
"$project_dir"
|
||||
|
||||
cp "$tmp_dir/pubspec.yaml" "$project_dir/pubspec.yaml"
|
||||
cp "$tmp_dir/analysis_options.yaml" "$project_dir/analysis_options.yaml"
|
||||
rm -rf "$project_dir/lib"
|
||||
cp -R "$tmp_dir/lib" "$project_dir/lib"
|
||||
rm -rf "$project_dir/test"
|
||||
cp -R "$tmp_dir/test" "$project_dir/test"
|
||||
|
||||
cd "$project_dir"
|
||||
flutter pub get
|
||||
29
client/flutter_ui/tool/generate_proto.sh
Executable file
29
client/flutter_ui/tool/generate_proto.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
project_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
repo_dir="$(cd "$project_dir/../.." && pwd)"
|
||||
|
||||
command -v protoc >/dev/null 2>&1 || {
|
||||
echo "protoc is not installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
command -v dart >/dev/null 2>&1 || {
|
||||
echo "dart is not installed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
export PATH="$PATH:$HOME/.pub-cache/bin"
|
||||
|
||||
if ! command -v protoc-gen-dart >/dev/null 2>&1; then
|
||||
dart pub global activate protoc_plugin
|
||||
fi
|
||||
|
||||
mkdir -p "$project_dir/lib/src/generated"
|
||||
|
||||
protoc \
|
||||
-I "$repo_dir/client/proto" \
|
||||
--dart_out=grpc:"$project_dir/lib/src/generated" \
|
||||
"$repo_dir/client/proto/daemon.proto"
|
||||
|
||||
Reference in New Issue
Block a user