summaryrefslogtreecommitdiff
path: root/tools/zipalign/Android.bp
blob: 8cab04cd13f796124750f9012aa793cf6d72126d (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
//
// Copyright 2008 The Android Open Source Project
//
// Zip alignment tool
//

package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

cc_defaults {
    name: "zipalign_defaults",
    target: {
        windows: {
            host_ldlibs: ["-lpthread"],
            enabled: true,
        },
    },
}

cc_library_host_static {
    name: "libzipalign",
    srcs: [
        "ZipAlign.cpp",
        "ZipEntry.cpp",
        "ZipFile.cpp",
    ],
    export_include_dirs: [
        "include",
    ],
    cflags: ["-Wall", "-Werror"],

    // NOTE: Do not add any shared_libs dependencies because they will break the
    // static_sdk_tools target.
    whole_static_libs: [
        "libutils",
        "libcutils",
        "liblog",
        "libziparchive",
        "libz",
        "libbase",
        "libzopfli",
    ],
    defaults: ["zipalign_defaults"],
}

cc_binary_host {
    name: "zipalign",
    srcs: [
        "ZipAlignMain.cpp",
    ],
    cflags: ["-Wall", "-Werror"],
    static_libs: [
        "libzipalign",
    ],
    defaults: ["zipalign_defaults"],
}

cc_test_host {
    name: "zipalign_tests",
    srcs: [
        "tests/src/*_test.cpp",
    ],
    test_options: {
        unit_test: true,
    },
    static_libs: [
        "libbase",
        "libzipalign",
        "libgmock",
    ],
    data: [
         "tests/data/diffOrders.zip",
         "tests/data/holes.zip",
         "tests/data/unaligned.zip",
    ],
    defaults: ["zipalign_defaults"],
    test_suites: ["general-tests"],
}