ルール
action_listener
action_listener(name, compatible_with, deprecation, distribs, exec_compatible_with, exec_properties, extra_actions, features, licenses, mnemonics, restricted_to, tags, target_compatible_with, testonly, visibility)
警告: 追加のアクションは非推奨になりました。代わりにアスペクトを使用してください。
action_listener
ルール自体は出力を生成しません。ツール デベロッパーは、アクションから extra_action
へのマッピングを提供することで、ビルドシステムに extra_action
を挿入できるようになります。
このルールの引数は、アクションのニーモニックを extra_action
ルールにマッピングします。
オプション
--experimental_action_listener=<label>
を指定すると、ビルドは指定された action_listener
を使用して extra_action
をビルドグラフに挿入します。
例
action_listener( name = "index_all_languages", mnemonics = [ "Javac", "CppCompile", "Python", ], extra_actions = [":indexer"], ) action_listener( name = "index_java", mnemonics = ["Javac"], extra_actions = [":indexer"], ) extra_action( name = "indexer", tools = ["//my/tools:indexer"], cmd = "$(location //my/tools:indexer)" + "--extra_action_file=$(EXTRA_ACTION_FILE)", )
引数
属性 | |
---|---|
name |
このターゲットの一意の名前。 |
extra_actions
|
action_listener がビルドグラフに追加する extra_action ターゲットのリスト。
例: [ "//my/tools:analyzer" ] 。
|
mnemonics
|
action_listener がリッスンするアクション ニーモニックのリスト(例: [ "Javac" ] )。ニーモニックは公開インターフェースではありません。ニーモニックとその動作が変わらない保証はありません。 |
extra_action
extra_action(name, data, cmd, compatible_with, deprecation, distribs, exec_compatible_with, exec_properties, features, licenses, out_templates, requires_action_output, restricted_to, tags, target_compatible_with, testonly, toolchains, tools, visibility)
警告: 追加のアクションは非推奨になりました。代わりにアスペクトを使用してください。
extra_action
ルールは、通常のビルド ターゲットとして指定された場合、意味のある出力を生成しません。ツール デベロッパーは、既存のアクションをシャドーイングする追加のアクションをビルドグラフに挿入できます。
extra_action
を有効にする方法については、action_listener
をご覧ください。
extra_action
はコマンドラインとして実行されます。コマンドライン ツールは、シャドーイングする元のアクションに関する詳細情報を含むプロトコル バッファを $(EXTRA_ACTION_FILE) として含むファイルにアクセスします。また、元のアクションがアクセスできるすべての入力ファイルにもアクセスできます。プロトコル バッファ内に格納されているデータの詳細については、extra_actions_base.proto をご覧ください。各 proto ファイルには ExtraActionInfo メッセージが含まれます。
他のすべてのアクションと同様に、追加のアクションはサンドボックス化されるため、それを処理するように設計する必要があります。
引数
属性 | |
---|---|
name |
このターゲットの一意の名前。 このルールは、 action_listener ルールの extra_actions 引数の label で参照できます。
|
cmd
|
genrule cmd 属性に似ていますが、次の点が異なります。
|
out_templates
|
extra_action コマンドで生成されたファイルのテンプレートのリスト。テンプレートでは次の変数を使用できます。
|
requires_action_output
|
extra_action は、元のアクションの出力がこの extra_action への入力として存在する必要があることを示します。
true(デフォルトは false)の場合、extra_action は元のアクション出力が入力の一部として使用できると想定できます。 |
tools
|
tool 依存関係のリスト。詳細については、依存関係の定義をご覧ください。
ビルドシステムは、 すべてのツールとそのデータ依存関係は 1 つのツリーに統合され、そのツリー内で相対パスを使用できます。作業ディレクトリは、その統合ツリーのルートになります。 |