in plugin/src/functionalTest/kotlin/com/android/gradle/replicator/BuildFeaturesTests.kt [526:602]
fun testDataBinding() {
val projectSetup = setup()
projectSetup.buildFile.appendText("""
android {
buildFeatures {
dataBinding = true
}
}
""".trimIndent())
projectSetup.runner.build()
// Verify the result
Truth.assertThat(projectSetup.projectDir.resolve("build/project-structure.json").readText()).isEqualTo("""
{
"gradle": "$GRADLE_VERSION",
"agp": "$AGP_VERSION",
"kotlin": "n/a",
"properties": [],
"rootModule": {
"path": ":",
"plugins": [
"com.android.application"
],
"javaSources": {
"fileCount": 0
},
"androidResources": {
"animator": [],
"anim": [],
"color": [],
"drawable": [],
"font": [],
"layout": [],
"menu": [],
"mipmap": [],
"navigation": [],
"raw": [],
"transition": [],
"values": [],
"xml": []
},
"javaResources": {},
"assets": {},
"dependencies": [
{
"library": "androidx.databinding:databinding-compiler:$AGP_VERSION",
"method": "annotationProcessor"
},
{
"library": "com.android.databinding:adapters:$AGP_VERSION",
"method": "api"
},
{
"library": "com.android.databinding:baseLibrary:$AGP_VERSION",
"method": "api"
},
{
"library": "com.android.databinding:library:$AGP_VERSION",
"method": "api"
}
],
"android": {
"compileSdkVersion": "android-30",
"minSdkVersion": 24,
"targetSdkVersion": 30,
"buildFeatures": {
"dataBinding": true
}
}
},
"modules": []
}
""".trimIndent())
}