
It seems that on OSX prior to 10.11.x (El Capitan) the mktemp command doesn't work with only the -d option. The -t option is also required. Add a fallback to use the -t option if the call with only -d fails. See [1] for various discussion around this issue. [1] http://unix.stackexchange.com/q/30091/130341 Bug: Issue 4826 Change-Id: Ie536e2ae071d4247a16f5c390198b8a590086d05
71 lines
1.9 KiB
Python
71 lines
1.9 KiB
Python
package(
|
|
default_visibility = ["//visibility:public"])
|
|
|
|
load("//tools/bzl:js.bzl", "bower_component_bundle", "vulcanize")
|
|
|
|
bower_component_bundle(
|
|
name = 'test_components',
|
|
deps = [
|
|
'//polygerrit-ui:polygerrit_components',
|
|
'//lib/js:iron-test-helpers',
|
|
'//lib/js:test-fixture',
|
|
'//lib/js:web-component-tester',
|
|
],
|
|
)
|
|
|
|
vulcanize(
|
|
name = "gr-app",
|
|
app = 'elements/gr-app.html',
|
|
srcs = glob(
|
|
['**/*.html', '**/*.js'],
|
|
exclude = [
|
|
'bower_components/**',
|
|
'index.html',
|
|
'test/**',
|
|
'**/*_test.html',
|
|
]),
|
|
deps = [ "//polygerrit-ui:polygerrit_components"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "top_sources",
|
|
srcs = glob([
|
|
'favicon.ico',
|
|
'index.html',
|
|
]),
|
|
)
|
|
|
|
filegroup(
|
|
name = "css_sources",
|
|
srcs = glob(['styles/**/*.css'])
|
|
)
|
|
|
|
genrule(
|
|
name = "polygerrit_ui",
|
|
cmd = " && ".join([
|
|
"t=$$(mktemp -d || mktemp -d -t bazel-tmp)",
|
|
"p=$$PWD",
|
|
"mkdir -p $$t/polygerrit_ui/{styles,fonts,bower_components/{highlightjs,webcomponentsjs},elements}",
|
|
"cp $(locations :gr-app) $$t/polygerrit_ui/elements/",
|
|
"cp $(locations //lib/fonts:sourcecodepro) $$t/polygerrit_ui/fonts/",
|
|
"for f in $(locations :top_sources); do cp $$f $$t/polygerrit_ui/; done",
|
|
"for f in $(locations :css_sources); do cp $$f $$t/polygerrit_ui/styles; done",
|
|
"for f in $(locations //lib/js:highlightjs_files); do cp $$f $$t/polygerrit_ui/bower_components/highlightjs/ ; done",
|
|
"unzip -qd $$t/polygerrit_ui/bower_components $(location @webcomponentsjs//:zipfile) webcomponentsjs/webcomponents-lite.js",
|
|
"cd $$t",
|
|
"find . -exec touch -t 198001010000 '{}' ';'",
|
|
"zip -qr $$p/$@ *",
|
|
]),
|
|
srcs = [
|
|
"//lib/fonts:sourcecodepro",
|
|
"//lib/js:highlightjs_files",
|
|
":top_sources",
|
|
":css_sources",
|
|
":gr-app",
|
|
# we extract from the zip, but depend on the component for license checking.
|
|
"@webcomponentsjs//:zipfile",
|
|
"//lib/js:webcomponentsjs",
|
|
],
|
|
outs = [ "polygerrit_ui.zip" ],
|
|
)
|