Skip to content

Extract common sample gradle config into shared file #971

@zach-klippenstein

Description

@zach-klippenstein

If you think this will be the same for all apps you could just extract it into a separate .gradle file and apply to demo apps.

Something like:

./buildscript/configure-sample-app.gradle

apply plugin: 'com.android.application'

android {
  defaultConfig {
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  }

  testOptions {
    animationsDisabled = true
  }
}

dependencies {
  androidTestImplementation deps.test.androidx.espresso.core
  androidTestImplementation deps.test.androidx.junitExt
  androidTestImplementation deps.test.androidx.uiautomator
}

and just apply that at the top:

apply from: rootProject.file('.buildscript/configure-sample-app.gradle')
apply plugin: 'kotlin-android'

android rootProject.ext.defaultAndroidConfig

android {
  defaultConfig {
......

Originally posted by @tehras in #966

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerskotlinAffects the Kotlin library.metaIssues about other issues, project config, CI, etc.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions