-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move instrumentation rules to
rules/defs.bzl
(#116)
Fixes #116
- Loading branch information
1 parent
d5dd9cd
commit 5d70380
Showing
8 changed files
with
36 additions
and
37 deletions.
There are no files selected for viewing
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
exports_files(["AndroidTestManifest.xml.tpl"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
def _generate_manifest_xml_impl(ctx): | ||
ctx.actions.expand_template( | ||
template = ctx.file._template, | ||
output = ctx.outputs.output, | ||
substitutions = { | ||
"{{.PACKAGE_NAME}}": ctx.attr.package_name, | ||
"{{.TARGET_PACKAGE_NAME}}": ctx.attr.target_package_name, | ||
"{{.INSTRUMENTATION_RUNNER}}": ctx.attr.test_instrumentation_runner, | ||
}, | ||
) | ||
return [ | ||
DefaultInfo(files = depset([ctx.outputs.output])), | ||
] | ||
|
||
generate_manifest_xml = rule( | ||
implementation = _generate_manifest_xml_impl, | ||
attrs = { | ||
"package_name": attr.string(mandatory = True), | ||
"target_package_name": attr.string(mandatory = True), | ||
"test_instrumentation_runner": attr.string(mandatory = True), | ||
"output": attr.output(mandatory = True), | ||
"_template": attr.label( | ||
doc = "Android Test Manifest template", | ||
default = ":AndroidTestManifest.xml.tpl", | ||
allow_single_file = True, | ||
), | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.