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.
5 # This file is meant to be included into a target to provide a rule to build
6 # a JAR file for use on a host in a consistent manner.
8 # To use this, create a gyp target with the following form:
10 # 'target_name': 'my_jar',
14 # 'path/to/directory',
15 # 'path/to/other/directory',
16 # 'path/to/individual_file.java',
20 # 'includes': [ 'path/to/this/gypi/file' ],
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
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
33 # main_class - The class containing the main() function that should be called
34 # when running the jar file.
35 # jar_excluded_classes - A list of .class files that should be excluded
40 '<(DEPTH)/build/android/setup.gyp:build_output_dirs',
43 'classes_dir': '<(intermediate_dir)/classes',
44 'excluded_src_paths': [],
45 'generated_src_dirs': [],
46 'input_jars_paths': [],
47 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)',
48 'jar_dir': '<(PRODUCT_DIR)/lib.java',
49 'jar_excluded_classes': [],
50 'jar_name': '<(_target_name).jar',
51 'jar_path': '<(jar_dir)/<(jar_name)',
53 'stamp': '<(intermediate_dir)/jar.stamp',
55 'all_dependent_settings': {
57 'input_jars_paths': ['<(jar_path)']
62 'action_name': 'javac_<(_target_name)',
63 'message': 'Compiling <(_target_name) java sources',
66 'java_sources': [ '<!@(find <@(src_paths) -name "*.java")' ],
68 ['"<(excluded_src_paths)" != ""', {
69 'java_sources!': ['<!@(find <@(excluded_src_paths) -name "*.java")']
71 ['"<(jar_excluded_classes)" != ""', {
72 'extra_options': ['--excluded-classes=<(jar_excluded_classes)']
74 ['">(main_class)" != ""', {
75 'extra_options': ['--main-class=>(main_class)']
80 '<(DEPTH)/build/android/gyp/util/build_utils.py',
81 '<(DEPTH)/build/android/gyp/javac.py',
83 '>@(input_jars_paths)',
90 'python', '<(DEPTH)/build/android/gyp/javac.py',
91 '--classpath=>(input_jars_paths)',
92 '--src-gendirs=>(generated_src_dirs)',
93 '--chromium-code=<(chromium_code)',
95 '--jar-path=<(jar_path)',