Import code from internal repository to git

This commit is contained in:
Justine Tunney 2016-03-01 17:18:14 -05:00
commit 0ef0c933d2
2490 changed files with 281594 additions and 0 deletions

10
third_party/closure/compiler/BUILD vendored Normal file
View file

@ -0,0 +1,10 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_binary(
name = "compiler",
jvm_flags = ["-client"],
main_class = "com.google.javascript.jscomp.CommandLineRunner",
runtime_deps = ["@closure_compiler//jar"],
)

View file

@ -0,0 +1,96 @@
# -*- mode: python; -*-
#
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Rule for building JavaScript binaries with Closure Compiler.
"""
load("//third_party/closure/compiler/private:defs.bzl",
"JS_LANGUAGE_DEFAULT",
"JS_LIBRARY_ATTRS",
"JS_PEDANTIC_ARGS",
"JS_HIDE_WARNING_ARGS",
"check_js_language",
"collect_js_srcs",
"determine_js_language",
"is_using_closure_library")
def _impl(ctx):
srcs, externs = collect_js_srcs(ctx)
check_js_language(ctx.attr.language_in)
check_js_language(ctx.attr.language_out)
dependent_language = determine_js_language(ctx)
if ctx.attr.language_in != dependent_language:
fail("language_in was %s but dependencies use %s" % (
ctx.attr.language_in, dependent_language))
args = [
"--js_output_file=%s" % ctx.outputs.out.path,
"--create_source_map=%s" % ctx.outputs.srcmap.path,
"--language_in=%s" % ctx.attr.language_in,
"--language_out=%s" % ctx.attr.language_out,
"--compilation_level=" + ctx.attr.compilation_level,
"--warning_level=VERBOSE",
"--new_type_inf",
"--generate_exports",
]
args += JS_HIDE_WARNING_ARGS
if ctx.attr.formatting:
args += ["--formatting=" + ctx.attr.formatting]
if ctx.attr.debug:
args += ["--debug"]
else:
if is_using_closure_library(srcs):
args += ["--define=goog.DEBUG=false"]
if ctx.attr.main:
args += [
"--dependency_mode=STRICT",
"--entry_point=goog:%s" % ctx.attr.main,
]
else:
args += ["--dependency_mode=LOOSE"]
if ctx.attr.pedantic:
args += JS_PEDANTIC_ARGS
args += ["--use_types_for_optimization"]
args += ctx.attr.defs
args += ["--externs=%s" % extern.path for extern in externs]
args += ["--js=%s" % src.path for src in srcs]
ctx.action(
inputs=list(srcs) + list(externs),
outputs=[ctx.outputs.out, ctx.outputs.srcmap],
executable=ctx.executable._compiler,
arguments=args,
mnemonic="JSCompile",
progress_message="Compiling %d JavaScript files to %s" % (
len(srcs) + len(externs),
ctx.outputs.out.short_path))
return struct(files=set([ctx.outputs.out]))
closure_js_binary = rule(
implementation=_impl,
attrs=JS_LIBRARY_ATTRS + {
"main": attr.string(),
"compilation_level": attr.string(default="ADVANCED"),
"defs": attr.string_list(),
"pedantic": attr.bool(default=False),
"debug": attr.bool(default=False),
"formatting": attr.string(),
"language_in": attr.string(default=JS_LANGUAGE_DEFAULT),
"language_out": attr.string(default="ECMASCRIPT3"),
"_compiler": attr.label(
default=Label("//third_party/closure/compiler"),
executable=True),
},
outputs={"out": "%{name}.js",
"srcmap": "%{name}.sourcemap"})

View file

@ -0,0 +1,69 @@
# -*- mode: python; -*-
#
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Test rule for validating JavaScript types but not producing a compiled file.
"""
load("//third_party/closure/compiler/private:defs.bzl",
"JS_LANGUAGE_DEFAULT",
"JS_LIBRARY_ATTRS",
"JS_PEDANTIC_ARGS",
"JS_HIDE_WARNING_ARGS",
"check_js_language",
"collect_js_srcs",
"determine_js_language",
"is_using_closure_library")
def _impl(ctx):
srcs, externs = collect_js_srcs(ctx)
args = [
"third_party/closure/compiler/compiler",
"--checks-only",
"--language_in=%s" % determine_js_language(ctx),
"--compilation_level=" + ctx.attr.compilation_level,
"--warning_level=VERBOSE",
"--new_type_inf",
]
if is_using_closure_library(srcs):
args += ["--dependency_mode=LOOSE"]
if ctx.attr.pedantic:
args += JS_PEDANTIC_ARGS
args += JS_HIDE_WARNING_ARGS
args += ctx.attr.defs
args += ["--externs='%s'" % extern.path for extern in externs]
args += ["--js='%s'" % src.path for src in srcs]
ctx.file_action(
executable=True,
output=ctx.outputs.executable,
content="#!/bin/sh\nexec " + " \\\n ".join(args) + "\n")
return struct(files=set([ctx.outputs.executable]),
runfiles=ctx.runfiles(
files=list(srcs) + list(externs),
transitive_files=ctx.attr._compiler.data_runfiles.files,
collect_data=True))
closure_js_check_test = rule(
test=True,
implementation=_impl,
attrs=JS_LIBRARY_ATTRS + {
"compilation_level": attr.string(default="ADVANCED"),
"defs": attr.string_list(),
"pedantic": attr.bool(default=False),
"language": attr.string(default=JS_LANGUAGE_DEFAULT),
"_compiler": attr.label(
default=Label("//third_party/closure/compiler"),
executable=True),
})

View file

@ -0,0 +1,54 @@
# -*- mode: python; -*-
#
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Build definitions for JavaScript dependency files.
Generating this file is important because the deps-runfiles.js file tells the
Closure Library how to send requests to the web server to load goog.require'd
namespaces.
"""
load("//third_party/closure/compiler/private:defs.bzl",
"JS_FILE_TYPE",
"make_js_deps_runfiles")
def _impl(ctx):
srcs = set(order="compile")
for src in ctx.attr.srcs:
srcs += src.transitive_js_srcs
ctx.action(
inputs=list(srcs),
outputs=[ctx.outputs.out],
arguments=(["--output_file=%s" % (ctx.outputs.out.path)] +
[src.path for src in srcs]),
executable=ctx.executable._depswriter,
progress_message="Calculating %d JavaScript deps to %s" % (
len(srcs), ctx.outputs.out.short_path))
make_js_deps_runfiles(ctx, srcs)
return struct(files=set([ctx.outputs.out, ctx.outputs.runfiles]))
closure_js_deps = rule(
implementation=_impl,
attrs={
"srcs": attr.label_list(
allow_files=False,
providers=["transitive_js_srcs"]),
"_depswriter": attr.label(
default=Label("@closure_library//:depswriter"),
executable=True),
},
outputs={"out": "%{name}.js",
"runfiles": "%{name}-runfiles.js"})

View file

@ -0,0 +1,40 @@
# -*- mode: python; -*-
#
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Build definitions for Closure JavaScript libraries.
"""
load("//third_party/closure/compiler/private:defs.bzl",
"JS_LANGUAGE_DEFAULT",
"JS_DEPS_ATTR",
"JS_LIBRARY_ATTRS",
"collect_js_srcs",
"determine_js_language")
def _impl(ctx):
srcs, externs = collect_js_srcs(ctx)
return struct(files=set(ctx.files.srcs),
js_language=determine_js_language(ctx),
js_exports=ctx.files.exports,
transitive_js_srcs=srcs,
transitive_js_externs=externs)
closure_js_library = rule(
implementation=_impl,
attrs=JS_LIBRARY_ATTRS + {
"exports": JS_DEPS_ATTR,
"language": attr.string(default=JS_LANGUAGE_DEFAULT),
})

