diff options
| -rw-r--r-- | bitbake/doc/user-manual/user-manual-metadata.xml | 109 |
1 files changed, 76 insertions, 33 deletions
diff --git a/bitbake/doc/user-manual/user-manual-metadata.xml b/bitbake/doc/user-manual/user-manual-metadata.xml index ab3dcb19e4..5d7a9d753c 100644 --- a/bitbake/doc/user-manual/user-manual-metadata.xml +++ b/bitbake/doc/user-manual/user-manual-metadata.xml | |||
| @@ -1340,19 +1340,21 @@ | |||
| 1340 | <section id='events'> | 1340 | <section id='events'> |
| 1341 | <title>Events</title> | 1341 | <title>Events</title> |
| 1342 | 1342 | ||
| 1343 | <note> | ||
| 1344 | This is only supported in <filename>.bb</filename> | ||
| 1345 | and <filename>.bbclass</filename> files. | ||
| 1346 | </note> | ||
| 1347 | |||
| 1348 | <para> | 1343 | <para> |
| 1349 | BitBake allows installation of event handlers. | 1344 | BitBake allows installation of event handlers within |
| 1345 | recipe and class files. | ||
| 1350 | Events are triggered at certain points during operation, | 1346 | Events are triggered at certain points during operation, |
| 1351 | such as the beginning of operation against a given | 1347 | such as the beginning of operation against a given |
| 1352 | <filename>.bb</filename>, the start of a given task, | 1348 | <filename>.bb</filename>, the start of a given task, |
| 1353 | task failure, task success, and so forth. | 1349 | task failure, task success, and so forth. |
| 1354 | The intent is to make it easy to do things like email | 1350 | The intent is to make it easy to do things like email |
| 1355 | notification on build failure. | 1351 | notification on build failure. |
| 1352 | </para> | ||
| 1353 | |||
| 1354 | <para> | ||
| 1355 | Following is an example event handler that | ||
| 1356 | prints the name of the event and the content of | ||
| 1357 | the <filename>FILE</filename> variable: | ||
| 1356 | <literallayout class='monospaced'> | 1358 | <literallayout class='monospaced'> |
| 1357 | addhandler myclass_eventhandler | 1359 | addhandler myclass_eventhandler |
| 1358 | python myclass_eventhandler() { | 1360 | python myclass_eventhandler() { |
| @@ -1364,42 +1366,83 @@ | |||
| 1364 | </literallayout> | 1366 | </literallayout> |
| 1365 | This event handler gets called every time an event is | 1367 | This event handler gets called every time an event is |
| 1366 | triggered. | 1368 | triggered. |
| 1367 | A global variable "<filename>e</filename>" is defined. | 1369 | A global variable "<filename>e</filename>" is defined and |
| 1368 | "<filename>e.data</filename>" contains an instance of | 1370 | "<filename>e.data</filename>" contains an instance of |
| 1369 | "<filename>bb.data</filename>". | 1371 | "<filename>bb.data</filename>". |
| 1370 | With the <filename>getName(e)</filename> method one can get | 1372 | With the <filename>getName(e)</filename> method, one can get |
| 1371 | the name of the triggered event. | 1373 | the name of the triggered event. |
| 1372 | </para> | 1374 | </para> |
| 1373 | 1375 | ||
| 1374 | <para> | 1376 | <para> |
| 1375 | The above event handler prints the name of the event | 1377 | During all builds, the following common events occur: |
| 1376 | and the content of the <filename>FILE</filename> variable. | ||
| 1377 | During a Build, the following common events occur: | ||
| 1378 | <itemizedlist> | 1378 | <itemizedlist> |
| 1379 | <listitem><para><filename>bb.event.ConfigParsed()</filename></para></listitem> | 1379 | <listitem><para> |
| 1380 | <listitem><para><filename>bb.event.ParseStarted()</filename></para></listitem> | 1380 | <filename>bb.event.ConfigParsed()</filename> |
| 1381 | <listitem><para><filename>bb.event.ParseProgress()</filename></para></listitem> | 1381 | </para></listitem> |
| 1382 | <listitem><para><filename>bb.event.ParseCompleted()</filename></para></listitem> | 1382 | <listitem><para> |
| 1383 | <listitem><para><filename>bb.event.BuildStarted()</filename></para></listitem> | 1383 | <filename>bb.event.ParseStarted()</filename> |
| 1384 | <listitem><para><filename>bb.build.TaskStarted()</filename></para></listitem> | 1384 | </para></listitem> |
| 1385 | <listitem><para><filename>bb.build.TaskInvalid()</filename></para></listitem> | 1385 | <listitem><para> |
| 1386 | <listitem><para><filename>bb.build.TaskFailedSilent()</filename></para></listitem> | 1386 | <filename>bb.event.ParseProgress()</filename> |
| 1387 | <listitem><para><filename>bb.build.TaskFailed()</filename></para></listitem> | 1387 | </para></listitem> |
| 1388 | <listitem><para><filename>bb.build.TaskSucceeded()</filename></para></listitem> | 1388 | <listitem><para> |
| 1389 | <listitem><para><filename>bb.event.BuildCompleted()</filename></para></listitem> | 1389 | <filename>bb.event.ParseCompleted()</filename> |
| 1390 | <listitem><para><filename>bb.cooker.CookerExit()</filename></para></listitem> | 1390 | </para></listitem> |
| 1391 | <listitem><para> | ||
| 1392 | <filename>bb.event.BuildStarted()</filename> | ||
| 1393 | </para></listitem> | ||
| 1394 | <listitem><para> | ||
| 1395 | <filename>bb.build.TaskStarted()</filename> | ||
| 1396 | </para></listitem> | ||
| 1397 | <listitem><para> | ||
| 1398 | <filename>bb.build.TaskInvalid()</filename> | ||
| 1399 | </para></listitem> | ||
| 1400 | <listitem><para> | ||
| 1401 | <filename>bb.build.TaskFailedSilent()</filename> | ||
| 1402 | </para></listitem> | ||
| 1403 | <listitem><para> | ||
| 1404 | <filename>bb.build.TaskFailed()</filename> | ||
| 1405 | </para></listitem> | ||
| 1406 | <listitem><para> | ||
| 1407 | <filename>bb.build.TaskSucceeded()</filename> | ||
| 1408 | </para></listitem> | ||
| 1409 | <listitem><para> | ||
| 1410 | <filename>bb.event.BuildCompleted()</filename> | ||
| 1411 | </para></listitem> | ||
| 1412 | <listitem><para> | ||
| 1413 | <filename>bb.cooker.CookerExit()</filename> | ||
| 1414 | </para></listitem> | ||
| 1391 | </itemizedlist> | 1415 | </itemizedlist> |
| 1392 | Other events that occur based on specific requests to the server: | 1416 | Here is a list of other events that occur based on specific requests |
| 1417 | to the server: | ||
| 1393 | <itemizedlist> | 1418 | <itemizedlist> |
| 1394 | <listitem><para><filename>bb.event.TreeDataPreparationStarted()</filename></para></listitem> | 1419 | <listitem><para> |
| 1395 | <listitem><para><filename>bb.event.TreeDataPreparationProgress</filename></para></listitem> | 1420 | <filename>bb.event.TreeDataPreparationStarted()</filename> |
| 1396 | <listitem><para><filename>bb.event.TreeDataPreparationCompleted</filename></para></listitem> | 1421 | </para></listitem> |
| 1397 | <listitem><para><filename>bb.event.DepTreeGenerated</filename></para></listitem> | 1422 | <listitem><para> |
| 1398 | <listitem><para><filename>bb.event.CoreBaseFilesFound</filename></para></listitem> | 1423 | <filename>bb.event.TreeDataPreparationProgress</filename> |
| 1399 | <listitem><para><filename>bb.event.ConfigFilePathFound</filename></para></listitem> | 1424 | </para></listitem> |
| 1400 | <listitem><para><filename>bb.event.FilesMatchingFound</filename></para></listitem> | 1425 | <listitem><para> |
| 1401 | <listitem><para><filename>bb.event.ConfigFilesFound</filename></para></listitem> | 1426 | <filename>bb.event.TreeDataPreparationCompleted</filename> |
| 1402 | <listitem><para><filename>bb.event.TargetsTreeGenerated</filename></para></listitem> | 1427 | </para></listitem> |
| 1428 | <listitem><para> | ||
| 1429 | <filename>bb.event.DepTreeGenerated</filename> | ||
| 1430 | </para></listitem> | ||
| 1431 | <listitem><para> | ||
| 1432 | <filename>bb.event.CoreBaseFilesFound</filename> | ||
| 1433 | </para></listitem> | ||
| 1434 | <listitem><para> | ||
| 1435 | <filename>bb.event.ConfigFilePathFound</filename> | ||
| 1436 | </para></listitem> | ||
| 1437 | <listitem><para> | ||
| 1438 | <filename>bb.event.FilesMatchingFound</filename> | ||
| 1439 | </para></listitem> | ||
| 1440 | <listitem><para> | ||
| 1441 | <filename>bb.event.ConfigFilesFound</filename> | ||
| 1442 | </para></listitem> | ||
| 1443 | <listitem><para> | ||
| 1444 | <filename>bb.event.TargetsTreeGenerated</filename> | ||
| 1445 | </para></listitem> | ||
| 1403 | </itemizedlist> | 1446 | </itemizedlist> |
| 1404 | </para> | 1447 | </para> |
| 1405 | </section> | 1448 | </section> |
