1#!/usr/bin/env python 2# Copyright 2013 The Flutter Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6import argparse 7import os 8import subprocess 9import sys 10 11ANDROID_SRC_ROOT = 'flutter/shell/platform/android' 12 13 14def main(): 15 if not os.path.exists(ANDROID_SRC_ROOT): 16 print 'This script must be run at the root of the Flutter source tree' 17 return 1 18 19 parser = argparse.ArgumentParser(description='Runs javadoc on Flutter Android libraries') 20 parser.add_argument('--out-dir', type=str, required=True) 21 args = parser.parse_args() 22 23 if not os.path.exists(args.out_dir): 24 os.makedirs(args.out_dir) 25 26 classpath = [ 27 ANDROID_SRC_ROOT, 28 'third_party/android_support/android_arch_lifecycle_common.jar', 29 'third_party/android_support/android_arch_lifecycle_viewmodel.jar', 30 'third_party/android_support/android_support_annotations.jar', 31 'third_party/android_support/android_support_compat.jar', 32 'third_party/android_support/android_support_fragment.jar', 33 'third_party/android_support/android_support_v13.jar', 34 'third_party/android_tools/sdk/platforms/android-29/android.jar', 35 'base/android/java/src', 36 'third_party/jsr-305/src/ri/src/main/java', 37 ] 38 packages = [ 39 'io.flutter.app', 40 'io.flutter.embedding.android', 41 'io.flutter.embedding.engine', 42 'io.flutter.embedding.engine.dart', 43 'io.flutter.embedding.engine.renderer', 44 'io.flutter.embedding.engine.systemchannels', 45 'io.flutter.plugin.common', 46 'io.flutter.plugin.editing', 47 'io.flutter.plugin.platform', 48 'io.flutter.util', 49 'io.flutter.view', 50 ] 51 52 command = [ 53 'javadoc', 54 '-classpath', ':'.join(classpath), 55 '-d', args.out_dir, 56 '-link', 'https://developer.android.com/reference/', 57 ] + packages 58 print(' '.join(command)) 59 60 return subprocess.call(command) 61 62 63if __name__ == '__main__': 64 sys.exit(main()) 65