[go: nahoru, domu]

blob: 0cae782f73392568dc9556d6d27a473043322536 [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.0")
implementation("androidx.compose.material:material:1.0.0")
implementation("androidx.activity:activity-compose:1.3.0")
// 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(project(":lifecycle:lifecycle-viewmodel-compose"))
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.0")
implementation(project(":compose:material:material"))
implementation("androidx.activity:activity-compose:1.3.0")
// 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"))
// old version of common-java8 conflicts with newer version, because both have
// DefaultLifecycleEventObserver.
// Outside of androidx this is resolved via constraint added to lifecycle-common,
// but it doesn't work in androidx.
// See aosp/1804059
implementation("androidx.lifecycle:lifecycle-common-java8:2.5.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1")
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(project(":lifecycle:lifecycle-viewmodel-compose"))
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"
}