View file

@ -0,0 +1 @@
package(default_visibility = ["//third_party/closure:__subpackages__"])

View file

@ -0,0 +1,173 @@
# -*- mode: python; -*-
#
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Common build definitions for Closure Compiler build definitions.
"""
JS_LANGUAGE_DEFAULT = "ECMASCRIPT6_STRICT"
JS_FILE_TYPE = FileType([".js"])
JS_TEST_FILE_TYPE = FileType(["_test.js"])
_CLOSURE_ROOT = "external/closure_library/closure/goog"
_CLOSURE_REL = "../../../.."
JS_LANGUAGES = set([
"ANY",
"ECMASCRIPT3",
"ECMASCRIPT5",
"ECMASCRIPT5_STRICT",
"ECMASCRIPT6",
"ECMASCRIPT6_STRICT",
"ECMASCRIPT6_TYPED",
])
JS_DEPS_ATTR = attr.label_list(
allow_files=False,
providers=["js_language",
"js_exports",
"transitive_js_srcs",
"transitive_js_externs"])
JS_LIBRARY_ATTRS = {
"srcs": attr.label_list(allow_files=JS_FILE_TYPE),
"externs_list": attr.label_list(allow_files=JS_FILE_TYPE),
"deps": JS_DEPS_ATTR,
}
JS_PEDANTIC_ARGS = [
"--jscomp_error=*",
"--jscomp_warning=deprecated",
"--jscomp_warning=unnecessaryCasts",
]
JS_HIDE_WARNING_ARGS = [
"--hide_warnings_for=.soy.js",
"--hide_warnings_for=external/closure_library/",
"--hide_warnings_for=external/soyutils_usegoog/",
]
def collect_js_srcs(ctx):
srcs = set(order="compile")
externs = set(order="compile")
for dep in ctx.attr.deps:
srcs += dep.js_exports
srcs += dep.transitive_js_srcs
externs += dep.transitive_js_externs
srcs += JS_FILE_TYPE.filter(ctx.files.srcs)
externs += JS_FILE_TYPE.filter(ctx.files.externs_list)
return srcs, externs
def check_js_language(language):
if language not in JS_LANGUAGES:
fail("Invalid JS language '%s', expected one of %s" % (
language, ', '.join(list(JS_LANGUAGES))))
return language
def determine_js_language(ctx):
language = None
if hasattr(ctx.attr, 'language'):
language = check_js_language(ctx.attr.language)
for dep in ctx.attr.deps:
language = _mix_js_languages(language, dep.js_language)
if hasattr(ctx.attr, 'exports'):
for dep in ctx.attr.deps:
language = _mix_js_languages(language, dep.js_language)
return language or JS_LANGUAGE_DEFAULT
def make_js_deps_runfiles(ctx, srcs):
ctx.action(
inputs=list(srcs),
outputs=[ctx.outputs.runfiles],
arguments=(["--output_file=%s" % ctx.outputs.runfiles.path] +
["--root_with_prefix=%s %s" % (r, _make_prefix(p))
for r, p in _find_roots(
[(src.dirname, src.short_path) for src in srcs])]),
executable=ctx.executable._depswriter,
progress_message="Calculating %d JavaScript runfile deps to %s" % (
len(srcs), ctx.outputs.runfiles.short_path))
def is_using_closure_library(srcs):
return _contains_file(srcs, "external/closure_library/closure/goog/base.js")
_JS_LANGUAGE_COMPATIBILITY = set([
("ECMASCRIPT5", "ECMASCRIPT3"),
("ECMASCRIPT5", "ECMASCRIPT5_STRICT"),
("ECMASCRIPT6", "ECMASCRIPT3"),
("ECMASCRIPT6", "ECMASCRIPT5"),
("ECMASCRIPT6", "ECMASCRIPT5_STRICT"),
("ECMASCRIPT6", "ECMASCRIPT6_STRICT"),
("ECMASCRIPT6_STRICT", "ECMASCRIPT5_STRICT"),
("ECMASCRIPT6_TYPED", "ECMASCRIPT6_STRICT"),
("ECMASCRIPT6_TYPED", "ECMASCRIPT5_STRICT"),
])
_JS_LANGUAGE_DECAY = {
("ECMASCRIPT5_STRICT", "ECMASCRIPT3"): "ECMASCRIPT5",
("ECMASCRIPT5_STRICT", "ECMASCRIPT5"): "ECMASCRIPT5",
("ECMASCRIPT6_STRICT", "ECMASCRIPT3"): "ECMASCRIPT6",
("ECMASCRIPT6_STRICT", "ECMASCRIPT5"): "ECMASCRIPT6",
("ECMASCRIPT6_STRICT", "ECMASCRIPT6"): "ECMASCRIPT6",
}
def _mix_js_languages(current, dependent):
if not current:
return dependent
if current == dependent:
return current
if current == "ANY":
return dependent
if dependent == "ANY":
return current
if (current, dependent) in _JS_LANGUAGE_COMPATIBILITY:
return current
decay = _JS_LANGUAGE_DECAY[(current, dependent)]
if decay:
print("Dependency causing JS strictness to decay from %s to %s :(" % (
current, decay))
return dependent
decay = _JS_LANGUAGE_DECAY[(dependent, current)]
if decay:
return dependent
fail("Can not link an %s library against an %s one." % (dependent, current))
def _find_roots(dirs):
roots = {}
for _, d, p in sorted([(len(d.split("/")), d, p) for d, p in dirs]):
parts = d.split("/")
want = True
for i in range(len(parts)):
if "/".join(parts[:i + 1]) in roots:
want = False
break
if want:
roots[d] = p
return roots.items()
def _make_prefix(prefix):
prefix = "/".join(prefix.split("/")[:-1])
if not prefix:
return _CLOSURE_REL
elif prefix == _CLOSURE_ROOT:
return "."
elif prefix.startswith(_CLOSURE_ROOT + "/"):
return prefix[len(_CLOSURE_ROOT) + 1:]
else:
return _CLOSURE_REL + "/" + prefix
def _contains_file(srcs, path):
for src in srcs:
if src.short_path == path:
return True
return False

16
third_party/closure/library/BUILD vendored Normal file
View file

@ -0,0 +1,16 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
load("//third_party/closure/compiler:closure_js_library.bzl", "closure_js_library")
load("//third_party/closure/stylesheets:closure_css_library.bzl", "closure_css_library")
closure_js_library(
name = "library",
srcs = ["@closure_library//:js_files"],
)
closure_css_library(
name = "css",
srcs = ["@closure_library//:css_files"],
)

View file

@ -0,0 +1,31 @@
package(default_visibility = ["//visibility:public"])
filegroup(
name = "js_files",
srcs = glob(
[
"closure/goog/**/*.js",
"third_party/closure/goog/**/*.js",
],
exclude = [
"closure/goog/**/*_test.js",
"closure/goog/demos/**/*.js",
"third_party/closure/goog/**/*_test.js",
],
),
)
filegroup(
name = "css_files",
srcs = glob(["closure/goog/css/**/*.css"]),
)
py_binary(
name = "depswriter",
srcs = [
"closure/bin/build/depswriter.py",
"closure/bin/build/source.py",
"closure/bin/build/treescan.py",
],
main = "closure/bin/build/depswriter.py",
)

16
third_party/closure/stylesheets/BUILD vendored Normal file
View file

@ -0,0 +1,16 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_binary(
name = "stylesheets",
jvm_flags = ["-client"],
main_class = "com.google.common.css.compiler.commandline.ClosureCommandLineCompiler",
runtime_deps = [
"@args4j//jar",
"@bazel_tools//third_party:gson",
"@bazel_tools//third_party:guava",
"@bazel_tools//third_party:jsr305",
"@closure_stylesheets//jar",
],
)

View file

@ -0,0 +1,78 @@
# -*- mode: python; -*-
#
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Build definitions for CSS compiled by the Closure Stylesheets.
"""
_CSS_FILE_TYPE = FileType([".css", ".gss"])
_JS_FILE_TYPE = FileType([".js"])
def _impl(ctx):
srcs = set(order="compile")
for dep in ctx.attr.deps:
srcs += dep.transitive_css_srcs
srcs += _CSS_FILE_TYPE.filter(ctx.files.srcs)
js_srcs = set(order="compile")
js_srcs += ctx.attr._library.transitive_js_srcs
js_srcs += _JS_FILE_TYPE.filter([ctx.outputs.js])
js_externs = set(order="compile")
js_externs += ctx.attr._library.transitive_js_externs
args = [
"--output-file",
ctx.outputs.out.path,
"--output-renaming-map",
ctx.outputs.js.path,
"--output-renaming-map-format",
"CLOSURE_COMPILED_SPLIT_HYPHENS",
]
if ctx.attr.debug:
args += ["--rename", "DEBUG", "--pretty-print"]
else:
args += ["--rename", "CLOSURE"]
args += ctx.attr.defs
args += [src.path for src in srcs]
ctx.action(
inputs=list(srcs),
outputs=[ctx.outputs.out, ctx.outputs.js],
arguments=args,
executable=ctx.executable._compiler,
progress_message="Compiling %d stylesheets to %s" % (
len(srcs), ctx.outputs.out.short_path))
return struct(files=set([ctx.outputs.out]),
js_language="ANY",
js_exports=set(order="compile"),
transitive_js_srcs=js_srcs,
transitive_js_externs=js_externs)
closure_css_binary = rule(
implementation=_impl,
attrs={
"srcs": attr.label_list(allow_files=_CSS_FILE_TYPE),
"deps": attr.label_list(
allow_files=False,
providers=["transitive_css_srcs"]),
"defs": attr.string_list(),
"debug": attr.bool(default=False),
"_compiler": attr.label(
default=Label("//third_party/closure/stylesheets"),
executable=True),
"_library": attr.label(
default=Label("//third_party/closure/library"),
providers=["transitive_js_srcs",
"transitive_js_externs"]),
},
outputs={"out": "%{name}.css",
"js": "%{name}.css.js"})

