blob: 507d5fcf9dc1437a6722f159143592646846a01e [file] [log] [blame]
/*
* Copyright 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.
*/
import androidx.build.AndroidXComposePlugin
import androidx.build.LibraryType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("AndroidXPlugin")
id("com.android.library")
id("AndroidXComposePlugin")
}
AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project)
dependencies {
if(!AndroidXComposePlugin.isMultiplatformEnabled(project)) {
implementation(libs.kotlinStdlib)
api("androidx.annotation:annotation:1.1.0")
implementation(project(":compose:animation:animation"))
api("androidx.compose.runtime:runtime:1.2.1")
api(project(":compose:ui:ui"))
api(project(":compose:ui:ui-tooling-preview"))
api(project(":compose:ui:ui-tooling-data"))
implementation("androidx.savedstate:savedstate-ktx:1.2.1")
implementation("androidx.compose.material:material:1.0.0")
implementation("androidx.activity:activity-compose:1.7.0")
implementation("androidx.lifecycle:lifecycle-common:2.6.1")
// kotlin-reflect and animation-tooling-internal are provided by Studio at runtime
compileOnly(project(":compose:animation:animation-tooling-internal"))
compileOnly(libs.kotlinReflect)
androidTestImplementation(project(":compose:ui:ui-test-junit4"))
androidTestImplementation(libs.junit)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.testRules)
androidTestImplementation(project(":compose:foundation:foundation-layout"))
androidTestImplementation(project(":compose:foundation:foundation"))
androidTestImplementation(project(":compose:test-utils"))
androidTestImplementation(libs.truth)
androidTestImplementation(libs.kotlinReflect)
androidTestImplementation(project(":compose:animation:animation-tooling-internal"))
androidTestImplementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
androidTestImplementation(project(":compose:runtime:runtime-livedata"))
}
}
if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
androidXComposeMultiplatform {
android()
desktop()
}
kotlin {
/*
* When updating dependencies, make sure to make the an an analogous update in the
* corresponding block above
*/
sourceSets {
commonMain.dependencies {
implementation(libs.kotlinStdlibCommon)
api(project(":compose:ui:ui-tooling-preview"))
api(project(":compose:runtime:runtime"))
api(project(":compose:ui:ui"))
api(project(":compose:ui:ui-tooling-data"))
}
androidMain.dependencies {
api("androidx.annotation:annotation:1.1.0")
implementation(project(":compose:animation:animation"))
implementation("androidx.savedstate:savedstate-ktx:1.2.1")
implementation(project(":compose:material:material"))
implementation("androidx.activity:activity-compose:1.7.0")
implementation("androidx.lifecycle:lifecycle-common:2.6.1")
// kotlin-reflect and tooling-animation-internal are provided by Studio at runtime
compileOnly(project(":compose:animation:animation-tooling-internal"))
compileOnly(libs.kotlinReflect)
}
desktopMain.dependencies {
implementation(libs.kotlinStdlib)
implementation(project(":compose:runtime:runtime"))
implementation(project(":compose:ui:ui"))
}
androidAndroidTest.dependencies {
implementation(project(":compose:ui:ui-test-junit4"))
implementation(libs.junit)
implementation(libs.testRunner)
implementation(libs.testRules)
implementation(project(":compose:foundation:foundation-layout"))
implementation(project(":compose:foundation:foundation"))
implementation(project(":compose:test-utils"))
implementation(libs.truth)
implementation(libs.kotlinReflect)
implementation(project(":compose:animation:animation-tooling-internal"))
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
implementation(project(":compose:runtime:runtime-livedata"))
}
}
}
}
androidx {
name = "Compose Tooling"
type = LibraryType.PUBLISHED_LIBRARY
inceptionYear = "2019"
description = "Compose tooling library. This library exposes information to our tools for better IDE support."
legacyDisableKotlinStrictApiMode = true
}
android {
namespace "androidx.compose.ui.tooling"
}