diff options
author | Roma Modi <romam@google.com> | 2023-07-05 19:59:36 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-07-05 19:59:36 +0000 |
commit | 34e6849a7cc776110a4f1a91d8913364012a86bf (patch) | |
tree | 60465fc8b2528045ca9ec51f9e4ece68e91e7346 | |
parent | 1b0214e2b84ff7cdf7e0c317d30ee2709b39a244 (diff) | |
parent | 55326004983b66cfe21db60d7549b25f26c80907 (diff) | |
download | mockito-kotlin-34e6849a7cc776110a4f1a91d8913364012a86bf.tar.gz |
Add Android.bp and metadata files am: 3300121535 am: f59a530caf am: 7ae2cbb5c3 am: 5532600498
Original change: https://android-review.googlesource.com/c/platform/external/mockito-kotlin/+/2647761
Change-Id: If39883abe629f5daa0a6bfb6cb866b020869a8c6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | Android.bp | 58 | ||||
-rw-r--r-- | METADATA | 14 | ||||
-rw-r--r-- | MODULE_LICENSE_MIT | 0 | ||||
-rw-r--r-- | OWNERS | 2 | ||||
-rw-r--r-- | update_source.sh | 53 |
5 files changed, 127 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..9c7e088 --- /dev/null +++ b/Android.bp @@ -0,0 +1,58 @@ +// Copyright (C) 2023 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. +// +// + +package { + default_applicable_licenses: ["external_mockito_kotlin_license"], +} + +// Added automatically by a large-scale-change that took the approach of +// 'apply every license found to every target'. While this makes sure we respect +// every license restriction, it may not be entirely correct. +// +// e.g. GPL in an MIT project might only apply to the contrib/ directory. +// +// Please consider splitting the single license below into multiple licenses, +// taking care not to lose any license_kind information, and overriding the +// default license using the 'licenses: [...]' property on targets as needed. +// +// For unused files, consider creating a 'fileGroup' with "//visibility:private" +// to attach the license to, and including a comment whether the files may be +// used in the current project. +// See: http://go/android-license-faq +license { + name: "external_mockito_kotlin_license", + visibility: [":__subpackages__"], + license_kinds: [ + "SPDX-license-identifier-Apache-2.0", + "SPDX-license-identifier-MIT", + ], + license_text: [ + "LICENSE", + ], +} + +java_library_static { + // TODO (b/289573112): mockito-kotlin name is already in use by a WearOS prebuilt. + // Rename to mockito-kotlin once that prebuilt is removed. + name: "mockito-kotlin2", + hostdex: true, + srcs: ["mockito-kotlin/src/main/**/*.kt"], + + static_libs: ["mockito", "kotlinx_coroutines"], + + sdk_version: "module_current" +} + diff --git a/METADATA b/METADATA new file mode 100644 index 0000000..22433c5 --- /dev/null +++ b/METADATA @@ -0,0 +1,14 @@ +name: "mockito-kotlin" +description: + "Mockito for Kotlin" + +third_party { + url { + type: GIT + value: "https://github.com/mockito/mockito-kotlin" + } + version: “2.2.11” + last_upgrade_date { year: 2023 month: 6 day: 13 } + license_type: NOTICE +} + diff --git a/MODULE_LICENSE_MIT b/MODULE_LICENSE_MIT new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/MODULE_LICENSE_MIT @@ -0,0 +1,2 @@ +romam@google.com +farivar@google.com diff --git a/update_source.sh b/update_source.sh new file mode 100644 index 0000000..52848d2 --- /dev/null +++ b/update_source.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Copyright 2023 The Android Open Source Project. +# +# Retrieves the current mockito-kotlin source code into the current directory + +# Force stop on first error. +set -e + +if [ $# -ne 1 ]; then + echo "$0 <version>" >&2 + exit 1; +fi + +if [ -z "$ANDROID_BUILD_TOP" ]; then + echo "Missing environment variables. Did you run build/envsetup.sh and lunch?" >&2 + exit 1 +fi + +VERSION=${1} + +SOURCE="git://github.com/mockito/mockito-kotlin.git" +INCLUDE=" + LICENSE + mockito-kotlin/src/main + " + +working_dir="$(mktemp -d)" +trap "echo \"Removing temporary directory\"; rm -rf $working_dir" EXIT + +echo "Fetching mockito-kotlin source into $working_dir" +git clone $SOURCE $working_dir/source +(cd $working_dir/source; git checkout $VERSION) + +for include in ${INCLUDE}; do + echo "Updating $include" + rm -rf $include + mkdir -p $(dirname $include) + cp -R $working_dir/source/$include $include +done; + +echo "Done" + +# Update the version. +perl -pi -e "s|^Version: .*$|Version: ${VERSION}|" "README.version" + +# Remove any documentation about local modifications. +mv README.version README.tmp +grep -B 100 "Local Modifications" README.tmp > README.version +echo " None" >> README.version +rm README.tmp + +echo "Done" |