View file

@ -0,0 +1,34 @@
# -*- mode: python; -*-
#
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Build definitions for Closure Stylesheet libraries.
"""
_CSS_FILE_TYPE = FileType([".css", ".gss"])
def _impl(ctx):
srcs = set(order="compile")
for dep in ctx.attr.deps:
srcs += dep.transitive_css_srcs
srcs += _CSS_FILE_TYPE.filter(ctx.files.srcs)
return struct(files=set(), transitive_css_srcs=srcs)
closure_css_library = rule(
implementation=_impl,
attrs={
"srcs": attr.label_list(allow_files=_CSS_FILE_TYPE),
"deps": attr.label_list(providers=["transitive_css_srcs"])
})

50
third_party/closure/templates/BUILD vendored Normal file
View file

@ -0,0 +1,50 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
load("//third_party/closure/compiler:closure_js_library.bzl", "closure_js_library")
java_library(
name = "templates",
exports = ["@soy//jar"],
runtime_deps = [
"@aopalliance//jar",
"@asm//jar",
"@asm_analysis//jar",
"@asm_commons//jar",
"@asm_util//jar",
"@bazel_tools//third_party:guava",
"@bazel_tools//third_party:jsr305",
"@bazel_tools//third_party:jsr330_inject",
"@guice//jar",
"@guice_assistedinject//jar",
"@guice_multibindings//jar",
"@icu4j//jar",
],
)
closure_js_library(
name = "soyutils_usegoog",
srcs = ["@soyutils_usegoog//file"],
deps = ["//third_party/closure/library"],
)
java_binary(
name = "SoyParseInfoGenerator",
jvm_flags = ["-client"],
main_class = "com.google.template.soy.SoyParseInfoGenerator",
runtime_deps = [
"@args4j//jar",
":templates",
],
)
java_binary(
name = "SoyToJsSrcCompiler",
jvm_flags = ["-client"],
main_class = "com.google.template.soy.SoyToJsSrcCompiler",
runtime_deps = [
"@args4j//jar",
":templates",
],
)

View file

@ -0,0 +1,185 @@
# -*- mode:python; -*-
#
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utilities for compiling Closure Templates to Java.
"""
# Generates a java_library with the SoyFileInfo and SoyTemplateInfo
# for all templates.
#
# For each Soy input called abc_def.soy, a Java class AbcDefSoyInfo will be
# generated. For a template in that file called foo.barBaz, you can reference
# its info as AbcDefSoyInfo.BAR_BAZ.
#
# srcs: an explicit file list of soy files to scan.
# java_package: the package for the Java files that are generated. If not
# given, defaults to the package from which this function was invoked.
# deps: Soy files that these templates depend on, in order for
# templates to include the parameters of templates they call.
# filegroup_name: will create a filegroup suitable for use as a
# dependency by another soy_java_wrappers rule
# extra_srcs: any build rule that provides Soy files that should be used
# as additional sources. For these, an extra_outs must be provided for each
# Java file expected. Useful for generating Java wrappers for Soy files not
# in the Java tree.
# extra_outs: extra output files from the dependencies that are requested;
# useful if for generating wrappers for files that are not in the Java tree
# allow_external_calls: Whether to allow external soy calls (i.e. calls to
# undefined templates). This parameter is passed to SoyParseInfoGenerator and
# it defaults to true.
# soycompilerbin: Optional Soy to ParseInfo compiler target.
def closure_template_java_library(
name,
java_package = None,
srcs = [],
deps = [],
filegroup_name = None,
extra_srcs = [],
extra_outs = [],
allow_external_calls = 1,
soycompilerbin = '//third_party/closure/templates:SoyParseInfoGenerator',
**kwargs):
# Strip off the .soy suffix from the file name and camel-case it, preserving
# the case of directory names, if any.
outs = [(_soy__dirname(fn) + _soy__camel(_soy__filename(fn)[:-4])
+ 'SoyInfo.java')
for fn in srcs]
java_package = java_package or _soy__GetJavaPackageForCurrentDirectory()
# TODO(gboyer): Stop generating the info for all the dependencies.
# First, generate the actual AbcSoyInfo.java files.
_gen_soy_java_wrappers(
name = name + '_files',
java_package = java_package,
srcs = srcs + extra_srcs,
deps = deps,
outs = outs + extra_outs,
allow_external_calls = allow_external_calls,
soycompilerbin = soycompilerbin,
**kwargs)
# Now, wrap them in a Java library, and expose the Soy files as resources.
java_srcs = outs + extra_outs
native.java_library(
name = name,
srcs = java_srcs or None,
exports = ['//third_party/closure/templates'],
deps = [
'//java/com/google/common/collect',
'//third_party/closure/templates',
] if java_srcs else None, # b/13630760
resources = srcs + extra_srcs,
**kwargs)
if filegroup_name != None:
# Create a filegroup with all the dependencies.
native.filegroup(
name = filegroup_name,
srcs = srcs + extra_srcs + deps,
**kwargs)
# Generates SoyFileInfo and SoyTemplateInfo sources for Soy templates.
#
# - name: the name of a genrule which will contain Java sources
# - java_package: name of the java package, e.g. com.google.foo.template
# - srcs: all Soy file sources
# - deps: Soy files to parse but not to generate outputs for
# - outs: desired output files. for abc_def.soy, expect AbcDefSoyInfo.java
# - allow_external_calls: Whether to allow external calls, defaults to true.
# - soycompilerbin Optional Soy to ParseInfo compiler target.
def _gen_soy_java_wrappers(name, java_package, srcs, deps, outs,
allow_external_calls = 1,
soycompilerbin = '//third_party/closure/templates:SoyParseInfoGenerator',
**kwargs):
additional_flags = ''
targets = " ".join(["$(locations " + src + ")" for src in srcs])
srcs_flag_file_name = name + '__srcs'
deps_flag_file_name = name + '__deps'
_soy__gen_file_list_arg_as_file(
out_name = srcs_flag_file_name,
targets = srcs,
flag = '--srcs',
)
_soy__gen_file_list_arg_as_file(
out_name = deps_flag_file_name,
targets = deps,
flag = '--deps',
)
native.genrule(
name = name,
tools = [soycompilerbin],
srcs = [srcs_flag_file_name, deps_flag_file_name] + srcs + deps,
message = "Generating SOY v2 Java files",
outs = outs,
cmd = '$(location %s)' % soycompilerbin +
' --outputDirectory=$(@D)' +
' --javaPackage=' + java_package +
' --javaClassNameSource=filename' +
' --allowExternalCalls=' + str(allow_external_calls) +
additional_flags +
# Include the sources and deps files as command line flags.
' $$(cat $(location ' + srcs_flag_file_name + '))' +
' $$(cat $(location ' + deps_flag_file_name + '))',
**kwargs)
# The output file for abc_def.soy is AbcDefSoyInfo.java. Handle camelcasing
# for both underscores and digits: css3foo_bar is Css3FooBarSoyInfo.java.
def _soy__camel(str):
last = '_'
result = ''
for ch in str:
if ch != '_':
if (last >= 'a' and last <= 'z') or (last >= 'A' and last <= 'Z'):
result += ch
else:
result += ch.upper()
last = ch
return result
def _soy__dirname(file):
return file[:file.rfind('/')+1]
def _soy__filename(file):
return file[file.rfind('/')+1:]
def _soy__gen_file_list_arg_as_file(out_name, targets, flag):
native.genrule(
name = out_name + '_gen',
srcs = targets,
outs = [out_name],
cmd = (("if [ -n \"$(SRCS)\" ] ; " +
"then echo -n '%s='$$(echo \"$(SRCS)\" | sed -e 's/ /,/g') > $@ ; " +
"fi ; " +
"touch $@") % flag), # touch the file, in case empty
visibility = ['//visibility:private'])
def _soy__GetJavaPackageForCurrentDirectory():
"""Returns the java package corresponding to the current directory."""
directory = PACKAGE_NAME
idx = directory.find('/com/google')
if idx == -1:
fail(
None,
'Unable to infer java package from directory [%s]' % (directory))
return '.'.join(directory[idx + 1:].split('/'))

