blob: 0af8cae6fafae167f4000e1a9ae554de102cd4ad [file] [log] [blame]
Shane3c6ed482022-07-28 14:28:10 -07001/*
2 * Copyright (C) 2022 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
17import androidx.build.AndroidXComposePlugin
18import androidx.build.LibraryType
19import androidx.build.Publish
20
21plugins {
22 id("AndroidXPlugin")
23 id("com.android.library")
24 id("AndroidXComposePlugin")
25}
26
27AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project)
28
29dependencies {
30 if(!AndroidXComposePlugin.isMultiplatformEnabled(project)) {
31 implementation(project(":compose:ui:ui"))
32 implementation(project(":compose:ui:ui-unit"))
33 implementation(project(":compose:ui:ui-util"))
34 implementation(project(":compose:foundation:foundation"))
35 implementation(project(":compose:foundation:foundation-layout"))
36
37 implementation(project(":constraintlayout:constraintlayout-core"))
38
Oscar Adame Vázquezed5f56e2022-09-29 16:38:34 -070039 androidTestImplementation(project(":compose:material:material"))
Shane3c6ed482022-07-28 14:28:10 -070040 androidTestImplementation(project(":compose:ui:ui-test"))
41 androidTestImplementation(project(":compose:ui:ui-test-junit4"))
Oscar Adame Vázquezed5f56e2022-09-29 16:38:34 -070042 androidTestImplementation(project(":compose:ui:ui-test-manifest"))
Shane3c6ed482022-07-28 14:28:10 -070043 androidTestImplementation(project(":activity:activity"))
44
Oscar Adame Vázquezed5f56e2022-09-29 16:38:34 -070045 androidTestImplementation(libs.kotlinTest)
Shane3c6ed482022-07-28 14:28:10 -070046 androidTestImplementation(libs.testRules)
47 androidTestImplementation(libs.testRunner)
48 androidTestImplementation(libs.junit)
49 }
50}
51
52if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
53 androidXComposeMultiplatform {
54 android()
55 desktop()
56 }
57
58 kotlin {
59 /*
60 * When updating dependencies, make sure to make the an an analogous update in the
61 * corresponding block above
62 */
63 sourceSets {
64 commonMain.dependencies {
65// implementation(libs.kotlinStdlibCommon)
66
67 implementation(project(":compose:ui:ui"))
68 implementation(project(":compose:ui:ui-unit"))
69 implementation(project(":compose:ui:ui-util"))
70 implementation(project(":compose:foundation:foundation"))
71 implementation(project(":compose:foundation:foundation-layout"))
72 implementation(project(":constraintlayout:constraintlayout-core"))
73
74 }
75
76 androidMain.dependencies {
77 api("androidx.annotation:annotation:1.1.0")
78 implementation("androidx.core:core-ktx:1.5.0")
79 }
80
81 desktopMain.dependencies {
82 implementation(libs.kotlinStdlib)
83 }
84
85 // TODO(b/214407011): These dependencies leak into instrumented tests as well. If you
86 // need to add Robolectric (which must be kept out of androidAndroidTest), use a top
87 // level dependencies block instead:
88 // `dependencies { testImplementation(libs.robolectric) }`
89 androidTest.dependencies {
90 implementation(libs.testRules)
91 implementation(libs.testRunner)
92 implementation(libs.junit)
93 }
94
95 androidAndroidTest.dependencies {
Oscar Adame Vázquezed5f56e2022-09-29 16:38:34 -070096 implementation(libs.kotlinTest)
Shane3c6ed482022-07-28 14:28:10 -070097 implementation(libs.testRules)
98 implementation(libs.testRunner)
99 implementation(libs.junit)
100 implementation(libs.truth)
101 implementation(project(":compose:foundation:foundation"))
Oscar Adame Vázquezed5f56e2022-09-29 16:38:34 -0700102 implementation(project(":compose:material:material"))
Shane3c6ed482022-07-28 14:28:10 -0700103 implementation(project(":compose:ui:ui-test-junit4"))
Oscar Adame Vázquezed5f56e2022-09-29 16:38:34 -0700104 implementation(project(":compose:ui:ui-test-manifest"))
Shane3c6ed482022-07-28 14:28:10 -0700105 implementation(project(":compose:test-utils"))
106 }
107 }
108 }
109}
110
111androidx {
112 name = "Android ConstraintLayout Compose Library"
113 type = LibraryType.PUBLISHED_LIBRARY
114 mavenVersion = LibraryVersions.CONSTRAINTLAYOUT_COMPOSE
115 mavenGroup = LibraryGroups.CONSTRAINTLAYOUT
116 inceptionYear = "2022"
117 description = "This library offers a flexible and adaptable way to position and animate widgets in Compose"
118}
119
120android {
121 namespace "androidx.constraintlayout.compose"
122}