Currently, NetworkStaticLibTests tests the class files that are on the bootclasspath of the device. This makes running these tests slow and/or confusing, because the framework must be rebuilt and the device flashed before running the tests, and if this is not done, the old code will be tested instead. Instead, jarjar the tests so the test can be run without updating the device. Bug: 142892223 Test: atest NetworkStaticLibTests passes on device that does not have the library Change-Id: I6a0dbebddbd0b64e2722078345ffe6b0c0a1801e
72 lines
2.9 KiB
Text
72 lines
2.9 KiB
Text
// Copyright (C) 2019 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.
|
|
|
|
// 1. The "net-utils-framework-common" library is also compiled into the framework and placed on the
|
|
// boot classpath. It uses jarjar rules so that anything outside the framework can use this
|
|
// library directly.
|
|
// 2. The "net-utils-services-common" library is for use by modules and frameworks/base/services.
|
|
// It does not need to be jarjared because it is not placed on the bootclasspath.
|
|
// 3. The "net-utils-telephony-common-srcs" filegroup is for use specifically by telephony, which
|
|
// places many of its classes, even non-API service classes, on the boot classpath. Any file that
|
|
// is added to this filegroup *must* have a corresponding jarjar rule in the telephony jarjar
|
|
// rules file. Otherwise, it will end up on the boot classpath and other modules will not be able
|
|
// to provide their own copy.
|
|
|
|
filegroup {
|
|
name: "net-utils-framework-common-srcs",
|
|
srcs: ["src_frameworkcommon/**/*.java"],
|
|
visibility: ["//frameworks/base"],
|
|
}
|
|
|
|
java_library {
|
|
name: "net-utils-framework-common",
|
|
srcs: [":net-utils-framework-common-srcs"],
|
|
jarjar_rules: "jarjar-rules-shared.txt",
|
|
visibility: [
|
|
"//frameworks/base/packages/Tethering",
|
|
"//frameworks/opt/net/wifi",
|
|
"//frameworks/opt/net/ike",
|
|
"//frameworks/opt/telephony",
|
|
"//packages/modules/NetworkStack",
|
|
"//packages/modules/CaptivePortalLogin",
|
|
"//frameworks/libs/net/common/tests:__subpackages__",
|
|
]
|
|
}
|
|
|
|
java_library {
|
|
name: "net-utils-services-common",
|
|
srcs: ["src_servicescommon/**/*.java"],
|
|
visibility: [
|
|
"//frameworks/base/services",
|
|
"//frameworks/base/packages/Tethering",
|
|
"//frameworks/opt/net/wifi/service",
|
|
"//frameworks/opt/net/ike",
|
|
"//packages/modules/NetworkStack",
|
|
"//packages/modules/CaptivePortalLogin",
|
|
"//frameworks/libs/net/common/tests:__subpackages__",
|
|
],
|
|
}
|
|
|
|
// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be
|
|
// included either (some annotations would be duplicated on the bootclasspath).
|
|
filegroup {
|
|
name: "net-utils-telephony-common-srcs",
|
|
srcs: [
|
|
// Any class here *must* have a corresponding jarjar rule in the telephony build rules.
|
|
"src_servicescommon/android/net/NetworkFactory.java",
|
|
],
|
|
visibility: [
|
|
"//frameworks/opt/telephony",
|
|
],
|
|
}
|