View file

@ -0,0 +1,67 @@
# -*- mode:python; -*-
#
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utilities for compiling Closure Templates to JavaScript.
"""
load("//third_party/closure/compiler:closure_js_library.bzl",
"closure_js_library")
def closure_template_js_library(
name,
srcs,
deps = [],
testonly = 0,
visibility = None,
globals = None,
plugin_modules = [],
should_generate_js_doc = 1,
should_provide_require_soy_namespaces = 1,
should_generate_soy_msg_defs = 0,
soy_msgs_are_external = 0,
soycompilerbin = "//third_party/closure/templates:SoyToJsSrcCompiler"):
js_srcs = [src + ".js" for src in srcs]
cmd = ["$(location %s)" % soycompilerbin,
"--outputPathFormat='$(@D)/{INPUT_FILE_NAME}.js'"]
if soy_msgs_are_external:
cmd += ["--googMsgsAreExternal"]
if should_provide_require_soy_namespaces:
cmd += ["--shouldProvideRequireSoyNamespaces"]
if should_generate_soy_msg_defs:
cmd += "--shouldGenerateGoogMsgDefs"
if plugin_modules:
cmd += ["--pluginModules=%s" % ",".join(plugin_modules)]
cmd += ["$(location " + src + ")" for src in srcs]
if globals != None:
cmd += ["--compileTimeGlobalsFile='$(location %s)'" % globals]
srcs = srcs + [globals]
native.genrule(
name = name + "_soy_js",
srcs = srcs,
testonly = testonly,
visibility = visibility,
message = "Generating SOY v2 JS files",
outs = js_srcs,
tools = [soycompilerbin],
cmd = " ".join(cmd),
)
closure_js_library(
name = name,
srcs = js_srcs,
deps = deps + ["//third_party/closure/templates:soyutils_usegoog"],
)

26
third_party/closure/testing/BUILD vendored Normal file
View file

@ -0,0 +1,26 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
load("//third_party/closure/compiler:closure_js_check_test.bzl", "closure_js_check_test")
exports_files([
"phantomjs_jsunit_runner.js",
"phantomjs_runner.js",
])
closure_js_check_test(
name = "phantomjs_jsunit_runner_check",
srcs = ["phantomjs_jsunit_runner.js"],
pedantic = 1,
visibility = ["//visibility:private"],
deps = ["//third_party/closure/library"],
)
closure_js_check_test(
name = "phantomjs_runner_check",
srcs = ["phantomjs_runner.js"],
externs_list = ["externs/phantom.js"],
pedantic = 1,
visibility = ["//visibility:private"],
)

View file

@ -0,0 +1,116 @@
# -*- mode: python; -*-
#
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Build rule for running Closure Library JsUnit tests in PhantomJS.
"""
# XXX: It would be significantly faster and produce better stacktraces if we
# could avoid compilation by running in raw sources mode. This is not
# possible due to a resource loading bug in PhantomJS.
# https://github.com/ariya/phantomjs/issues/14028
load("//third_party/closure/compiler/private:defs.bzl",
"JS_HIDE_WARNING_ARGS",
"JS_LANGUAGE_DEFAULT",
"JS_LIBRARY_ATTRS",
"JS_PEDANTIC_ARGS",
"collect_js_srcs",
"determine_js_language")
def _impl(ctx):
srcs, externs = collect_js_srcs(ctx)
srcs += [ctx.file._phantomjs_jsunit_runner]
args = [
"--js_output_file=%s" % ctx.outputs.js.path,
"--language_in=%s" % determine_js_language(ctx),
"--language_out=ECMASCRIPT5_STRICT",
"--compilation_level=WHITESPACE_ONLY",
"--warning_level=VERBOSE",
"--dependency_mode=LOOSE",
"--formatting=PRETTY_PRINT",
"--new_type_inf",
"--debug",
]
if ctx.attr.pedantic:
args += JS_PEDANTIC_ARGS
args += JS_HIDE_WARNING_ARGS
args += ["--externs=%s" % extern.path for extern in externs]
args += ["--js=%s" % src.path for src in srcs]
ctx.action(
inputs=list(srcs) + list(externs),
outputs=[ctx.outputs.js],
executable=ctx.executable._compiler,
arguments=args,
mnemonic="JSCompile",
progress_message="Compiling %d JavaScript files to %s" % (
len(srcs) + len(externs), ctx.outputs.js.short_path))
ctx.file_action(
executable=True,
output=ctx.outputs.executable,
content="\n".join([
"#!/bin/sh",
"exec %s \\\n %s \\\n %s\n" % (
ctx.file._phantomjs.short_path,
ctx.file._phantomjs_runner.short_path,
ctx.outputs.js.short_path),
]))
return struct(
files=set([ctx.outputs.executable,
ctx.outputs.js]),
runfiles=ctx.runfiles(files=[ctx.file._phantomjs,
ctx.file._phantomjs_runner,
ctx.outputs.js],
collect_data=True))
_closure_js_test = rule(
test=True,
implementation=_impl,
attrs=JS_LIBRARY_ATTRS + {
"language": attr.string(default=JS_LANGUAGE_DEFAULT),
"pedantic": attr.bool(default=False),
"_compiler": attr.label(
default=Label("//third_party/closure/compiler"),
executable=True),
"_phantomjs": attr.label(
default=Label("//third_party/phantomjs"),
allow_files=True,
single_file=True),
"_phantomjs_runner": attr.label(
default=Label("//third_party/closure/testing:phantomjs_runner.js"),
allow_files=True,
single_file=True),
"_phantomjs_jsunit_runner": attr.label(
default=Label(
"//third_party/closure/testing:phantomjs_jsunit_runner.js"),
allow_files=True,
single_file=True),
},
outputs={"js": "%{name}_dbg.js"})
# XXX: In compiled mode, we're forced to compile each test file individually,
# because tests might have overlapping global symbols. We compile in
# WHITESPACE_ONLY mode because other modes would be unreasonably slow.
def closure_js_test(name, srcs, **kwargs):
if len(srcs) == 1:
_closure_js_test(name = name, srcs = srcs, **kwargs)
else:
tests = []
for src in srcs:
test = name + '_' + src.replace('_test.js', '').replace('-', '_')
tests += [test]
_closure_js_test(name = test, srcs = [src], **kwargs)
native.test_suite(name = name, tests = tests)

