blob: f7317d764c625eb112ded71f88ff76628a74c04c [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("AndroidXComposePlugin")
id("com.android.library")
}
AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project)
dependencies {
if(!AndroidXComposePlugin.isMultiplatformEnabled(project)) {
/*
* When updating dependencies, make sure to make the an an analogous update in the
* corresponding block below
*/
api(libs.kotlinCoroutinesAndroid)
implementation("androidx.annotation:annotation:1.1.0")
implementation(libs.kotlinStdlib)
testImplementation(libs.kotlinTestJunit)
testImplementation(libs.junit)
testImplementation(libs.robolectric)
testImplementation(libs.kotlinCoroutinesTest)
androidTestImplementation(libs.kotlinTestJunit)
androidTestImplementation(libs.testExtJunit)
androidTestImplementation(libs.testRules)
androidTestImplementation(libs.testRunner)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
lintChecks(projectOrArtifact(":compose:runtime:runtime-lint"))
lintPublish(projectOrArtifact(":compose:runtime:runtime-lint"))
samples(projectOrArtifact(":compose:runtime:runtime:runtime-samples"))
}
}
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)
implementation(libs.kotlinCoroutinesCore)
}
jvmMain.dependencies {
implementation(libs.kotlinStdlib)
api(libs.kotlinCoroutinesCore)
}
androidMain {
dependencies {
api(libs.kotlinCoroutinesAndroid)
api("androidx.annotation:annotation:1.1.0")
}
}
commonTest.dependencies {
implementation kotlin("test")
implementation(libs.kotlinCoroutinesTest)
}
androidAndroidTest {
dependsOn(jvmTest)
dependencies {
implementation(libs.testExtJunit)
implementation(libs.testRules)
implementation(libs.testRunner)
implementation(libs.truth)
}
}
}
}
dependencies {
samples(projectOrArtifact(":compose:runtime:runtime:runtime-samples"))
}
}
android {
defaultConfig {
consumerProguardFiles 'proguard-rules.pro'
}
namespace "androidx.compose.runtime"
}
androidx {
name = "Compose Runtime"
type = LibraryType.PUBLISHED_LIBRARY
inceptionYear = "2019"
description = "Tree composition support for code generated by the Compose compiler plugin and corresponding public API"
legacyDisableKotlinStrictApiMode = true
}