[go: nahoru, domu]

blob: b755b7e254307ed6938923df396a8fd65ad09b87 [file] [log] [blame]
Nick Rout8848d122021-09-10 12:17:28 +02001/*
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
18import androidx.build.BuildOnServerKt
19import androidx.build.BuildServerConfigurationKt
20import androidx.build.Publish
21
22plugins {
23 id("AndroidXPlugin")
24 id("com.android.application")
25 id("AndroidXComposePlugin")
26 id("org.jetbrains.kotlin.android")
27}
28
29android {
30 defaultConfig {
31 applicationId "androidx.compose.material.catalog"
Nick Rout1e410e92021-12-03 07:10:07 +000032 versionCode 2001
33 versionName "2.0.1"
Nick Rout8848d122021-09-10 12:17:28 +020034 }
35 buildTypes {
36 release {
37 minifyEnabled true
38 shrinkResources true
39 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
40 }
41 }
Aurimas Liutikasdcfa0352022-03-14 16:05:33 -070042 namespace "androidx.compose.material.catalog"
Nick Rout8848d122021-09-10 12:17:28 +020043}
44
45dependencies {
46 kotlinPlugin project(":compose:compiler:compiler")
47 implementation(libs.kotlinStdlib)
48 implementation project(":compose:runtime:runtime")
Alex Vanyof43d0a02022-02-07 22:10:33 +000049 implementation project(":compose:foundation:foundation-layout")
Nick Rout8848d122021-09-10 12:17:28 +020050 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 Woods84aea5a2021-12-08 10:37:29 -080057 // 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 Rout8848d122021-09-10 12:17:28 +020063}
64
65// We want to publish a release APK of this project for the Compose Material Catalog
66def 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 Liutikasb3dfc412021-09-24 10:18:28 -070073 String projectPath = project.path
Nick Rout8848d122021-09-10 12:17:28 +020074 task.rename { fileName ->
Aurimas Liutikasb3dfc412021-09-24 10:18:28 -070075 "${projectPath.substring(1).replace(':', '-')}_$fileName"
Nick Rout8848d122021-09-10 12:17:28 +020076 }
77 task.destinationDir =
78 new File(BuildServerConfigurationKt.getDistributionDirectory(project), "apks")
Aurimas Liutikasb3dfc412021-09-24 10:18:28 -070079 task.dependsOn(projectPath + ":assembleRelease")
Nick Rout8848d122021-09-10 12:17:28 +020080}
81
82BuildOnServerKt.addToBuildOnServer(project, copyReleaseApk)
83
84androidx {
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}