xref: /aosp_15_r20/external/minijail/tools/Android.bp (revision 4b9c6d91573e8b3a96609339b46361b5476dd0f9)
1*4b9c6d91SCole Faust// Copyright (C) 2019 The Android Open Source Project
2*4b9c6d91SCole Faust//
3*4b9c6d91SCole Faust// Licensed under the Apache License, Version 2.0 (the "License");
4*4b9c6d91SCole Faust// you may not use this file except in compliance with the License.
5*4b9c6d91SCole Faust// You may obtain a copy of the License at
6*4b9c6d91SCole Faust//
7*4b9c6d91SCole Faust//      http://www.apache.org/licenses/LICENSE-2.0
8*4b9c6d91SCole Faust//
9*4b9c6d91SCole Faust// Unless required by applicable law or agreed to in writing, software
10*4b9c6d91SCole Faust// distributed under the License is distributed on an "AS IS" BASIS,
11*4b9c6d91SCole Faust// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*4b9c6d91SCole Faust// See the License for the specific language governing permissions and
13*4b9c6d91SCole Faust// limitations under the License.
14*4b9c6d91SCole Faust
15*4b9c6d91SCole Faustpackage {
16*4b9c6d91SCole Faust    // See: http://go/android-license-faq
17*4b9c6d91SCole Faust    // A large-scale-change added 'default_applicable_licenses' to import
18*4b9c6d91SCole Faust    // all of the 'license_kinds' from "external_minijail_license"
19*4b9c6d91SCole Faust    // to get the below license kinds:
20*4b9c6d91SCole Faust    //   SPDX-license-identifier-Apache-2.0
21*4b9c6d91SCole Faust    default_applicable_licenses: ["external_minijail_license"],
22*4b9c6d91SCole Faust}
23*4b9c6d91SCole Faust
24*4b9c6d91SCole Faustpython_binary_host {
25*4b9c6d91SCole Faust    name: "minijail_compile_seccomp_policy",
26*4b9c6d91SCole Faust    main: "compile_seccomp_policy.py",
27*4b9c6d91SCole Faust    srcs: [
28*4b9c6d91SCole Faust        "arch.py",
29*4b9c6d91SCole Faust        "bpf.py",
30*4b9c6d91SCole Faust        "compile_seccomp_policy.py",
31*4b9c6d91SCole Faust        "compiler.py",
32*4b9c6d91SCole Faust        "parser.py",
33*4b9c6d91SCole Faust    ],
34*4b9c6d91SCole Faust}
35*4b9c6d91SCole Faust
36*4b9c6d91SCole Faustpython_test_host {
37*4b9c6d91SCole Faust    name: "minijail_parser_unittest",
38*4b9c6d91SCole Faust    main: "parser_unittest.py",
39*4b9c6d91SCole Faust    srcs: [
40*4b9c6d91SCole Faust        "arch.py",
41*4b9c6d91SCole Faust        "bpf.py",
42*4b9c6d91SCole Faust        "parser.py",
43*4b9c6d91SCole Faust        "parser_unittest.py",
44*4b9c6d91SCole Faust    ],
45*4b9c6d91SCole Faust    data: [
46*4b9c6d91SCole Faust        "testdata/arch_64.json",
47*4b9c6d91SCole Faust    ],
48*4b9c6d91SCole Faust    version: {
49*4b9c6d91SCole Faust        py3: {
50*4b9c6d91SCole Faust            embedded_launcher: true,
51*4b9c6d91SCole Faust        },
52*4b9c6d91SCole Faust    },
53*4b9c6d91SCole Faust}
54*4b9c6d91SCole Faust
55*4b9c6d91SCole Faustpython_test_host {
56*4b9c6d91SCole Faust    name: "minijail_compiler_unittest",
57*4b9c6d91SCole Faust    main: "compiler_unittest.py",
58*4b9c6d91SCole Faust    srcs: [
59*4b9c6d91SCole Faust        "arch.py",
60*4b9c6d91SCole Faust        "bpf.py",
61*4b9c6d91SCole Faust        "compiler.py",
62*4b9c6d91SCole Faust        "compiler_unittest.py",
63*4b9c6d91SCole Faust        "parser.py",
64*4b9c6d91SCole Faust    ],
65*4b9c6d91SCole Faust    data: [
66*4b9c6d91SCole Faust        "testdata/arch_64.json",
67*4b9c6d91SCole Faust    ],
68*4b9c6d91SCole Faust    version: {
69*4b9c6d91SCole Faust        py3: {
70*4b9c6d91SCole Faust            embedded_launcher: true,
71*4b9c6d91SCole Faust        },
72*4b9c6d91SCole Faust    },
73*4b9c6d91SCole Faust}
74*4b9c6d91SCole Faust
75*4b9c6d91SCole Faustpython_binary_host {
76*4b9c6d91SCole Faust    name: "minijail_generate_constants_json",
77*4b9c6d91SCole Faust    main: "generate_constants_json.py",
78*4b9c6d91SCole Faust    srcs: [
79*4b9c6d91SCole Faust        "generate_constants_json.py",
80*4b9c6d91SCole Faust    ],
81*4b9c6d91SCole Faust}
82*4b9c6d91SCole Faust
83*4b9c6d91SCole Faust
84*4b9c6d91SCole Faustcc_genrule {
85*4b9c6d91SCole Faust    name: "minijail_constants_json",
86*4b9c6d91SCole Faust    host_supported: true,
87*4b9c6d91SCole Faust    vendor_available: true,
88*4b9c6d91SCole Faust    recovery_available: true,
89*4b9c6d91SCole Faust    tools: ["minijail_generate_constants_json"],
90*4b9c6d91SCole Faust    cmd: "$(location minijail_generate_constants_json) --output=$(out) $(in)",
91*4b9c6d91SCole Faust    srcs: [
92*4b9c6d91SCole Faust        ":libminijail_gen_constants_llvmir",
93*4b9c6d91SCole Faust        ":libminijail_gen_syscall_llvmir",
94*4b9c6d91SCole Faust    ],
95*4b9c6d91SCole Faust    out: ["constants.json"],
96*4b9c6d91SCole Faust}
97