All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.autonomousapps.model.ProjectAdvice.kt Maven / Gradle / Ivy

// Copyright (c) 2024. Tony Robalik.
// SPDX-License-Identifier: Apache-2.0
package com.autonomousapps.model

import com.squareup.moshi.JsonClass

/** Collection of all advice for a single project, across all variants. */
@JsonClass(generateAdapter = false)
data class ProjectAdvice(
  val projectPath: String,
  val dependencyAdvice: Set = emptySet(),
  val pluginAdvice: Set = emptySet(),
  val moduleAdvice: Set = emptySet(),
  val warning: Warning = Warning.empty(),
  /** True if there is any advice in a category for which the user has declared they want the build to fail. */
  val shouldFail: Boolean = false
) : Comparable {

  fun isEmpty(): Boolean = dependencyAdvice.isEmpty() && pluginAdvice.isEmpty()
  fun isNotEmpty(): Boolean = !isEmpty()

  override fun compareTo(other: ProjectAdvice): Int = projectPath.compareTo(other.projectPath)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy