Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 # This file is meant to be included into a target to provide a rule to build | |
| 6 # a non-executable .jar for use on a host in a consistent manner. | |
| 7 # | |
| 8 # To use this, create a gyp target with the following form: | |
| 9 # { | |
| 10 # 'target_name': 'my_jar', | |
| 11 # 'type': 'none', | |
| 12 # 'variables': { | |
| 13 # 'src_paths': [ | |
| 14 # 'path/to/directory', | |
| 15 # 'path/to/other/directory', | |
| 16 # 'path/to/individual_file.java', | |
| 17 # ... | |
| 18 # ], | |
| 19 # }, | |
| 20 # 'includes': [ 'path/to/this/gypi/file' ], | |
| 21 # } | |
| 22 # | |
| 23 # Required variables: | |
| 24 # src_paths - A list of all paths containing java files that should be | |
| 25 # included in the jar. Paths can be either directories or files. | |
| 26 # Optional/automatic variables: | |
| 27 # excluded_src_paths - A list of all paths that should be excluded from | |
| 28 # the jar. | |
| 29 # generated_src_dirs - Directories containing additional .java files | |
| 30 # generated at build time. | |
| 31 # input_jars_paths - A list of paths to the jars that should be included | |
| 32 # in the classpath. | |
| 33 # jar_excluded_classes - A list of .class files that should be excluded | |
| 34 # from the jar. | |
| 35 | |
| 36 { | |
| 37 'dependencies': [ | |
| 38 '<(DEPTH)/build/android/setup.gyp:build_output_dirs', | |
| 39 ], | |
| 40 'variables': { | |
| 41 'classes_dir': '<(intermediate_dir)/classes', | |
|
cjhopman
2014/09/15 22:27:37
I'd prefer this to just generate the .jar from jav
jbudorick
2014/09/16 02:50:41
Done.
| |
| 42 'compile_stamp': '<(intermediate_dir)/compile.stamp', | |
| 43 'excluded_src_paths%': [], | |
| 44 'generated_src_dirs%': [], | |
| 45 'input_jars_paths%': [], | |
| 46 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)', | |
| 47 'jar_dir': '<(PRODUCT_DIR)/lib.java', | |
| 48 'jar_excluded_classes%': [], | |
| 49 'jar_name': '<(_target_name).jar', | |
| 50 'jar_path': '<(jar_dir)/<(jar_name)', | |
| 51 'jar_stamp': '<(intermediate_dir)/jar.stamp', | |
| 52 }, | |
| 53 'all_dependent_settings': { | |
| 54 'variables': { | |
| 55 'input_jars_paths': ['<(jar_path)'] | |
| 56 }, | |
| 57 }, | |
| 58 'actions': [ | |
| 59 { | |
| 60 'action_name': 'javac_<(_target_name)', | |
| 61 'message': 'Compiling <(_target_name) java sources', | |
| 62 'variables': { | |
| 63 'java_sources': [ '<!@(find <@(src_paths) -name "*.java")' ], | |
| 64 'conditions': [ | |
| 65 ['"<(excluded_src_paths)" != ""', { | |
| 66 'java_sources!': ['<!@(find <@(excluded_src_paths) -name "*.java")'] | |
| 67 }], | |
| 68 ], | |
| 69 }, | |
| 70 'inputs': [ | |
| 71 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
| 72 '<(DEPTH)/build/android/gyp/javac.py', | |
| 73 '^@(java_sources)', | |
| 74 '>@(input_jars_paths)', | |
| 75 ], | |
| 76 'outputs': [ | |
| 77 '<(classes_dir)', | |
| 78 '<(compile_stamp)', | |
| 79 ], | |
| 80 'action': [ | |
| 81 'python', '<(DEPTH)/build/android/gyp/javac.py', | |
| 82 '--classes-dir=<(classes_dir)', | |
| 83 '--classpath=>(input_jars_paths)', | |
| 84 '--src-gendirs=>(generated_src_dirs)', | |
| 85 '--chromium-code=<(chromium_code)', | |
| 86 '--stamp=<(compile_stamp)', | |
| 87 '^@(java_sources)', | |
| 88 ] | |
| 89 }, | |
| 90 { | |
| 91 'action_name': 'jar_<(_target_name)', | |
| 92 'message': 'Creating <(_target_name) jar', | |
| 93 'variables': { | |
| 94 'extra_options': [], | |
| 95 'conditions': [ | |
| 96 ['"<(jar_excluded_classes)" != ""', { | |
| 97 'extra_options': ['--excluded-classes=<(jar_excluded_classes)'] | |
| 98 }], | |
| 99 ], | |
| 100 }, | |
| 101 'inputs': [ | |
| 102 '<(DEPTH)/build/android/gyp/util/build_utils.py', | |
| 103 '<(DEPTH)/build/android/gyp/util/md5_check.py', | |
| 104 '<(DEPTH)/build/android/gyp/jar.py', | |
| 105 '<(compile_stamp)', | |
| 106 '<(classes_dir)', | |
| 107 ], | |
| 108 'outputs': [ | |
| 109 '<(jar_path)', | |
| 110 '<(jar_stamp)' | |
| 111 ], | |
| 112 'action': [ | |
| 113 'python', '<(DEPTH)/build/android/gyp/jar.py', | |
| 114 '--classes-dir=<(classes_dir)', | |
| 115 '--jar-path=<(jar_path)', | |
| 116 '--stamp=<(jar_stamp)', | |
| 117 '<@(extra_options)' | |
| 118 ], | |
| 119 }, | |
| 120 ] | |
| 121 } | |
| 122 | |
| OLD | NEW |