bazel: Remove http_file trick for neverlink

The trick wasn't necessary, as any java_library can mark itself as
neverlink which applies to its dependencies.
This commit is contained in:
Eric Anderson 2018-05-15 10:57:03 -07:00
parent e520f46984
commit 989bc87dda
2 changed files with 7 additions and 10 deletions

View File

@ -291,12 +291,11 @@ def io_opencensus_grpc_metrics():
) )
def javax_annotation(): def javax_annotation():
# TODO(davido): maven_jar does not support neverlink attribute. # Use //stub:javax_annotation for neverlink=1 support.
# To circumvent use http_file following by java_import. native.maven_jar(
native.http_file( name = "javax_annotation_javax_annotation_api",
name = "javax_annotation_api", artifact = "javax.annotation:javax.annotation-api:1.2",
sha256 = "5909b396ca3a2be10d0eea32c74ef78d816e1b4ead21de1d78de1f890d033e04", sha1 = "479c1e06db31c432330183f5cae684163f186146",
urls = ["http://central.maven.org/maven2/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar"],
) )
def junit_junit(): def junit_junit():

View File

@ -14,11 +14,9 @@ java_library(
# javax.annotation.Generated is not included in the default root modules in 9, # javax.annotation.Generated is not included in the default root modules in 9,
# see: http://openjdk.java.net/jeps/320. # see: http://openjdk.java.net/jeps/320.
java_import( java_library(
name = "javax_annotation", name = "javax_annotation",
jars = [
"@javax_annotation_api//file",
],
neverlink = 1, # @Generated is source-retention neverlink = 1, # @Generated is source-retention
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
exports = ["@javax_annotation_javax_annotation_api//jar"],
) )