Introduce default github build target All plugins are expected to have a main build target having the same name as the plugin's directory. Introduce the 'github' plugin which is the main node of the dependency of all other targets, including the one responsible for extracting the plugin's version into a version file. Change-Id: I9fb3694e5fb2c4cbf0455d54281ee2677429d16f
diff --git a/BUILD b/BUILD index 501159f..41bb112 100644 --- a/BUILD +++ b/BUILD
@@ -1,3 +1,16 @@ +load("//tools/bzl:genrule2.bzl", "genrule2") + +genrule( + name = "github", + srcs = [ + ":github-plugin", + ":github-plugin-version", + ":github-oauth", + ], + outs = ["github.zip"], + cmd = "zip -o $@ $(SRCS)", +) + genrule( name = "github-oauth", srcs = ["//plugins/github/github-oauth:github-oauth_deploy.jar"], @@ -5,6 +18,13 @@ cmd = "cp $< $@", ) +genrule2( + name = "github-plugin-version", + srcs = [":github-plugin"], + outs = ["github-plugin.jar-version"], + cmd = "jar xvf $< META-INF/MANIFEST.MF; cat META-INF/MANIFEST.MF | grep Implementation-Version | cut -d ':' -f 2 | xargs > $@", +) + genrule( name = "github-plugin", srcs = ["//plugins/github/github-plugin"],