snapshot of https://github.com/flutter/samples.git (main, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Main Branch CI / Test Flutter beta on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter stable on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter beta on macos-latest (push) Has been cancelled
Main Branch CI / Test Flutter stable on macos-latest (push) Has been cancelled
Some checks failed
Main Branch CI / Test Flutter beta on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter stable on ubuntu-latest (push) Has been skipped
Main Branch CI / Test Flutter beta on macos-latest (push) Has been cancelled
Main Branch CI / Test Flutter stable on macos-latest (push) Has been cancelled
This commit is contained in:
55
desktop_photo_search/material/tool/grind.dart
Normal file
55
desktop_photo_search/material/tool/grind.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
// Copyright 2019 The Flutter team. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:async/async.dart' show StreamGroup;
|
||||
import 'package:grinder/grinder.dart';
|
||||
|
||||
void main(List<String> args) => grind(args);
|
||||
|
||||
@DefaultTask()
|
||||
@Depends(pubGet, generateJsonBindings, analyzeSource, test)
|
||||
void build() {}
|
||||
|
||||
@Task()
|
||||
Future<void> pubGet() async =>
|
||||
_logProcessOutput(Process.start('flutter', ['pub', 'get']));
|
||||
|
||||
@Task()
|
||||
Future<void> generateJsonBindings() async => _logProcessOutput(
|
||||
Process.start('flutter', [
|
||||
'pub',
|
||||
'run',
|
||||
'build_runner',
|
||||
'build',
|
||||
'--delete-conflicting-outputs',
|
||||
]),
|
||||
);
|
||||
|
||||
@Task()
|
||||
Future<void> watch() async => _logProcessOutput(
|
||||
Process.start('dart', ['run', 'build_runner', 'watch']),
|
||||
);
|
||||
|
||||
@Task()
|
||||
Future<void> analyzeSource() async =>
|
||||
_logProcessOutput(Process.start('flutter', ['analyze']));
|
||||
|
||||
@Task()
|
||||
Future<void> test() async =>
|
||||
_logProcessOutput(Process.start('flutter', ['test']));
|
||||
|
||||
@Task()
|
||||
Future<void> clean() => _logProcessOutput(Process.start('flutter', ['clean']));
|
||||
|
||||
Future<void> _logProcessOutput(Future<Process> proc) async {
|
||||
final process = await proc;
|
||||
final output = StreamGroup.merge([process.stdout, process.stderr]);
|
||||
await for (final message in output) {
|
||||
log(utf8.decode(message));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user