Skip to content

Commit

Permalink
Don't create publishing tasks for unregistered instances
Browse files Browse the repository at this point in the history
  • Loading branch information
cosic committed Oct 26, 2024
1 parent 31d203c commit a3d91a0
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ class RustorePublishPlugin : Plugin<Project> {
variant: ApplicationVariant,
rustorePublishExtension: RustorePublishExtension,
) {
val variantName = variant.name.capitalize()
val publishTaskName = "${RustorePublishTask.TASK_NAME}$variantName"
val publishTask = project.tasks.register<RustorePublishTask>(publishTaskName, variant)
val extension = rustorePublishExtension.instances.find { it.name.equals(variant.name, ignoreCase = true) }
if (extension != null) {
val variantName = variant.name.capitalize()
val publishTaskName = "${RustorePublishTask.TASK_NAME}$variantName"
val publishTask = project.tasks.register<RustorePublishTask>(publishTaskName, variant)

scheduleTasksOrder(publishTask, project, variantName)
scheduleTasksOrder(publishTask, project, variantName)
}
}

private fun scheduleTasksOrder(
Expand Down

0 comments on commit a3d91a0

Please sign in to comment.