aboutsummaryrefslogtreecommitdiff
path: root/examples/manifest/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'examples/manifest/BUILD')
-rw-r--r--examples/manifest/BUILD41
1 files changed, 41 insertions, 0 deletions
diff --git a/examples/manifest/BUILD b/examples/manifest/BUILD
new file mode 100644
index 0000000..d308a59
--- /dev/null
+++ b/examples/manifest/BUILD
@@ -0,0 +1,41 @@
+load(":android_mock.bzl", "android_binary", "android_library")
+load("@rules_license//tools:test_helpers.bzl", "golden_cmd_test")
+
+
+# These two rules today capture what an android_binary would look like.
+# This rule represents the Android specific code that displays licenses
+# on the display. Note that it does not depend on anything to get the
+# license contents; the implementation of these rules macros handle that
+# detail.
+android_library(
+ name = "licenses",
+ srcs = [
+ "license_display.sh",
+ ],
+ data = [
+ "@rules_license//distro:distro",
+ ],
+)
+
+# This captures how the application would be built. The dependencies of this
+# rule are crawled to identify third-party licenses in use. The macro definition
+# of this rule creates a graph to capture that process of identifying licenses,
+# building the licenses target, and finally invoking the "real" android_binary
+# rule to build the final output with the injected license content.
+android_binary(
+ name = "main",
+ srcs = ["main.sh"],
+ deps = [
+ ],
+ data = [
+ ":licenses",
+ ],
+)
+
+golden_cmd_test(
+ name = "main_test",
+ srcs = [],
+ cmd = "$(location :main)",
+ tools = [":main"],
+ golden = "main_golden.txt",
+)