Skip to content

Commit

Permalink
Remove set default packages
Browse files Browse the repository at this point in the history
  • Loading branch information
TBSten committed Dec 23, 2024
1 parent 9edcdbe commit a396573
Showing 1 changed file with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ private fun setupGenerateComposePreviewRobolectricTestsTask(
robolectricConfig: MapProperty<String, String>,
testTaskProvider: TaskCollection<Test>
) {
configureComposePreviewRobolectricTestPackagesIfNeeded(project, extension)

val generateTestsTask = project.tasks.register(
"generate${variant.name.capitalize(Locale.ROOT)}ComposePreviewRobolectricTests",
GenerateComposePreviewRobolectricTestsTask::class.java
Expand Down Expand Up @@ -126,26 +124,6 @@ private fun setupGenerateComposePreviewRobolectricTestsTask(
}
}

private fun configureComposePreviewRobolectricTestPackagesIfNeeded(
project: Project,
extension: GenerateComposePreviewRobolectricTestsExtension,
) {
project.afterEvaluate {
extension.packages.getOrElse(listOf())
if(extension.enable.get() && extension.packages.get().orEmpty().isNotEmpty()) {
val android = project.extensions.findByType(CommonExtension::class.java)
android?.namespace?.let{

project.logger.warn(
"You may have forgotten to set roborazzi.generateComposePreviewRobolectricTests.packages. " +
"Roborazzi automatically set `android.namespace` (\"$it\") as the default value."
)
extension.packages.set(listOf(it))
}
}
}
}

abstract class GenerateComposePreviewRobolectricTestsTask : DefaultTask() {
@get:OutputDirectory
abstract val outputDir: DirectoryProperty
Expand Down

0 comments on commit a396573

Please sign in to comment.