Merge pull request #1662 from baksha97/patch-1

Fix TODO: Collect all java and kotlin source directories from the variant's source sets
pull/1238/merge
Don Turner 6 days ago committed by GitHub
commit 992054b35f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -19,10 +19,12 @@ package com.google.samples.apps.nowinandroid
import com.android.build.api.artifact.ScopedArtifact import com.android.build.api.artifact.ScopedArtifact
import com.android.build.api.variant.AndroidComponentsExtension import com.android.build.api.variant.AndroidComponentsExtension
import com.android.build.api.variant.ScopedArtifacts import com.android.build.api.variant.ScopedArtifacts
import com.android.build.api.variant.SourceDirectories
import org.gradle.api.Project import org.gradle.api.Project
import org.gradle.api.file.Directory import org.gradle.api.file.Directory
import org.gradle.api.file.RegularFile import org.gradle.api.file.RegularFile
import org.gradle.api.provider.ListProperty import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.testing.Test import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.assign import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.configure
@ -88,11 +90,14 @@ internal fun Project.configureJacoco(
html.required = true 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( sourceDirectories.setFrom(
files( files(
"$projectDir/src/main/java", variant.sources.java.toFilePaths(),
"$projectDir/src/main/kotlin", variant.sources.kotlin.toFilePaths()
), ),
) )

Loading…
Cancel
Save