View file

@ -0,0 +1,282 @@
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview PhantomJS API definitions. We're only defining the parts of
* the API we plan on using. This file is necessary in order to have 100%
* strict type safety in {@code testrunner.js}.
* @externs
* @see http://phantomjs.org/api/
*/
/**
* Fake namespace for PhantomJS types.
*/
var phantomjs = {};
/**
* @constructor
* @final
* @see https://github.com/ariya/phantomjs/blob/master/examples/stdin-stdout-stderr.js
*/
phantomjs.File = function() {};
/**
* @param {string} text
* @const
*/
phantomjs.File.prototype.write = function(text) {};
/**
* @param {string} text
* @const
*/
phantomjs.File.prototype.writeLine = function(text) {};
/**
* @constructor
* @final
* @see http://phantomjs.org/api/system/
*/
phantomjs.System = function() {};
/**
* @type {!Array<string>}
* @const
*/
phantomjs.System.prototype.args;
/**
* @type {!phantomjs.File}
* @const
*/
phantomjs.System.prototype.stdout;
/**
* @type {!phantomjs.File}
* @const
*/
phantomjs.System.prototype.stderr;
/**
* @constructor
* @final
* @see http://phantomjs.org/api/fs/
*/
phantomjs.FileSystem = function() {};
/**
* @param {string} path
* @return {boolean}
*/
phantomjs.FileSystem.prototype.exists = function(path) {};
/**
* @param {string} path
* @return {string}
*/
phantomjs.FileSystem.prototype.read = function(path) {};
/**
* @constructor
* @final
*/
phantomjs.WebPage = function() {};
/**
* @return {!phantomjs.Page}
*/
phantomjs.WebPage.prototype.create = function() {};
/**
* @constructor
* @final
*/
phantomjs.PageSettings = function() {};
/**
* @type {number}
*/
phantomjs.PageSettings.prototype.resourceTimeout;
/**
* @constructor
* @final
*/
phantomjs.Page = function() {};
/**
* @param {string} url
* @param {function(string)=} opt_callback
*/
phantomjs.Page.prototype.open = function(url, opt_callback) {};
phantomjs.Page.prototype.close = function() {};
/**
* @param {function(): T} callback
* @return {T}
* @template T
*/
phantomjs.Page.prototype.evaluate = function(callback) {};
/**
* @type {!phantomjs.PageSettings}
* @const
*/
phantomjs.Page.prototype.settings;
/**
* @constructor
* @final
* @see http://phantomjs.org/api/webserver/
*/
phantomjs.Server = function() {};
/**
* @type {number}
*/
phantomjs.Server.prototype.port;
/**
* @param {number} port
* @param {function(!phantomjs.Server.Request,
* !phantomjs.Server.Response)} callback
*/
phantomjs.Server.prototype.listen = function(port, callback) {};
/**
* @constructor
* @final
* @see http://phantomjs.org/api/webserver/method/listen.html
*/
phantomjs.Server.Request = function() {};
/**
* @type {string}
* @const
*/
phantomjs.Server.Request.prototype.url;
/**
* @constructor
* @final
* @see http://phantomjs.org/api/webserver/method/listen.html
*/
phantomjs.Server.Response = function() {};
/**
* @param {string} encoding
*/
phantomjs.Server.Response.prototype.setEncoding = function(encoding) {};
/**
* @param {number} statusCode
* @param {!Object<string, string>=} opt_headers
*/
phantomjs.Server.Response.prototype.writeHead =
function(statusCode, opt_headers) {};
/**
* @param {string} data
*/
phantomjs.Server.Response.prototype.write = function(data) {};
phantomjs.Server.Response.prototype.close = function() {};
phantomjs.Server.Response.prototype.closeGracefully = function() {};
/**
* @constructor
* @final
* @see http://phantomjs.org/api/webserver/
*/
phantomjs.WebServer = function() {};
/**
* @return {!phantomjs.Server}
*/
phantomjs.WebServer.prototype.create = function() {};
/**
* @constructor
* @final
* @see http://phantomjs.org/api/phantom/
*/
phantomjs.Phantom = function() {};
/**
* @param {number=} opt_status
*/
phantomjs.Phantom.prototype.exit = function(opt_status) {};
/**
* @type {!phantomjs.Phantom}
* @const
*/
var phantom;
/**
* @param {string} name
* @return {?}
*/
function require(name) {}

View file

@ -0,0 +1,30 @@
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview PhantomJS test runner in-browser code. This file loads Closure
* testing libraries and then polls for test completion and then sends a
* message to PhantomJS letting it know it can exit.
*/
goog.require('goog.testing.jsunit');
(function() {
window.setInterval(function() {
if (window['G_testRunner'].isFinished()) {
window['callPhantom'](window['G_testRunner'].isSuccess());
}
}, 200);
})();

View file

