• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.tools.metalava
18 
19 const val JAVA_LANG_PREFIX = "java.lang."
20 const val JAVA_LANG_OBJECT = "java.lang.Object"
21 const val JAVA_LANG_STRING = "java.lang.String"
22 const val JAVA_LANG_ENUM = "java.lang.Enum"
23 const val JAVA_LANG_THROWABLE = "java.lang.Throwable"
24 const val JAVA_LANG_ANNOTATION = "java.lang.annotation.Annotation"
25 const val JAVA_LANG_DEPRECATED = "java.lang.Deprecated"
26 const val ORG_JETBRAINS_ANNOTATIONS_PREFIX = "org.jetbrains.annotations."
27 const val ORG_INTELLIJ_LANG_ANNOTATIONS_PREFIX = "org.intellij.lang.annotations."
28 const val ANDROID_ANNOTATION_PREFIX = "android.annotation."
29 const val ANDROIDX_ANNOTATION_PREFIX = "androidx.annotation."
30 const val ANDROIDX_NONNULL = "androidx.annotation.NonNull"
31 const val ANDROIDX_NULLABLE = "androidx.annotation.Nullable"
32 const val ANDROID_SYSTEM_API = "android.annotation.SystemApi"
33 const val ANDROID_REQUIRES_PERMISSION = "android.annotation.RequiresPermission"
34 const val ANDROID_DEPRECATED_FOR_SDK = "android.annotation.DeprecatedForSdk"
35 const val RECENTLY_NULLABLE = "androidx.annotation.RecentlyNullable"
36 const val RECENTLY_NONNULL = "androidx.annotation.RecentlyNonNull"
37 const val ANDROID_NULLABLE = "android.annotation.Nullable"
38 const val ANDROID_NONNULL = "android.annotation.NonNull"
39 const val ANDROID_SDK_CONSTANT = "android.annotation.SdkConstant"
40 const val ANDROIDX_VISIBLE_FOR_TESTING = "androidx.annotation.VisibleForTesting"
41 const val ATTR_OTHERWISE = "otherwise"
42 const val ATTR_ALLOW_IN = "allowIn"
43 const val CARRIER_PRIVILEGES_MARKER = "carrier privileges"
44 
45 const val ANDROID_SUPPRESS_LINT = "android.annotation.SuppressLint"
46 const val JAVA_LANG_SUPPRESS_WARNINGS = "java.lang.SuppressWarnings"
47 const val KOTLIN_SUPPRESS = "kotlin.Suppress"
48 
49 const val ENV_VAR_METALAVA_TESTS_RUNNING = "METALAVA_TESTS_RUNNING"
50 const val ENV_VAR_METALAVA_DUMP_ARGV = "METALAVA_DUMP_ARGV"
51 const val ENV_VAR_METALAVA_PREPEND_ARGS = "METALAVA_PREPEND_ARGS"
52 const val ENV_VAR_METALAVA_APPEND_ARGS = "METALAVA_APPEND_ARGS"
53 
54 const val JAVA_RETENTION = "java.lang.annotation.Retention"
55 const val KT_RETENTION = "kotlin.annotation.Retention"
56 
isRetentionnull57 fun isRetention(qualifiedName: String?): Boolean =
58     JAVA_RETENTION == qualifiedName || KT_RETENTION == qualifiedName
59