aboutsummaryrefslogtreecommitdiff
path: root/docs/native_binary_doc.md
blob: 9cf90f4112867e0f8b76fc1a00c3c6c8d8388d9a (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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
## native_binary

<pre>
native_binary(<a href="#native_binary-name">name</a>, <a href="#native_binary-src">src</a>, <a href="#native_binary-out">out</a>, <a href="#native_binary-data">data</a>, <a href="#native_binary-kwargs">kwargs</a>)
</pre>

Wraps a pre-built binary or script with a binary rule.

You can "bazel run" this rule like any other binary rule, and use it as a tool in genrule.tools for example. You can also augment the binary with runfiles.


### Parameters

<table class="params-table">
  <colgroup>
    <col class="col-param" />
    <col class="col-description" />
  </colgroup>
  <tbody>
    <tr id="native_binary-name">
      <td><code>name</code></td>
      <td>
        required.
      </td>
    </tr>
    <tr id="native_binary-src">
      <td><code>src</code></td>
      <td>
        required.
        <p>
          label; path of the pre-built executable
        </p>
      </td>
    </tr>
    <tr id="native_binary-out">
      <td><code>out</code></td>
      <td>
        required.
        <p>
          output; an output name for the copy of the binary. (Bazel requires that this rule make a copy of 'src'.)
        </p>
      </td>
    </tr>
    <tr id="native_binary-data">
      <td><code>data</code></td>
      <td>
        optional. default is <code>None</code>
        <p>
          list of labels; data dependencies
        </p>
      </td>
    </tr>
    <tr id="native_binary-kwargs">
      <td><code>kwargs</code></td>
      <td>
        optional.
        <p>
          The <a href="https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes-binaries">common attributes for binaries</a>.
        </p>
      </td>
    </tr>
  </tbody>
</table>


## native_test

<pre>
native_test(<a href="#native_test-name">name</a>, <a href="#native_test-src">src</a>, <a href="#native_test-out">out</a>, <a href="#native_test-data">data</a>, <a href="#native_test-kwargs">kwargs</a>)
</pre>

Wraps a pre-built binary or script with a test rule.

You can "bazel test" this rule like any other test rule. You can also augment the binary with
runfiles.


### Parameters

<table class="params-table">
  <colgroup>
    <col class="col-param" />
    <col class="col-description" />
  </colgroup>
  <tbody>
    <tr id="native_test-name">
      <td><code>name</code></td>
      <td>
        required.
      </td>
    </tr>
    <tr id="native_test-src">
      <td><code>src</code></td>
      <td>
        required.
        <p>
          label; path of the pre-built executable
        </p>
      </td>
    </tr>
    <tr id="native_test-out">
      <td><code>out</code></td>
      <td>
        required.
        <p>
          output; an output name for the copy of the binary. (Bazel requires that this rule make a copy of 'src'.)
        </p>
      </td>
    </tr>
    <tr id="native_test-data">
      <td><code>data</code></td>
      <td>
        optional. default is <code>None</code>
        <p>
          list of labels; data dependencies
        </p>
      </td>
    </tr>
    <tr id="native_test-kwargs">
      <td><code>kwargs</code></td>
      <td>
        optional.
        <p>
          The <a href="https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes-tests">common attributes for tests</a>.
        </p>
      </td>
    </tr>
  </tbody>
</table>