Bazel: Replace ctx.action with actions#run / actions#run_shell
ctx.action() is deprecated in favor of ctx.actions.run() / ctx.actions.run_shell(): [1]. See discussion in [2], why we need this. [1] https://docs.bazel.build/versions/master/skylark/lib/ctx.html#action [2] https://github.com/bazelbuild/bazel/issues/3589 Change-Id: I11af3afebc0d3c76bb8fb59a790db2e3f3ce982b
This commit is contained in:
@@ -43,7 +43,7 @@ def _replace_macros_impl(ctx):
|
|||||||
cmd.append('--searchbox')
|
cmd.append('--searchbox')
|
||||||
else:
|
else:
|
||||||
cmd.append('--no-searchbox')
|
cmd.append('--no-searchbox')
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
inputs = [ctx.file._exe, ctx.file.src],
|
inputs = [ctx.file._exe, ctx.file.src],
|
||||||
outputs = [ctx.outputs.out],
|
outputs = [ctx.outputs.out],
|
||||||
command = cmd,
|
command = cmd,
|
||||||
@@ -107,7 +107,7 @@ def _asciidoc_impl(ctx):
|
|||||||
"--out-ext", ".html",
|
"--out-ext", ".html",
|
||||||
]
|
]
|
||||||
args.extend(_generate_asciidoc_args(ctx))
|
args.extend(_generate_asciidoc_args(ctx))
|
||||||
ctx.action(
|
ctx.actions.run(
|
||||||
inputs = ctx.files.srcs + [ctx.executable._exe, ctx.file.version],
|
inputs = ctx.files.srcs + [ctx.executable._exe, ctx.file.version],
|
||||||
outputs = ctx.outputs.outs,
|
outputs = ctx.outputs.outs,
|
||||||
executable = ctx.executable._exe,
|
executable = ctx.executable._exe,
|
||||||
@@ -211,7 +211,7 @@ def _asciidoc_html_zip_impl(ctx):
|
|||||||
"--out-ext", ".html",
|
"--out-ext", ".html",
|
||||||
]
|
]
|
||||||
args.extend(_generate_asciidoc_args(ctx))
|
args.extend(_generate_asciidoc_args(ctx))
|
||||||
ctx.action(
|
ctx.actions.run(
|
||||||
inputs = ctx.files.srcs + [ctx.executable._exe, ctx.file.version],
|
inputs = ctx.files.srcs + [ctx.executable._exe, ctx.file.version],
|
||||||
outputs = [ctx.outputs.out],
|
outputs = [ctx.outputs.out],
|
||||||
executable = ctx.executable._exe,
|
executable = ctx.executable._exe,
|
||||||
@@ -268,7 +268,7 @@ def _asciidoc_zip_impl(ctx):
|
|||||||
"cd %s" % tmpdir,
|
"cd %s" % tmpdir,
|
||||||
"zip -qr $p/%s *" % ctx.outputs.out.path,
|
"zip -qr $p/%s *" % ctx.outputs.out.path,
|
||||||
])
|
])
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
inputs = [ctx.file.src] + ctx.files.resources,
|
inputs = [ctx.file.src] + ctx.files.resources,
|
||||||
outputs = [ctx.outputs.out],
|
outputs = [ctx.outputs.out],
|
||||||
command = " && ".join(cmd),
|
command = " && ".join(cmd),
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ def _gwt_user_agent_module(ctx):
|
|||||||
"cp $p/%s %s" % (gwt_user_agent_xml.path, gwt),
|
"cp $p/%s %s" % (gwt_user_agent_xml.path, gwt),
|
||||||
"$p/%s cC $p/%s $(find . | sed 's|^./||')" % (ctx.executable._zip.path, gwt_user_agent_zip.path)
|
"$p/%s cC $p/%s $(find . | sed 's|^./||')" % (ctx.executable._zip.path, gwt_user_agent_zip.path)
|
||||||
])
|
])
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
inputs = [gwt_user_agent_xml] + ctx.files._zip,
|
inputs = [gwt_user_agent_xml] + ctx.files._zip,
|
||||||
outputs = [gwt_user_agent_zip],
|
outputs = [gwt_user_agent_zip],
|
||||||
command = cmd,
|
command = cmd,
|
||||||
@@ -180,7 +180,7 @@ def _gwt_binary_impl(ctx):
|
|||||||
)
|
)
|
||||||
])
|
])
|
||||||
|
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
inputs = list(deps) + ctx.files._jdk + ctx.files._zip + gwt_user_agent_modules,
|
inputs = list(deps) + ctx.files._jdk + ctx.files._zip + gwt_user_agent_modules,
|
||||||
outputs = [output_zip],
|
outputs = [output_zip],
|
||||||
mnemonic = "GwtBinary",
|
mnemonic = "GwtBinary",
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ def _impl(ctx):
|
|||||||
"find %s -exec touch -t 198001010000 '{}' ';'" % dir,
|
"find %s -exec touch -t 198001010000 '{}' ';'" % dir,
|
||||||
"(cd %s && zip -qr ../%s *)" % (dir, ctx.outputs.zip.basename),
|
"(cd %s && zip -qr ../%s *)" % (dir, ctx.outputs.zip.basename),
|
||||||
]
|
]
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
inputs = list(transitive_jar_set) + list(source_jars) + ctx.files._jdk,
|
inputs = list(transitive_jar_set) + list(source_jars) + ctx.files._jdk,
|
||||||
outputs = [zip_output],
|
outputs = [zip_output],
|
||||||
command = " && ".join(cmd))
|
command = " && ".join(cmd))
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ def _js_component(ctx):
|
|||||||
"zip -qr ../%s *" % ctx.outputs.zip.basename
|
"zip -qr ../%s *" % ctx.outputs.zip.basename
|
||||||
])
|
])
|
||||||
|
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
inputs = ctx.files.srcs,
|
inputs = ctx.files.srcs,
|
||||||
outputs = [ctx.outputs.zip],
|
outputs = [ctx.outputs.zip],
|
||||||
command = cmd,
|
command = cmd,
|
||||||
@@ -234,7 +234,7 @@ def _bower_component_bundle_impl(ctx):
|
|||||||
out_zip = ctx.outputs.zip
|
out_zip = ctx.outputs.zip
|
||||||
out_versions = ctx.outputs.version_json
|
out_versions = ctx.outputs.version_json
|
||||||
|
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
inputs=list(zips),
|
inputs=list(zips),
|
||||||
outputs=[out_zip],
|
outputs=[out_zip],
|
||||||
command=" && ".join([
|
command=" && ".join([
|
||||||
@@ -249,7 +249,7 @@ def _bower_component_bundle_impl(ctx):
|
|||||||
]),
|
]),
|
||||||
mnemonic="BowerCombine")
|
mnemonic="BowerCombine")
|
||||||
|
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
inputs=list(versions),
|
inputs=list(versions),
|
||||||
outputs=[out_versions],
|
outputs=[out_versions],
|
||||||
mnemonic="BowerVersions",
|
mnemonic="BowerVersions",
|
||||||
@@ -317,7 +317,7 @@ def _vulcanize_impl(ctx):
|
|||||||
use_default_shell_env = True,
|
use_default_shell_env = True,
|
||||||
execution_requirements = {"local": "1"},
|
execution_requirements = {"local": "1"},
|
||||||
)
|
)
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
mnemonic = "Vulcanize",
|
mnemonic = "Vulcanize",
|
||||||
inputs = [ctx.file._run_npm, ctx.file.app,
|
inputs = [ctx.file._run_npm, ctx.file.app,
|
||||||
ctx.file._vulcanize_archive
|
ctx.file._vulcanize_archive
|
||||||
@@ -335,7 +335,7 @@ def _vulcanize_impl(ctx):
|
|||||||
"--html", ctx.outputs.html.path,
|
"--html", ctx.outputs.html.path,
|
||||||
"--js", ctx.outputs.js.path])
|
"--js", ctx.outputs.js.path])
|
||||||
|
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
mnemonic = "Crisper",
|
mnemonic = "Crisper",
|
||||||
inputs = [ctx.file._run_npm, ctx.file.app,
|
inputs = [ctx.file._run_npm, ctx.file.app,
|
||||||
ctx.file._crisper_archive, vulcanized],
|
ctx.file._crisper_archive, vulcanized],
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ def _war_impl(ctx):
|
|||||||
# Add zip war
|
# Add zip war
|
||||||
cmd.append(_make_war(build_output, war))
|
cmd.append(_make_war(build_output, war))
|
||||||
|
|
||||||
ctx.action(
|
ctx.actions.run_shell(
|
||||||
inputs = inputs,
|
inputs = inputs,
|
||||||
outputs = [war],
|
outputs = [war],
|
||||||
mnemonic = 'WAR',
|
mnemonic = 'WAR',
|
||||||
|
|||||||
Reference in New Issue
Block a user