Ian Hickson 449f4a6673
License update (#45373)
* Update project.pbxproj files to say Flutter rather than Chromium

Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.

* Update the copyright notice checker to require a standard notice on all files

* Update copyrights on Dart files. (This was a mechanical commit.)

* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.

Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).

* Clean up the copyrights in non-Dart files. (Manual edits.)

Also, make sure templates don't have copyrights.

* Fix some more ORGANIZATIONNAMEs
2019-11-27 15:04:02 -08:00

54 lines
1.6 KiB
Dart

// Copyright 2014 The Flutter Authors. 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 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/process_manager.dart';
import '../src/common.dart';
/// Creates a temporary directory but resolves any symlinks to return the real
/// underlying path to avoid issues with breakpoints/hot reload.
/// https://github.com/flutter/flutter/pull/21741
Directory createResolvedTempDirectorySync(String prefix) {
assert(prefix.endsWith('.'));
final Directory tempDirectory = fs.systemTempDirectory.createTempSync('flutter_$prefix');
return fs.directory(tempDirectory.resolveSymbolicLinksSync());
}
void writeFile(String path, String content) {
fs.file(path)
..createSync(recursive: true)
..writeAsStringSync(content);
}
void writePackages(String folder) {
writeFile(fs.path.join(folder, '.packages'), '''
test:${fs.path.join(fs.currentDirectory.path, 'lib')}/
''');
}
void writePubspec(String folder) {
writeFile(fs.path.join(folder, 'pubspec.yaml'), '''
name: test
dependencies:
flutter:
sdk: flutter
''');
}
Future<void> getPackages(String folder) async {
final List<String> command = <String>[
fs.path.join(getFlutterRoot(), 'bin', 'flutter'),
'pub',
'get',
];
final ProcessResult result = await processManager.run(command, workingDirectory: folder);
if (result.exitCode != 0) {
throw Exception('flutter pub get failed: ${result.stderr}\n${result.stdout}');
}
}