@ -0,0 +1,285 @@
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* @fileoverview PhantomJS headless browser container for Closure unit tests.
* This program runs inside PhantomJS but not inside the browser itself. It
* starts an HTTP server that serves runfiles. It loads the generated test
* runner HTML file inside an ethereal browser. Once the page is loaded,
* this program communicates with the page to collect log data and monitor
* whether or not the tests succeeded.
*/
'use strict';
var /** !phantomjs.WebPage */ webpage = require('webpage');
var /** !phantomjs.FileSystem */ fs = require('fs');
var /** !phantomjs.WebServer */ webserver = require('webserver');
var /** !phantomjs.System */ system = require('system');
/**
* Location of virtual test page.
* @type {string}
* @const
*/
var VIRTUAL_PAGE = '/index.html';
/**
* Path under which runfiles are served.
* @type {string}
* @const
*/
var RUNFILES_PREFIX = '/filez/';
/**
* Full URL of virtual page.
* @type {string}
*/
var url;
/**
* HTML for virtual test page, hosted under {@code index.html}.
* @type {string}
*/
var virtualPageHtml;
/**
* Path of JS file to load.
* @type {string}
*/
var js;
/**
* PhantomJS page object.
* @type {!phantomjs.Page}
*/
var page = webpage.create();
/**
* Guesses Content-Type header for {@code path}
* @param {string} path
* @return {string}
*/
function guessContentType(path) {
switch (path.substr(path.lastIndexOf('.') + 1)) {
case 'js':
return 'application/javascript;charset=utf-8';
case 'html':
return 'text/html;charset=utf-8';
case 'css':
return 'text/css;charset=utf-8';
case 'txt':
return 'text/plain;charset=utf-8';
case 'xml':
return 'application/xml;charset=utf-8';
case 'gif':
return 'image/gif';
case 'png':
return 'image/png';
case 'jpg':
case 'jpeg':
return 'image/jpeg';
default:
return 'application/octet-stream';
}
}
/**
* Handles request from web browser.
* @param {!phantomjs.Server.Request} request
* @param {!phantomjs.Server.Response} response
*/
function onRequest(request, response) {
var path = request.url;
system.stderr.writeLine('Serving ' + path);
if (path == VIRTUAL_PAGE) {
response.writeHead(200, {
'Cache': 'no-cache',
'Content-Type': 'text/html;charset=utf-8'
});
response.write(virtualPageHtml);
response.closeGracefully();
} else if (path.indexOf(RUNFILES_PREFIX) == 0) {
path = path.substr(RUNFILES_PREFIX.length);
if (!fs.exists(path)) {
send404(request, response);
return;
}
var contentType = guessContentType(path);
if (contentType.indexOf('charset') != -1) {
response.setEncoding('binary');
}
response.writeHead(200, {
'Cache': 'no-cache',
'Content-Type': contentType
});
response.write(fs.read(path));
response.closeGracefully();
} else {
send404(request, response);
}
}
/**
* Sends a 404 Not Found response.
* @param {!phantomjs.Server.Request} request
* @param {!phantomjs.Server.Response} response
*/
function send404(request, response) {
system.stderr.writeLine('NOT FOUND ' + request.url);
response.writeHead(404, {
'Cache': 'no-cache',
'Content-Type': 'text/plain;charset=utf-8'
});
response.write('Not Found');
response.closeGracefully();
}
/**
* Extracts text from inside page.
* @return {string}
*/
function extractText() {
var element = document.getElementById('blah');
if (element != null) {
return element.innerText;
} else {
return '';
}
}
/**
* Callback when log entries are emitted inside the browser.
* @param {string} message
* @param {?string} line
* @param {?string} source
*/
function onConsoleMessage(message, line, source) {
message = message.replace(/\r?\n/, '\n-> ');
if (line && source) {
system.stderr.writeLine('-> ' + source + ':' + line + '] ' + message);
} else {
system.stderr.writeLine('-> ' + message);
}
}
/**
* Callback when headless web page is loaded.
* @param {string} status
*/
function onLoadFinished(status) {
if (status != 'success') {
system.stderr.writeLine('Load Failed');
phantom.exit(1);
return;
}
}
/**
* Callback when webpage shows an alert dialog.
* @param {string} message
*/
function onAlert(message) {
system.stderr.writeLine('Alert: ' + message);
}
/**
* Callback when headless web page throws an error.
* @param {string} message
* @param {!Array<{file: string,
* line: number,
* function: string}>} trace
*/
function onError(message, trace) {
system.stderr.writeLine(message);
trace.forEach(function(t) {
var msg = '> ';
if (t.function != '') {
msg += t.function + ' at ';
}
msg += t.file + ':' + t.line;
system.stderr.writeLine(msg);
});
page.close();
phantom.exit(1);
}
/**
* Callback when JavaScript inside page sends us a message.
* @param {boolean} succeeded
*/
function onCallback(succeeded) {
page.close();
if (succeeded) {
phantom.exit();
} else {
phantom.exit(1);
}
}
/**
* Runs a single pending test.
*/
function run() {
virtualPageHtml =
'<!doctype html>\n' +
'<meta charset="utf-8">' +
'<body>\n' +
'</body>\n' +
// These definitions are only necessary because we're compiling in
// WHITESPACE_ONLY mode.
'<script>\n' +
' var CLOSURE_NO_DEPS = true;\n' +
' var CLOSURE_UNCOMPILED_DEFINES = {\n' +
' "goog.ENABLE_DEBUG_LOADER": false\n' +
' };\n' +
'</script>\n' +
'<script src="' + RUNFILES_PREFIX + js + '"></script>\n';
page.onAlert = onAlert;
page.onCallback = onCallback;
page.onConsoleMessage = onConsoleMessage;
page.onError = onError;
page.onLoadFinished = onLoadFinished;
// XXX: If PhantomJS croaks, fail sooner rather than later.
// https://github.com/ariya/phantomjs/issues/10652
page.settings.resourceTimeout = 2000;
page.open(url);
}
(function() {
js = system.args[1];
var port = Math.floor(Math.random() * (60000 - 32768)) + 32768;
var server = webserver.create();
server.listen(port, onRequest);
url = 'http://localhost:' + port + VIRTUAL_PAGE;
system.stderr.writeLine('Listening ' + url);
run();
})();

11
third_party/java/apache_mina/BUILD vendored Normal file
View file

@ -0,0 +1,11 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "core",
exports = [
"@mina_core//jar",
"//third_party/java/slf4j_api",
],
)

11
third_party/java/apache_sshd/BUILD vendored Normal file
View file

@ -0,0 +1,11 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "apache_sshd",
exports = [
"@sshd_core//jar",
"//third_party/java/apache_mina:core",
],
)

77
third_party/java/appengine/BUILD vendored Normal file
View file

@ -0,0 +1,77 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache 2.0, BSD, MIT
java_library(
name = "appengine-api",
neverlink = 1,
exports = ["@appengine_api_sdk//jar"],
)
java_library(
name = "appengine-api-link",
exports = ["@appengine_api_sdk//jar"],
)
java_library(
name = "appengine-api-testonly",
testonly = 1,
exports = ["@appengine_api_sdk//jar"],
)
java_library(
name = "appengine-remote-api",
neverlink = 1,
exports = ["@appengine_remote_api//jar"],
)
java_library(
name = "appengine-remote-api-link",
exports = ["@appengine_remote_api//jar"],
)
java_library(
name = "appengine-remote-api-testonly",
testonly = 1,
exports = ["@appengine_remote_api//jar"],
)
java_library(
name = "appengine-api-labs",
neverlink = 1,
exports = ["@appengine_api_labs//jar"],
)
java_library(
name = "appengine-api-labs-link",
exports = ["@appengine_api_labs//jar"],
)
java_library(
name = "appengine-api-labs-testonly",
testonly = 1,
exports = ["@appengine_api_labs//jar"],
)
java_library(
name = "appengine-stubs",
testonly = 1,
exports = ["@appengine_api_stubs//jar"],
)
java_library(
name = "appengine-testing",
testonly = 1,
exports = [
"@appengine_testing//jar",
":appengine-api-labs-testonly",
":appengine-api-testonly",
":appengine-stubs",
],
)
java_library(
name = "appengine-integration-testing",
testonly = 1,
exports = ["@appengine_tools_sdk//jar"],
)

View file

@ -0,0 +1,14 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "appengine_gcs_client",
exports = [
"@appengine_gcs_client//jar",
"@google_api_client_appengine//jar",
"@google_api_services_storage//jar",
"@google_http_client_appengine//jar",
"@google_http_client_jackson2//jar",
],
)

View file

@ -0,0 +1,26 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "appengine_mapreduce",
exports = [
"@appengine_mapreduce//jar",
"@bazel_tools//third_party:guava",
"@bazel_tools//third_party:joda_time",
"@fastutil//jar",
"@google_api_client//jar",
"@google_api_client_appengine//jar",
"@google_api_services_bigquery//jar",
"@google_http_client_appengine//jar",
"@google_http_client_jackson2//jar",
"@jackson_core//jar",
"@jackson_databind//jar",
"@protobuf_java//jar",
"//third_party/java/appengine:appengine-api",
"//third_party/java/appengine_gcs_client",
"//third_party/java/appengine_pipeline",
"//third_party/java/charts4j",
"//third_party/java/servlet/servlet_api",
],
)

View file

@ -0,0 +1,15 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "appengine_pipeline",
exports = [
"@appengine_pipeline//jar",
"@bazel_tools//third_party:guava",
"@json//jar",
"//third_party/java/appengine:appengine-api",
"//third_party/java/appengine_gcs_client",
"//third_party/java/servlet/servlet_api",
],
)

