Shane | 3c6ed48 | 2022-07-28 14:28:10 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | import androidx.build.AndroidXComposePlugin |
| 18 | import androidx.build.LibraryType |
| 19 | import androidx.build.Publish |
| 20 | |
| 21 | plugins { |
| 22 | id("AndroidXPlugin") |
| 23 | id("com.android.library") |
| 24 | id("AndroidXComposePlugin") |
| 25 | } |
| 26 | |
| 27 | AndroidXComposePlugin.applyAndConfigureKotlinPlugin(project) |
| 28 | |
| 29 | dependencies { |
| 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ázquez | ed5f56e | 2022-09-29 16:38:34 -0700 | [diff] [blame^] | 39 | androidTestImplementation(project(":compose:material:material")) |
Shane | 3c6ed48 | 2022-07-28 14:28:10 -0700 | [diff] [blame] | 40 | androidTestImplementation(project(":compose:ui:ui-test")) |
| 41 | androidTestImplementation(project(":compose:ui:ui-test-junit4")) |
Oscar Adame Vázquez | ed5f56e | 2022-09-29 16:38:34 -0700 | [diff] [blame^] | 42 | androidTestImplementation(project(":compose:ui:ui-test-manifest")) |
Shane | 3c6ed48 | 2022-07-28 14:28:10 -0700 | [diff] [blame] | 43 | androidTestImplementation(project(":activity:activity")) |
| 44 | |
Oscar Adame Vázquez | ed5f56e | 2022-09-29 16:38:34 -0700 | [diff] [blame^] | 45 | androidTestImplementation(libs.kotlinTest) |
Shane | 3c6ed48 | 2022-07-28 14:28:10 -0700 | [diff] [blame] | 46 | androidTestImplementation(libs.testRules) |
| 47 | androidTestImplementation(libs.testRunner) |
| 48 | androidTestImplementation(libs.junit) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | if(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ázquez | ed5f56e | 2022-09-29 16:38:34 -0700 | [diff] [blame^] | 96 | implementation(libs.kotlinTest) |
Shane | 3c6ed48 | 2022-07-28 14:28:10 -0700 | [diff] [blame] | 97 | implementation(libs.testRules) |
| 98 | implementation(libs.testRunner) |
| 99 | implementation(libs.junit) |
| 100 | implementation(libs.truth) |
| 101 | implementation(project(":compose:foundation:foundation")) |
Oscar Adame Vázquez | ed5f56e | 2022-09-29 16:38:34 -0700 | [diff] [blame^] | 102 | implementation(project(":compose:material:material")) |
Shane | 3c6ed48 | 2022-07-28 14:28:10 -0700 | [diff] [blame] | 103 | implementation(project(":compose:ui:ui-test-junit4")) |
Oscar Adame Vázquez | ed5f56e | 2022-09-29 16:38:34 -0700 | [diff] [blame^] | 104 | implementation(project(":compose:ui:ui-test-manifest")) |
Shane | 3c6ed48 | 2022-07-28 14:28:10 -0700 | [diff] [blame] | 105 | implementation(project(":compose:test-utils")) |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | androidx { |
| 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 | |
| 120 | android { |
| 121 | namespace "androidx.constraintlayout.compose" |
| 122 | } |