build.gradle 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. * https://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. plugins {
  17. id 'com.android.application'
  18. id 'kotlin-android'
  19. }
  20. android {
  21. compileSdkVersion 31
  22. defaultConfig {
  23. applicationId 'com.example.android.codelab.animation'
  24. minSdkVersion 21
  25. targetSdkVersion 31
  26. versionCode 1
  27. versionName '1.0'
  28. }
  29. compileOptions {
  30. sourceCompatibility JavaVersion.VERSION_1_8
  31. targetCompatibility JavaVersion.VERSION_1_8
  32. }
  33. buildFeatures {
  34. compose true
  35. }
  36. kotlinOptions {
  37. jvmTarget = '1.8'
  38. }
  39. composeOptions {
  40. kotlinCompilerExtensionVersion compose_version
  41. }
  42. }
  43. dependencies {
  44. implementation 'androidx.core:core-ktx:1.7.0'
  45. implementation "androidx.compose.ui:ui:$compose_version"
  46. implementation "androidx.compose.material:material:$compose_version"
  47. implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
  48. implementation 'androidx.activity:activity-compose:1.4.0'
  49. implementation "com.google.accompanist:accompanist-pager:0.23.1"
  50. debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
  51. }
  52. // Compiler flag to use experimental Compose APIs
  53. tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
  54. kotlinOptions {
  55. jvmTarget = "1.8"
  56. freeCompilerArgs += [
  57. "-Xopt-in=kotlin.RequiresOptIn"
  58. ]
  59. }
  60. }