1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-11 23:39:14 +00:00

Flutter 3.29 beta (#2571)

This commit is contained in:
Eric Windmill
2025-02-12 18:08:01 -05:00
committed by GitHub
parent d62c784789
commit 719fd72c38
685 changed files with 76244 additions and 53721 deletions

View File

@@ -11,14 +11,14 @@ const ignoredDirectories = [
'_tool',
'_packages/web_startup_analyzer',
'_packages/web_startup_analyzer/example',
'samples_index'
'samples_index',
];
void main() async {
final packageDirs = [
...listPackageDirs(Directory.current)
.map((path) => p.relative(path, from: Directory.current.path))
.where((path) => !ignoredDirectories.contains(path))
.where((path) => !ignoredDirectories.contains(path)),
];
print('Building the sample index...');
@@ -26,8 +26,9 @@ void main() async {
await _run('samples_index', 'flutter', ['pub', 'run', 'grinder', 'deploy']);
// Create the directory each Flutter Web sample lives in
Directory(p.join(Directory.current.path, 'samples_index', 'public', 'web'))
.createSync(recursive: true);
Directory(
p.join(Directory.current.path, 'samples_index', 'public', 'web'),
).createSync(recursive: true);
for (var i = 0; i < packageDirs.length; i++) {
var directory = packageDirs[i];
@@ -36,10 +37,19 @@ void main() async {
// Create the target directory
var directoryName = p.basename(directory);
var sourceBuildDir =
p.join(Directory.current.path, directory, 'build', 'web');
var targetDirectory = p.join(Directory.current.path, 'samples_index',
'public', 'web', directoryName);
var sourceBuildDir = p.join(
Directory.current.path,
directory,
'build',
'web',
);
var targetDirectory = p.join(
Directory.current.path,
'samples_index',
'public',
'web',
directoryName,
);
// Build the sample and copy the files
await _run(directory, 'flutter', ['pub', 'get']);
@@ -53,7 +63,10 @@ void main() async {
// Invokes run() and exits if the sub-process failed.
Future<void> _run(
String workingDir, String commandName, List<String> args) async {
String workingDir,
String commandName,
List<String> args,
) async {
var success = await run(workingDir, commandName, args);
if (!success) {
exit(1);