aboutsummaryrefslogtreecommitdiff
path: root/src/main/native/com/code_intelligence/jazzer/android/BUILD.bazel
blob: 74f98cda0d011e56bf9831a57582ba2735491da2 (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
load("//bazel:compat.bzl", "SKIP_ON_WINDOWS")
load("@fmeum_rules_jni//jni:defs.bzl", "cc_jni_library")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")

copy_file(
    name = "jvmti_h_encoded",
    src = "@android_jvmti//file",
    out = "jvmti.encoded",
    is_executable = False,
    tags = ["manual"],
    target_compatible_with = SKIP_ON_WINDOWS,
)

genrule(
    name = "jvmti_h",
    srcs = [
        "jvmti.encoded",
    ],
    outs = ["jvmti.h"],
    cmd = "base64 --decode $< > $(OUTS)",
    tags = ["manual"],
    target_compatible_with = SKIP_ON_WINDOWS,
)

cc_jni_library(
    name = "android_native_agent",
    srcs = [
        "dex_file_manager.cpp",
        "dex_file_manager.h",
        "jazzer_jvmti_allocator.h",
        "native_agent.cpp",
        ":jvmti_h",
    ],
    includes = [
        ".",
    ],
    linkopts = [
        "-lz",
    ],
    tags = ["manual"],
    target_compatible_with = SKIP_ON_WINDOWS,
    visibility = ["//visibility:public"],
    deps = [
        "@com_google_absl//absl/strings",
        "@jazzer_slicer",
    ],
)