Nick Rout | 8848d12 | 2021-09-10 12:17:28 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021 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 | |
| 18 | import androidx.build.BuildOnServerKt |
| 19 | import androidx.build.BuildServerConfigurationKt |
| 20 | import androidx.build.Publish |
| 21 | |
| 22 | plugins { |
| 23 | id("AndroidXPlugin") |
| 24 | id("com.android.application") |
| 25 | id("AndroidXComposePlugin") |
| 26 | id("org.jetbrains.kotlin.android") |
| 27 | } |
| 28 | |
| 29 | android { |
| 30 | defaultConfig { |
| 31 | applicationId "androidx.compose.material.catalog" |
Nick Rout | 1e410e9 | 2021-12-03 07:10:07 +0000 | [diff] [blame] | 32 | versionCode 2001 |
| 33 | versionName "2.0.1" |
Nick Rout | 8848d12 | 2021-09-10 12:17:28 +0200 | [diff] [blame] | 34 | } |
| 35 | buildTypes { |
| 36 | release { |
| 37 | minifyEnabled true |
| 38 | shrinkResources true |
| 39 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt') |
| 40 | } |
| 41 | } |
Aurimas Liutikas | dcfa035 | 2022-03-14 16:05:33 -0700 | [diff] [blame] | 42 | namespace "androidx.compose.material.catalog" |
Nick Rout | 8848d12 | 2021-09-10 12:17:28 +0200 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | dependencies { |
| 46 | kotlinPlugin project(":compose:compiler:compiler") |
| 47 | implementation(libs.kotlinStdlib) |
| 48 | implementation project(":compose:runtime:runtime") |
Alex Vanyo | f43d0a0 | 2022-02-07 22:10:33 +0000 | [diff] [blame] | 49 | implementation project(":compose:foundation:foundation-layout") |
Nick Rout | 8848d12 | 2021-09-10 12:17:28 +0200 | [diff] [blame] | 50 | implementation project(":compose:ui:ui") |
| 51 | implementation project(":compose:material:material") |
| 52 | implementation project(":compose:material3:material3") |
| 53 | implementation project(":compose:material:material:integration-tests:material-catalog") |
| 54 | implementation project(":compose:material3:material3:integration-tests:material3-catalog") |
| 55 | implementation "androidx.activity:activity-compose:1.3.1" |
| 56 | implementation project(":navigation:navigation-compose") |
Jeremy Woods | 84aea5a | 2021-12-08 10:37:29 -0800 | [diff] [blame] | 57 | // old version of common-java8 conflicts with newer version, because both have |
| 58 | // DefaultLifecycleEventObserver. |
| 59 | // Outside of androidx this is resolved via constraint added to lifecycle-common, |
| 60 | // but it doesn't work in androidx. |
| 61 | // See aosp/1804059 |
| 62 | implementation projectOrArtifact(":lifecycle:lifecycle-common-java8") |
Nick Rout | 8848d12 | 2021-09-10 12:17:28 +0200 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | // We want to publish a release APK of this project for the Compose Material Catalog |
| 66 | def copyReleaseApk = tasks.register("copyReleaseApk", Copy) { task -> |
| 67 | android.applicationVariants.all { variant -> |
| 68 | if (variant.buildType.name == "release") { |
| 69 | task.from(variant.packageApplicationProvider.get().outputDirectory) |
| 70 | } |
| 71 | } |
| 72 | task.include("*.apk") |
Aurimas Liutikas | b3dfc41 | 2021-09-24 10:18:28 -0700 | [diff] [blame] | 73 | String projectPath = project.path |
Nick Rout | 8848d12 | 2021-09-10 12:17:28 +0200 | [diff] [blame] | 74 | task.rename { fileName -> |
Aurimas Liutikas | b3dfc41 | 2021-09-24 10:18:28 -0700 | [diff] [blame] | 75 | "${projectPath.substring(1).replace(':', '-')}_$fileName" |
Nick Rout | 8848d12 | 2021-09-10 12:17:28 +0200 | [diff] [blame] | 76 | } |
| 77 | task.destinationDir = |
| 78 | new File(BuildServerConfigurationKt.getDistributionDirectory(project), "apks") |
Aurimas Liutikas | b3dfc41 | 2021-09-24 10:18:28 -0700 | [diff] [blame] | 79 | task.dependsOn(projectPath + ":assembleRelease") |
Nick Rout | 8848d12 | 2021-09-10 12:17:28 +0200 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | BuildOnServerKt.addToBuildOnServer(project, copyReleaseApk) |
| 83 | |
| 84 | androidx { |
| 85 | name = "Compose Material Catalog app" |
| 86 | publish = Publish.NONE |
| 87 | inceptionYear = "2021" |
| 88 | description = "This is a project for the Compose Material Catalog app." |
| 89 | } |