Merge "Inline the single call of java_library2"

This commit is contained in:
David Ostrovsky
2020-01-28 14:37:27 +00:00
committed by Gerrit Code Review
2 changed files with 17 additions and 44 deletions

View File

@@ -1,5 +1,4 @@
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
load("//tools/bzl:java.bzl", "java_library2")
load("//tools/bzl:javadoc.bzl", "java_doc")
FUNCTION_SRCS = [
@@ -103,28 +102,30 @@ java_binary(
runtime_deps = DEPLOY_ENV,
)
java_library2(
exported_deps = [
":function",
"//lib:jgit-junit",
"//lib:jimfs",
"//lib:servlet-api",
"//lib/httpcomponents:fluent-hc",
"//lib/httpcomponents:httpclient",
"//lib/httpcomponents:httpcore",
"//lib/mockito",
"//lib/truth",
"//lib/truth:truth-java8-extension",
"//lib/greenmail",
] + TEST_DEPS
java_library(
name = "framework-lib",
testonly = True,
srcs = glob(
["**/*.java"],
exclude = FUNCTION_SRCS,
),
exported_deps = [
":function",
"//lib:jgit-junit",
"//lib:jimfs",
"//lib:servlet-api",
"//lib/httpcomponents:fluent-hc",
"//lib/httpcomponents:httpclient",
"//lib/httpcomponents:httpcore",
"//lib/mockito",
"//lib/truth",
"//lib/truth:truth-java8-extension",
"//lib/greenmail",
] + TEST_DEPS,
visibility = ["//visibility:public"],
deps = DEPLOY_ENV,
exports = exported_deps,
deps = DEPLOY_ENV + exported_deps,
)
java_library(

View File

@@ -1,28 +0,0 @@
# Copyright (C) 2016 The Android Open Source Project
#
# 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.
# Syntactic sugar for native java_library() rule:
# accept exported_deps attributes
load("@rules_java//java:defs.bzl", "java_library")
def java_library2(deps = [], exported_deps = [], exports = [], **kwargs):
if exported_deps:
deps = deps + exported_deps
exports = exports + exported_deps
java_library(
deps = deps,
exports = exports,
**kwargs
)