61
third_party/java/auto/BUILD vendored Normal file
View file

@ -0,0 +1,61 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "auto_common",
exports = ["@auto_common//jar"],
)
java_library(
name = "auto_factory",
exported_plugins = [":auto_factory_plugin"],
exports = ["@auto_factory//jar"],
)
java_library(
name = "auto_service",
exported_plugins = [":auto_service_plugin"],
exports = ["@auto_service//jar"],
)
java_library(
name = "auto_value",
exported_plugins = [":auto_value_plugin"],
exports = ["@auto_value//jar"],
)
java_plugin(
name = "auto_factory_plugin",
processor_class = "com.google.auto.factory.processor.AutoFactoryProcessor",
visibility = ["//visibility:private"],
deps = [
"@auto_factory//jar",
"@bazel_tools//third_party:guava",
"@javawriter//jar",
":auto_common",
],
)
java_plugin(
name = "auto_service_plugin",
processor_class = "com.google.auto.service.processor.AutoServiceProcessor",
visibility = ["//visibility:private"],
deps = [
"@auto_service//jar",
"@bazel_tools//third_party:guava",
":auto_common",
],
)
java_plugin(
name = "auto_value_plugin",
processor_class = "com.google.auto.value.processor.AutoValueProcessor",
visibility = ["//visibility:private"],
deps = [
"@auto_value//jar",
"@bazel_tools//third_party:guava",
"@bazel_tools//third_party:jsr305",
":auto_common",
],
)

11
third_party/java/bouncycastle/BUILD vendored Normal file
View file

@ -0,0 +1,11 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # MIT, portions under other notice licenses
java_library(
name = "bouncycastle",
exports = [
"@bcprov_jdk15on//jar",
"//third_party/java/bouncycastle_bcpkix",
],
)

View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # MIT
java_library(
name = "bouncycastle_bcpg",
exports = ["@bcpg_jdk15on//jar"],
)

View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # MIT, portions under other notice licenses
java_library(
name = "bouncycastle_bcpkix",
exports = ["@bcpkix_jdk15on//jar"],
)

8
third_party/java/braintree/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # MIT
java_library(
name = "braintree",
exports = ["@braintree_java//jar"],
)

8
third_party/java/charts4j/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # MIT
java_library(
name = "charts4j",
exports = ["@charts4j//jar"],
)

49
third_party/java/dagger/BUILD vendored Normal file
View file

@ -0,0 +1,49 @@
licenses(["notice"]) # Apache License 2.0
java_library(
name = "dagger",
exported_plugins = [":component-codegen"],
visibility = ["//visibility:public"],
exports = [":dagger-runtime"],
)
java_library(
name = "dagger-runtime",
exports = [
"@bazel_tools//third_party:jsr330_inject",
"@dagger//jar",
],
)
java_library(
name = "dagger-producers",
exports = [
"@bazel_tools//third_party:guava",
"@bazel_tools//third_party:jsr330_inject",
"@dagger_producers//jar",
],
)
java_library(
name = "dagger-compiler",
exports = [
"@bazel_tools//third_party:auto_common",
"@bazel_tools//third_party:auto_service",
"@bazel_tools//third_party:auto_value",
"@bazel_tools//third_party:gson",
"@bazel_tools//third_party:guava",
"@bazel_tools//third_party:jsr305",
"@bazel_tools//third_party:jsr330_inject",
"@dagger_compiler//jar",
":dagger-producers",
":dagger-runtime",
"//third_party/java/google_java_format:lib",
"//third_party/java/javapoet",
],
)
java_plugin(
name = "component-codegen",
processor_class = "dagger.internal.codegen.ComponentProcessor",
deps = [":dagger-compiler"],
)

8
third_party/java/ftpserver/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "ftpserver",
exports = ["@ftpserver_core//jar"],
)

View file

@ -0,0 +1,12 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache 2.0, portions NCSA
java_library(
name = "lib",
exports = [
"@bazel_tools//third_party:guava",
"@eclipse_jdt_core//jar",
"@google_java_format//jar",
],
)

11
third_party/java/hamcrest/BUILD vendored Normal file
View file

@ -0,0 +1,11 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # BSD
java_library(
name = "hamcrest",
exports = [
"@hamcrest_core//jar",
"@hamcrest_library//jar",
],
)

8
third_party/java/icu4j/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # ICU License (old X License)
java_library(
name = "icu4j",
exports = ["@icu4j//jar"],
)

8
third_party/java/javapoet/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "javapoet",
exports = ["@javapoet//jar"],
)

19
third_party/java/jaxb/BUILD vendored Normal file
View file

@ -0,0 +1,19 @@
package(default_visibility = ["//visibility:public"])
licenses(["reciprocal"]) # CDDL 1.1 (also dual-licensed under GPL v2)
java_library(
name = "jaxb",
exports = ["@jaxb_api//jar"],
)
java_binary(
name = "jaxb-xjc",
main_class = "com.sun.tools.xjc.XJCFacade",
runtime_deps = [
"@jaxb_api//jar",
"@jaxb_core//jar",
"@jaxb_impl//jar",
"@jaxb_xjc//jar",
],
)

8
third_party/java/jcommander/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "jcommander",
exports = ["@jcommander//jar"],
)

13
third_party/java/jetty/v6_1_22/BUILD vendored Normal file
View file

@ -0,0 +1,13 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache 2.0
java_library(
name = "v6_1_22",
testonly = 1,
exports = [
"@jetty//jar",
"@jetty_util//jar",
"@servlet_api//jar",
],
)

8
third_party/java/joda_money/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "joda_money",
exports = ["@joda_money//jar"],
)

8
third_party/java/joda_time/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "joda_time",
exports = ["@bazel_tools//third_party:joda_time"],
)

8
third_party/java/jsch/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # BSD
java_library(
name = "jsch",
exports = ["//third_party/java/jsch/v0_1_44_google"],
)

View file

@ -0,0 +1,15 @@
package_group(
name = "specific_version",
packages = ["//third_party/java/jsch"],
)
package(default_visibility = [":specific_version"])
licenses(["notice"]) # BSD
java_import(
name = "v0_1_44_google",
jars = ["jsch-0.1.44_google.jar"],
srcjar = "jsch-0.1.44_google-src.jar",
deps = ["//third_party/java/jzlib"],
)

View file

