12ANDROID_SRC_ROOT =
'flutter/shell/platform/android'
14SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
18 if sys.platform ==
'darwin':
20 SCRIPT_DIR,
'..',
'..',
'..',
'third_party',
'java',
'openjdk',
'Contents',
'Home',
'bin',
23 elif sys.platform.startswith((
'cygwin',
'win')):
25 SCRIPT_DIR,
'..',
'..',
'..',
'third_party',
'java',
'openjdk',
'bin',
'javadoc.exe'
29 SCRIPT_DIR,
'..',
'..',
'..',
'third_party',
'java',
'openjdk',
'bin',
'javadoc'
34 parser = argparse.ArgumentParser(description=
'Runs javadoc on Flutter Android libraries')
35 parser.add_argument(
'--out-dir', type=str, required=
True)
36 parser.add_argument(
'--android-source-root', type=str, default=ANDROID_SRC_ROOT)
37 parser.add_argument(
'--build-config-path', type=str)
38 parser.add_argument(
'--src-dir', type=str, default=
'.')
39 parser.add_argument(
'--quiet', default=
False, action=
'store_true')
40 args = parser.parse_args()
42 if not os.path.exists(args.android_source_root):
44 'This script must be run at the root of the Flutter source tree, or '
45 'the --android-source-root must be set.'
49 if not os.path.exists(args.out_dir):
50 os.makedirs(args.out_dir)
52 android_jar_path = os.path.join(
53 args.src_dir,
'flutter',
'third_party',
'android_tools',
'sdk',
'platforms',
'android-34',
56 if not os.path.exists(android_jar_path):
57 print(
'Android SDK not found at %s' % android_jar_path)
61 args.android_source_root,
63 os.path.join(args.src_dir,
'third_party',
'android_embedding_dependencies',
'lib',
'*'),
65 if args.build_config_path:
66 classpath.append(args.build_config_path)
70 'io.flutter.embedding.android',
71 'io.flutter.embedding.engine',
72 'io.flutter.embedding.engine.dart',
73 'io.flutter.embedding.engine.loader',
74 'io.flutter.embedding.engine.mutatorsstack',
75 'io.flutter.embedding.engine.plugins',
76 'io.flutter.embedding.engine.plugins.activity',
77 'io.flutter.embedding.engine.plugins.broadcastreceiver',
78 'io.flutter.embedding.engine.plugins.contentprovider',
79 'io.flutter.embedding.engine.plugins.lifecycle',
80 'io.flutter.embedding.engine.plugins.service',
81 'io.flutter.embedding.engine.plugins.shim',
82 'io.flutter.embedding.engine.renderer',
83 'io.flutter.embedding.engine.systemchannels',
84 'io.flutter.plugin.common',
85 'io.flutter.plugin.editing',
86 'io.flutter.plugin.platform',
91 android_package_list = os.path.join(SCRIPT_DIR,
'android_reference')
100 'https://developer.android.com/reference/',
101 android_package_list,
110 output = subprocess.check_output(command, stderr=subprocess.STDOUT)
113 except subprocess.CalledProcessError
as e:
114 print(e.output.decode(
'utf-8'))
120if __name__ ==
'__main__':
def print(*args, **kwargs)
static SkString join(const CommandLineFlags::StringArray &)