1//
2// Copyright (C) 2018 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "art_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["art_license"],
24}
25
26python_binary_host {
27    name: "generate_operator_out",
28    srcs: [
29        "generate_operator_out.py",
30    ],
31    version: {
32        py2: {
33            enabled: true,
34        },
35        py3: {
36            enabled: false,
37        },
38    },
39}
40
41soong_config_module_type_import {
42    from: "art/build/SoongConfig.bp",
43    module_types: [
44        "art_module_sh_binary",
45    ],
46}
47
48// Copy the art shell script to the host and target's bin directory
49art_module_sh_binary {
50    name: "art-script",
51
52    // Disable this script in prebuilt mode since it depends on dalvikvm which
53    // isn't a prebuilt.
54    // TODO(b/172480617): Clean up when sources are gone from the platform tree
55    // and we no longer need to support sources present when prebuilts are used.
56    enabled: false,
57    soong_config_variables: {
58        source_build: {
59            enabled: true,
60        },
61    },
62
63    host_supported: true,
64    src: "art",
65    filename_from_src: true,
66    target: {
67        host: {
68            // On device we require the ART APEX, but its Soong module name may
69            // be different depending on branch, and it's always present anyway,
70            // so we leave it out.
71            required: [
72                "dalvikvm",
73                "dex2oat",
74            ],
75        },
76        darwin: {
77            enabled: false,
78        },
79        windows: {
80            // When the module is enabled globally in the soong_config_variables
81            // stanza above, it gets enabled on windows too. Hence we need to
82            // disable it explicitly.
83            // TODO(b/172480617): Clean up with that.
84            enabled: false,
85        },
86    },
87}
88
89sh_binary {
90    name: "dex2oat-script",
91    host_supported: true,
92    src: "dex2oat_wrapper",
93    filename_from_src: true,
94    target: {
95        host: {
96            // On device we require the ART APEX, but its Soong module name may
97            // be different depending on branch, and it's always present anyway,
98            // so we leave it out.
99            required: [
100                "dex2oat",
101            ],
102        },
103        darwin: {
104            enabled: false,
105        },
106    },
107}
108
109python_binary_host {
110    name: "art-run-test-checker",
111    srcs: [
112        "checker/**/*.py",
113    ],
114    main: "checker/checker.py",
115    version: {
116        py2: {
117            enabled: false,
118        },
119        py3: {
120            enabled: true,
121        },
122    },
123    test_suites: [
124        "general-tests",
125        "mts",
126    ],
127}
128