Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,15 @@ deps = {
'src/third_party/pkg/archive':
Var('github_git') + '/brendan-duncan/archive.git' + '@' + '3.1.2',

'src/third_party/pkg/file':
Var('github_git') + '/google/file.dart.git' + '@' + '427bb20ccc852425d67f2880da2a9b4707c266b4', # 6.1.0

'src/third_party/pkg/platform':
Var('github_git') + '/google/platform.dart.git' + '@' + 'f63fd0bc3021354a0687dc935962c9acc003f47e', # 3.0.1

'src/third_party/pkg/process':
Var('github_git') + '/google/process.dart.git' + '@' + '0c9aeac86dcc4e3a6cf760b76fed507107e244d5', # 4.2.1

'src/third_party/pkg/when':
Var('dart_git') + '/when.git' + '@' + '0.2.0',

Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/tool_signature
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Signature: dd0af3be798528c3303ec68043c4785c
Signature: 7af516b6fef310e37406f37cc6da30ae

5 changes: 2 additions & 3 deletions tools/android_lint/bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

import 'sound_main.dart' as m;

// TODO(#72542):
// Migrate the deps in pubspec.yaml to null-safety versions.
// TODO(dnfield): Migrate the deps in pubspec.yaml to null-safety versions.
// In particular see the ongoing work on package:args here:
// https://github.com/dart-lang/args/issues/153
// https://github.com/flutter/flutter/issues/72542
Future<void> main(List<String> args) => m.main(args);
26 changes: 15 additions & 11 deletions tools/android_lint/bin/sound_main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ Future<void> main(List<String> args) async {
}

Future<int> runLint(ArgParser argParser, ArgResults argResults) async {
final String inArgument = argResults['in'] as String;
final Directory androidDir = Directory(path.join(
argResults['in'],
inArgument,
'flutter',
'shell',
'platform',
Expand All @@ -48,7 +49,7 @@ Future<int> runLint(ArgParser argParser, ArgResults argResults) async {
}

final Directory androidSdkDir = Directory(
path.join(argResults['in'], 'third_party', 'android_tools', 'sdk'),
path.join(inArgument, 'third_party', 'android_tools', 'sdk'),
);

if (!androidSdkDir.existsSync()) {
Expand All @@ -58,7 +59,8 @@ Future<int> runLint(ArgParser argParser, ArgResults argResults) async {
return -1;
}

if (argResults['rebaseline']) {
final bool rebaseline = argResults['rebaseline'] as bool;
if (rebaseline) {
print('Removing previous baseline.xml...');
final File baselineXml = File(baselineXmlPath);
if (baselineXml.existsSync()) {
Expand All @@ -67,8 +69,8 @@ Future<int> runLint(ArgParser argParser, ArgResults argResults) async {
}
print('Preparing project.xml...');
final IOSink projectXml = File(projectXmlPath).openWrite();
projectXml.write(
'''<!-- THIS FILE IS GENERATED. PLEASE USE THE INCLUDED DART PROGRAM WHICH -->
projectXml.write('''
<!-- THIS FILE IS GENERATED. PLEASE USE THE INCLUDED DART PROGRAM WHICH -->
<!-- WILL AUTOMATICALLY FIND ALL .java FILES AND INCLUDE THEM HERE -->
<project>
<sdk dir="${androidSdkDir.path}" />
Expand All @@ -82,7 +84,8 @@ Future<int> runLint(ArgParser argParser, ArgResults argResults) async {
projectXml.writeln(' <src file="${entity.path}" />');
}

projectXml.write(''' </module>
projectXml.write('''
</module>
</project>
''');
await projectXml.close();
Expand All @@ -99,8 +102,9 @@ Future<int> runLint(ArgParser argParser, ArgResults argResults) async {
'--baseline',
baselineXmlPath,
];
if (argResults['html']) {
lintArgs.addAll(<String>['--html', argResults['out']]);
final bool html = argResults['html'] as bool;
if (html) {
lintArgs.addAll(<String>['--html', argResults['out'] as String]);
}
final String? javaHome = await getJavaHome();
final Process lintProcess = await processManager.start(
Expand All @@ -113,7 +117,7 @@ Future<int> runLint(ArgParser argParser, ArgResults argResults) async {
);
lintProcess.stdout.pipe(stdout);
lintProcess.stderr.pipe(stderr);
return await lintProcess.exitCode;
return lintProcess.exitCode;
}

/// Prepares an [ArgParser] for this script.
Expand Down Expand Up @@ -171,7 +175,7 @@ Future<String?> getJavaHome() async {
<String>['/usr/libexec/java_home', '-v', '1.8', '-F'],
);
if (result.exitCode == 0) {
return result.stdout.trim();
return (result.stdout as String).trim();
}
}
return Platform.environment['JAVA_HOME'];
Expand Down Expand Up @@ -201,7 +205,7 @@ Future<void> checkJava1_8() async {
print(javaResult.stderr);
}
// `java -version` writes to stderr.
final String javaVersionStdout = javaResult.stderr;
final String javaVersionStdout = javaResult.stderr as String;
if (!javaVersionStdout.contains('"1.8')) {
print('The Android SDK tools may not work properly with your Java version. '
'If this process fails, please retry using Java 1.8.');
Expand Down
33 changes: 30 additions & 3 deletions tools/android_lint/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
# Copyright 2013 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.

name: android_lint
environment:
sdk: '>=2.12.0-0.0.dev <3.0.0'

# Do not add any dependencies that require more than what is provided in
# //third_party.pkg, //third_party/dart/pkg, or
# //third_party/dart/third_party/pkg. In particular, package:test is not usable
# here.

# If you do add packages here, make sure you can run `pub get --offline`, and
# check the .packages and .package_config to make sure all the paths are
# relative to this directory into //third_party/dart

dependencies:
args: 1.5.0
path: ^1.6.2
process: ^3.0.9
args: any
path: any
process: any

dependency_overrides:
args:
path: ../../../third_party/dart/third_party/pkg/args
file:
path: ../../../third_party/pkg/file/packages/file
meta:
path: ../../../third_party/dart/pkg/meta
path:
path: ../../../third_party/dart/third_party/pkg/path
platform:
path: ../../../third_party/pkg/platform
process:
path: ../../../third_party/pkg/process
5 changes: 4 additions & 1 deletion tools/licenses/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,10 @@ class _RepositoryPkgDirectory extends _RepositoryDirectory {

@override
bool shouldRecurse(fs.IoNode entry) {
return entry.name != 'archive'; // contains nothing that ends up in the binary executable
return entry.name != 'archive' // contains nothing that ends up in the binary executable
&& entry.name != 'file'
&& entry.name != 'platform'
&& entry.name != 'process';
Comment on lines +1667 to +1670
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is safe - it seems like we might want to use entry.fullName.endsWith or something to avoid skipping over some random subdirectory of another thing we care about that happens to have a directory named file or platform or process.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, this class is only used for the Dart third party packages. Ok.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. This only covers exactly third_party/pkg/process etc.

}

@override
Expand Down
1 change: 1 addition & 0 deletions tools/pub_get_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

ALL_PACKAGES = [
os.path.join("src", "flutter", "flutter_frontend_server"),
os.path.join("src", "flutter", "tools", "android_lint"),
os.path.join("src", "flutter", "tools", "const_finder"),
os.path.join("src", "flutter", "tools", "licenses"),
]
Expand Down