|
|
|
@ -19,10 +19,12 @@ package com.google.samples.apps.nowinandroid
|
|
|
|
|
import com.android.build.api.artifact.ScopedArtifact
|
|
|
|
|
import com.android.build.api.variant.AndroidComponentsExtension
|
|
|
|
|
import com.android.build.api.variant.ScopedArtifacts
|
|
|
|
|
import com.android.build.api.variant.SourceDirectories
|
|
|
|
|
import org.gradle.api.Project
|
|
|
|
|
import org.gradle.api.file.Directory
|
|
|
|
|
import org.gradle.api.file.RegularFile
|
|
|
|
|
import org.gradle.api.provider.ListProperty
|
|
|
|
|
import org.gradle.api.provider.Provider
|
|
|
|
|
import org.gradle.api.tasks.testing.Test
|
|
|
|
|
import org.gradle.kotlin.dsl.assign
|
|
|
|
|
import org.gradle.kotlin.dsl.configure
|
|
|
|
@ -88,11 +90,14 @@ internal fun Project.configureJacoco(
|
|
|
|
|
html.required = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: This is missing files in src/debug/, src/prod, src/demo, src/demoDebug...
|
|
|
|
|
fun SourceDirectories.Flat?.toFilePaths(): Provider<List<String>> = this
|
|
|
|
|
?.all
|
|
|
|
|
?.map { directories -> directories.map { it.asFile.path } }
|
|
|
|
|
?: provider { emptyList() }
|
|
|
|
|
sourceDirectories.setFrom(
|
|
|
|
|
files(
|
|
|
|
|
"$projectDir/src/main/java",
|
|
|
|
|
"$projectDir/src/main/kotlin",
|
|
|
|
|
variant.sources.java.toFilePaths(),
|
|
|
|
|
variant.sources.kotlin.toFilePaths()
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|