diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2019-01-15 22:44:21 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-01-15 22:44:21 +0000 |
commit | 0081b3831bc21e8be51a702f1cf6126322cd806d (patch) | |
tree | e419f19a50b711c1a7bc2c9903551024673b8d8f | |
parent | 04134edaaf1946214075f21e92b9a87d5f223c76 (diff) | |
parent | aa26752117cfc761db77134840f3175d4a2816da (diff) | |
download | ContactsProvider-0081b3831bc21e8be51a702f1cf6126322cd806d.tar.gz |
Merge "Convert Android.mk file to Android.bp"
-rw-r--r-- | Android.bp | 31 | ||||
-rw-r--r-- | Android.mk | 32 | ||||
-rw-r--r-- | test_common/Android.bp | 23 | ||||
-rw-r--r-- | test_common/Android.mk | 31 | ||||
-rw-r--r-- | tests/Android.bp | 22 | ||||
-rw-r--r-- | tests/Android.mk | 26 | ||||
-rw-r--r-- | tests2/Android.bp | 36 | ||||
-rw-r--r-- | tests2/Android.mk | 40 |
8 files changed, 112 insertions, 129 deletions
diff --git a/Android.bp b/Android.bp new file mode 100644 index 00000000..ff83b8f4 --- /dev/null +++ b/Android.bp @@ -0,0 +1,31 @@ +android_app { + name: "ContactsProvider", + // Only compile source java files in this apk. + srcs: [ + "src/**/*.java", + "src/com/android/providers/contacts/EventLogTags.logtags", + ], + libs: [ + "ext", + "telephony-common", + ], + static_libs: [ + "android-common", + "com.android.vcard", + "guava", + ], + // The Jacoco tool analyzes code coverage when running unit tests on the + // application. This configuration line selects which packages will be analyzed, + // leaving out code which is tested by other means (e.g. static libraries) that + // would dilute the coverage results. These options do not affect regular + // production builds. + jacoco: { + include_filter: ["com.android.providers.contacts.*"], + }, + platform_apis: true, + certificate: "shared", + privileged: true, + optimize: { + proguard_flags_files: ["proguard.flags"], + }, +} diff --git a/Android.mk b/Android.mk deleted file mode 100644 index d31ad73d..00000000 --- a/Android.mk +++ /dev/null @@ -1,32 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := optional - -# Only compile source java files in this apk. -LOCAL_SRC_FILES := $(call all-java-files-under, src) -LOCAL_SRC_FILES += \ - src/com/android/providers/contacts/EventLogTags.logtags - -LOCAL_JAVA_LIBRARIES := ext telephony-common - -LOCAL_STATIC_JAVA_LIBRARIES += android-common com.android.vcard guava - -# The Jacoco tool analyzes code coverage when running unit tests on the -# application. This configuration line selects which packages will be analyzed, -# leaving out code which is tested by other means (e.g. static libraries) that -# would dilute the coverage results. These options do not affect regular -# production builds. -LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.providers.contacts.* - -LOCAL_PACKAGE_NAME := ContactsProvider -LOCAL_PRIVATE_PLATFORM_APIS := true -LOCAL_CERTIFICATE := shared -LOCAL_PRIVILEGED_MODULE := true - -LOCAL_PROGUARD_FLAG_FILES := proguard.flags - -include $(BUILD_PACKAGE) - -# Use the following include to make our test apk. -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/test_common/Android.bp b/test_common/Android.bp new file mode 100644 index 00000000..db2e7090 --- /dev/null +++ b/test_common/Android.bp @@ -0,0 +1,23 @@ +// 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. + +java_library { + name: "ContactsProviderTestUtils", + srcs: ["src/**/*.java"], + libs: [ + "android.test.runner", + "android-support-test", + "mockito-target-minus-junit4", + ], +} diff --git a/test_common/Android.mk b/test_common/Android.mk deleted file mode 100644 index 2965f8a0..00000000 --- a/test_common/Android.mk +++ /dev/null @@ -1,31 +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. - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - $(call all-java-files-under, src) - -LOCAL_JAVA_LIBRARIES := \ - android.test.runner \ - android-support-test \ - mockito-target-minus-junit4 - -LOCAL_MODULE_TAGS := optional - -LOCAL_MODULE := ContactsProviderTestUtils - -include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/tests/Android.bp b/tests/Android.bp new file mode 100644 index 00000000..c687b635 --- /dev/null +++ b/tests/Android.bp @@ -0,0 +1,22 @@ +android_test { + name: "ContactsProviderTests", + static_libs: [ + "ContactsProviderTestUtils", + "android-support-test", + "mockito-target-minus-junit4", + ], + libs: [ + "android.test.runner", + "android.test.base", + "android.test.mock", + ], + // Only compile source java files in this apk. + srcs: ["src/**/*.java"], + platform_apis: true, + test_suites: ["device-tests"], + instrumentation_for: "ContactsProvider", + certificate: "shared", + optimize: { + enabled: false, + }, +} diff --git a/tests/Android.mk b/tests/Android.mk deleted file mode 100644 index 02ea81e9..00000000 --- a/tests/Android.mk +++ /dev/null @@ -1,26 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -# We only want this apk build for tests. -LOCAL_MODULE_TAGS := tests - -LOCAL_STATIC_JAVA_LIBRARIES := \ - ContactsProviderTestUtils \ - android-support-test \ - mockito-target-minus-junit4 - -LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base android.test.mock - -# Only compile source java files in this apk. -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := ContactsProviderTests -LOCAL_PRIVATE_PLATFORM_APIS := true -LOCAL_COMPATIBILITY_SUITE := device-tests - -LOCAL_INSTRUMENTATION_FOR := ContactsProvider -LOCAL_CERTIFICATE := shared - -LOCAL_PROGUARD_ENABLED := disabled - -include $(BUILD_PACKAGE) diff --git a/tests2/Android.bp b/tests2/Android.bp new file mode 100644 index 00000000..b214ac07 --- /dev/null +++ b/tests2/Android.bp @@ -0,0 +1,36 @@ +// +// 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. +// + +android_test { + name: "ContactsProviderTests2", + static_libs: [ + "ContactsProviderTestUtils", + "android-support-test", + "mockito-target-minus-junit4", + ], + libs: [ + "android.test.runner", + "android.test.base", + ], + srcs: ["src/**/*.java"], + platform_apis: true, + test_suites: ["device-tests"], + instrumentation_for: "ContactsProvider", + certificate: "shared", + optimize: { + enabled: false, + }, +} diff --git a/tests2/Android.mk b/tests2/Android.mk deleted file mode 100644 index 4ba0a12f..00000000 --- a/tests2/Android.mk +++ /dev/null @@ -1,40 +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. -# - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_STATIC_JAVA_LIBRARIES := \ - ContactsProviderTestUtils \ - android-support-test \ - mockito-target-minus-junit4 - -LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base - -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := ContactsProviderTests2 -LOCAL_PRIVATE_PLATFORM_APIS := true -LOCAL_COMPATIBILITY_SUITE := device-tests - -LOCAL_INSTRUMENTATION_FOR := ContactsProvider -LOCAL_CERTIFICATE := shared - -LOCAL_PROGUARD_ENABLED := disabled - -include $(BUILD_PACKAGE) |