blob: b48e45344aaa240f4bd2c4a61f9ee29efefcb227 [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
39 androidTestImplementation(project(":compose:ui:ui-test"))
40 androidTestImplementation(project(":compose:ui:ui-test-junit4"))
41 androidTestImplementation(project(":activity:activity"))
42
43 androidTestImplementation(libs.testRules)
44 androidTestImplementation(libs.testRunner)
45 androidTestImplementation(libs.junit)
46 }
47}
48
49if(AndroidXComposePlugin.isMultiplatformEnabled(project)) {
50 androidXComposeMultiplatform {
51 android()
52 desktop()
53 }
54
55 kotlin {
56 /*
57 * When updating dependencies, make sure to make the an an analogous update in the
58 * corresponding block above
59 */
60 sourceSets {
61 commonMain.dependencies {
62// implementation(libs.kotlinStdlibCommon)
63
64 implementation(project(":compose:ui:ui"))
65 implementation(project(":compose:ui:ui-unit"))
66 implementation(project(":compose:ui:ui-util"))
67 implementation(project(":compose:foundation:foundation"))
68 implementation(project(":compose:foundation:foundation-layout"))
69 implementation(project(":constraintlayout:constraintlayout-core"))
70
71 }
72
73 androidMain.dependencies {
74 api("androidx.annotation:annotation:1.1.0")
75 implementation("androidx.core:core-ktx:1.5.0")
76 }
77
78 desktopMain.dependencies {
79 implementation(libs.kotlinStdlib)
80 }
81
82 // TODO(b/214407011): These dependencies leak into instrumented tests as well. If you
83 // need to add Robolectric (which must be kept out of androidAndroidTest), use a top
84 // level dependencies block instead:
85 // `dependencies { testImplementation(libs.robolectric) }`
86 androidTest.dependencies {
87 implementation(libs.testRules)
88 implementation(libs.testRunner)
89 implementation(libs.junit)
90 }
91
92 androidAndroidTest.dependencies {
93 implementation(libs.testRules)
94 implementation(libs.testRunner)
95 implementation(libs.junit)
96 implementation(libs.truth)
97 implementation(project(":compose:foundation:foundation"))
98 implementation(project(":compose:ui:ui-test-junit4"))
99 implementation(project(":compose:test-utils"))
100 }
101 }
102 }
103}
104
105androidx {
106 name = "Android ConstraintLayout Compose Library"
107 type = LibraryType.PUBLISHED_LIBRARY
108 mavenVersion = LibraryVersions.CONSTRAINTLAYOUT_COMPOSE
109 mavenGroup = LibraryGroups.CONSTRAINTLAYOUT
110 inceptionYear = "2022"
111 description = "This library offers a flexible and adaptable way to position and animate widgets in Compose"
112}
113
114android {
115 namespace "androidx.constraintlayout.compose"
116}