@ -0,0 +1,30 @@
JSch 0.0.* was released under the GNU LGPL license. Later, we have switched
over to a BSD-style license.
------------------------------------------------------------------------------
Copyright (c) 2002-2010 Atsuhiko Yamanaka, JCraft,Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -0,0 +1,63 @@
Project URL: http://www.jcraft.com/jsch
URL: http://downloads.sourceforge.net/project/jsch/jsch/0.1.44/jsch-0.1.44.zip?use_mirror=cdnetworks-us-1
Version: 0.1.44
License: BSD
License File: LICENSE
Description:
JSCH is a library for making SSH and SFTP connections from Java.
Local Modifications:
Added three new features and one backport. Default behavior is preserved if
they aren't used.
* Define global ThreadFactory instance. This allows the library to be used on
App Engine, which doesn't allow apps to call `new Thread()`. To do this, you
must override `JSch.threadFactory` with something from GAE's ThreadManager.
Another global is also provided to disable calls to `Thread#setName` which
always crash on GAE, regardless of ThreadFactory.
Files edited:
* JSch.java - Defined new `threadFactory` and `useThreadNames` fields.
* Util.java - Updated thread creation code.
* ChannelDirectTCPIP.java - Updated thread creation code.
* ChannelSubsystem.java - Updated thread creation code.
* ChannelShell.java - Updated thread creation code.
* Session.java - Updated thread creation code.
* ChannelForwardedTCPIP.java - Updated thread creation code.
* ChannelExec.java - Updated thread creation code.
* Multiple pending requests with SFTP. Disabled by default. Call
SftpChannel.setMaxPendingRequests(n) with n > 1 to enable (64 is a reasonable
value). Can provide speed improvements of 10-20x if Periscope is disabled,
and approximately 7x if Periscope is enabled and write flushing is disabled.
Files edited:
* ChannelSftp.java - Added alternate methods (fastGet, fastRead) that use
new algorithm. If feature is enabled, the local window
size will be set to Integer.MAX_VALUE, since flow
control is already handled by SFTP, and some servers
don't work well with smaller windows.
* Disable flushing of writes. Flushing is enabled by default. Call
Session.setFlushingEnabled(false) before connecting to disable. Due to
Periscope latency, flushing must be disabled to take advantage of multiple
pending requests.
Files edited:
* Session.java - Added simple getter/setter for flushingEnabled boolean.
* IO.java - Added optional flushingEnabled constructor arg. Disabled
flushing when flushingEnabled is false.
* Added support for diffie-hellman-group14-sha1 key exchange algorithm to
maintain connections to servers using upgraded OpenSSL.
Files edited:
* JSch.java - Added diffie-hellman-group14-sha1 to kex config.
* DHG14.java - Added, patched from version 0.1.46.
* jce/DH.java - Modified to support DH groups >1024 bits by ignoring
JDK<8 exception and testing length of keys.

Binary file not shown.

Binary file not shown.

8
third_party/java/json/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # MIT-style license
java_library(
name = "json",
exports = ["@json//jar"],
)

8
third_party/java/json_simple/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "json_simple",
exports = ["@json_simple//jar"],
)

View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # BSD License
java_library(
name = "jsr305_annotations",
exports = ["@bazel_tools//third_party:jsr305"],
)

8
third_party/java/jsr330_inject/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache 2.0
java_library(
name = "jsr330_inject",
exports = ["@bazel_tools//third_party:jsr330_inject"],
)

9
third_party/java/junit/BUILD vendored Normal file
View file

@ -0,0 +1,9 @@
package(default_visibility = ["//visibility:public"])
licenses(["reciprocal"]) # Common Public License 1.0
java_library(
name = "junit",
testonly = 1,
exports = ["@bazel_tools//third_party:junit4"],
)

8
third_party/java/jzlib/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # BSD
java_library(
name = "jzlib",
exports = ["@jzlib//jar"],
)

9
third_party/java/mockito/BUILD vendored Normal file
View file

@ -0,0 +1,9 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # MIT
java_library(
name = "mockito",
testonly = 1,
exports = ["@bazel_tools//third_party:mockito"],
)

8
third_party/java/objectify/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # MIT/X11
java_library(
name = "objectify-v4_1",
exports = ["//third_party/java/objectify/v4_1"],
)

18
third_party/java/objectify/v4_1/BUILD vendored Normal file
View file

@ -0,0 +1,18 @@
package_group(
name = "specific_version",
packages = ["//third_party/java/objectify"],
)
package(default_visibility = [":specific_version"])
licenses(["notice"]) # MIT/X11
java_import(
name = "v4_1",
jars = ["objectify-4.1.3.jar"],
srcjar = "objectify-4.1.3-src.jar",
deps = [
"//third_party/java/appengine:appengine-api",
"//third_party/java/servlet/servlet_api",
],
)

22
third_party/java/objectify/v4_1/LICENSE vendored Normal file
View file

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2009-2013
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,39 @@
URL: https://github.com/objectify/objectify/archive/d6df0e3f291440c620c72be6650bf7fdafc8c1b2.zip
Version: d6df0e3f291440c620c72be6650bf7fdafc8c1b2 (4.1.3 with two google patches)
URL: http://central.maven.org/maven2/com/googlecode/objectify/objectify-gwt/1.0/objectify-gwt-1.0-sources.jar
Version: 1.0
License: MIT
License File: LICENSE
Description:
Objectify-Appengine is a thin Java wrapper around Google App Engine's
low-level datastore API that allows you to persist type-safe POJO objects.
It provides a human-friendly query interface, generified key, query, and
prepared query classes, GWT-able entity objects, and transactions in one
lightweight jar file with no dependencies.
NOTE: this library includes custom serializers for AppEngine classes in
com.google.appengine.api.* packages. This is necessary because serializers
are discovered by AppEngine using a naming pattern that requires that the
data and serializer classes be in the same package (similar to how the Java
Beans introspector finds BeanInfo classes).
In Objectify versions 4.1 and later, the GWT emulation classes were broken
out into a separate versioned jar. Since we are jarjar repackaging the
core Objectify library to include a version number in the package, we need
to include the GWT files in this folder and apply the same changes to them.
Maintainer Notes:
git clone https://github.com/objectify/objectify.git
git checkout -b v4 remotes/origin/v4
mvn package
# wait like literally an hour
cp target/objectify-4.1.3.jar $g3/third_party/java/objectify/v4_1
cp target/objectify-4.1.3-sources.jar $g3/third_party/java/objectify/v4_1/target/objectify-4.1.3-src.jar
MIT License file downloaded from license links at
https://code.google.com/p/objectify-appengine/
https://code.google.com/p/objectify-gwt/

Binary file not shown.

Binary file not shown.

8
third_party/java/qdox/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "qdox",
exports = ["@qdox//jar"],
)

View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache
java_library(
name = "servlet_api",
exports = ["@servlet_api//jar"],
)

8
third_party/java/slf4j_api/BUILD vendored Normal file
View file

@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
java_library(
name = "slf4j_api",
exports = ["@slf4j_api//jar"],
)

32
third_party/java/soy/BUILD vendored Normal file
View file

@ -0,0 +1,32 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "soy",
exports = [
"@aopalliance//jar",
"@asm//jar",
"@asm_analysis//jar",
"@asm_commons//jar",
"@asm_util//jar",
"@bazel_tools//third_party:guava",
"@bazel_tools//third_party:jsr305",
"@bazel_tools//third_party:jsr330_inject",
"@guice//jar",
"@guice_assistedinject//jar",
"@guice_multibindings//jar",
"@icu4j//jar",
"@soy//jar",
],
)
java_binary(
name = "SoyParseInfoGenerator",
jvm_flags = ["-client"],
main_class = "com.google.template.soy.SoyParseInfoGenerator",
runtime_deps = [
"@args4j//jar",
":soy",
],
)

9
third_party/java/truth/BUILD vendored Normal file
View file

@ -0,0 +1,9 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
java_library(
name = "truth",
testonly = 1,
exports = ["@bazel_tools//third_party:truth"],
)

15
third_party/javascript/closure/BUILD vendored Normal file
View file

@ -0,0 +1,15 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache License 2.0
load("//third_party/closure/compiler:closure_js_library.bzl", "closure_js_library")
closure_js_library(
name = "closure",
exports = ["//third_party/closure/library"],
)
filegroup(
name = "js_files_recursive",
srcs = ["@closure_library//:js_files"],
)

19
third_party/phantomjs/BUILD vendored Normal file
View file

@ -0,0 +1,19 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # BSD
genrule(
name = "phantomjs_bin",
srcs = ["@phantomjs//file"],
outs = ["phantomjs"],
cmd = " && ".join([
"IN=$$(pwd)/$(SRCS)",
"OUT=$$(pwd)/$@",
"TMP=$$(mktemp -d $${TMPDIR:-/tmp}/phantomjs.XXXXXXXX)",
"cd $$TMP",
"tar -xjf $$IN",
"cd phantomjs-*",
"mv bin/phantomjs $$OUT",
"rm -rf $$TMP",
]),
)