summaryrefslogtreecommitdiffstats
path: root/build/android/setup.gyp
blob: 0ef0531556183f6723ac208b4b049a25e45189f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
  'conditions': [
    ['android_must_copy_system_libraries == 1', {
      'targets': [
        {
          # These libraries from the Android ndk are required to be packaged with
          # any APK that is built with them. build/java_apk.gypi expects any
          # libraries that should be packaged with the apk to be in
          # <(SHARED_LIB_DIR)
          'target_name': 'copy_system_libraries',
          'type': 'none',
          'copies': [
            {
              'destination': '<(SHARED_LIB_DIR)/',
              'files': [
                '<(android_libcpp_libs_dir)/libc++_shared.so',
              ],
            },
          ],
        },
      ],
    }],
  ],
  'targets': [
    {
      'target_name': 'get_build_device_configurations',
      'type': 'none',
      'actions': [
        {
          'action_name': 'get configurations',
          'inputs': [
            'gyp/util/build_device.py',
            'gyp/get_device_configuration.py',
          ],
          'outputs': [
            '<(build_device_config_path)',
            '<(build_device_config_path).fake',
          ],
          'action': [
            'python', 'gyp/get_device_configuration.py',
            '--output=<(build_device_config_path)',
            '--output-directory=<(PRODUCT_DIR)',
          ],
        }
      ],
    },
    {
      # Target for creating common output build directories. Creating output
      # dirs beforehand ensures that build scripts can assume these folders to
      # exist and there are no race conditions resulting from build scripts
      # trying to create these directories.
      # The build/java.gypi target depends on this target.
      'target_name': 'build_output_dirs',
      'type': 'none',
      'actions': [
        {
          'action_name': 'create_java_output_dirs',
          'variables' : {
            'output_dirs' : [
              '<(PRODUCT_DIR)/apks',
              '<(PRODUCT_DIR)/lib.java',
              '<(PRODUCT_DIR)/test.lib.java',
            ]
          },
          'inputs' : [],
          # By not specifying any outputs, we ensure that this command isn't
          # re-run when the output directories are touched (i.e. apks are
          # written to them).
          'outputs': [''],
          'action': [
            'mkdir',
            '-p',
            '<@(output_dirs)',
          ],
        },
      ],
    }, # build_output_dirs
    {
      'target_name': 'sun_tools_java',
      'type': 'none',
      'variables': {
        'found_jar_path': '<(PRODUCT_DIR)/sun_tools_java/tools.jar',
        'jar_path': '<(found_jar_path)',
      },
      'includes': [
        '../../build/host_prebuilt_jar.gypi',
      ],
      'actions': [
        {
          'action_name': 'find_sun_tools_jar',
          'variables' : {
          },
          'inputs' : [
            'gyp/find_sun_tools_jar.py',
            'gyp/util/build_utils.py',
          ],
          'outputs': [
            '<(found_jar_path)',
          ],
          'action': [
            'python', 'gyp/find_sun_tools_jar.py',
            '--output', '<(found_jar_path)',
          ],
        },
      ],
    }, # sun_tools_java
  ]
}