blob: c57f8aba522d8340e43eb8a2a08f668058898708 [file] [log] [blame] [edit]
/*
* Copyright (C) 2025 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.
*/
import androidx.build.SoftwareType
import androidx.build.PlatformIdentifier
import androidx.build.KotlinTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
plugins {
id("AndroidXPlugin")
}
androidXMultiplatform {
androidLibrary {
namespace = "androidx.annotation.keep"
}
ios()
jvm()
linux()
mac()
mingwX64()
tvos()
watchos()
defaultPlatform(PlatformIdentifier.JVM)
sourceSets {
commonMain {
dependencies {
api(libs.kotlinStdlib)
}
}
// Workaround for https://youtrack.jetbrains.com/issue/KT-51763
// Make sure commonization runs before any compilation task.
tasks.withType(KotlinNativeCompile).configureEach {
it.dependsOn(tasks.named("commonize"))
}
}
}
androidx {
name = "Keep Annotation"
type = SoftwareType.SNAPSHOT_ONLY_LIBRARY_WITH_API_TASKS
mavenVersion = LibraryVersions.ANNOTATION_KEEP_QUARANTINE
kotlinTarget = KotlinTarget.KOTLIN_2_0
inceptionYear = "2025"
description = "Provides annotations to guide optimizers / code shrinkers."
}