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

com.autonomousapps.extension.IssueHandler.kt Maven / Gradle / Ivy

There is a newer version: 2.6.1
Show newest version
// Copyright (c) 2024. Tony Robalik.
// SPDX-License-Identifier: Apache-2.0
package com.autonomousapps.extension

import com.autonomousapps.services.GlobalDslService
import org.gradle.api.Action
import org.gradle.api.provider.Provider
import javax.inject.Inject

/**
 * Defers to `all` and `projects` for customization behavior.
 *
 * ```
 * dependencyAnalysis {
 *   issues {
 *     all { ... }
 *     project(':lib') { ... }
 *   }
 * }
 * ```
 */
abstract class IssueHandler @Inject constructor(
  globalDslService: Provider,
) {

  private val globalDslService = globalDslService.get()

  fun all(action: Action) {
    globalDslService.all(action)
  }

  fun project(projectPath: String, action: Action) {
    globalDslService.project(projectPath, action)
  }

  internal fun shouldAnalyzeSourceSet(sourceSetName: String, projectPath: String): Boolean {
    return globalDslService.shouldAnalyzeSourceSet(sourceSetName, projectPath)
  }

  internal fun anyIssueFor(projectPath: String): List> {
    return globalDslService.anyIssueFor(projectPath)
  }

  internal fun unusedDependenciesIssueFor(projectPath: String): List> {
    return globalDslService.unusedDependenciesIssueFor(projectPath)
  }

  internal fun usedTransitiveDependenciesIssueFor(projectPath: String): List> {
    return globalDslService.usedTransitiveDependenciesIssueFor(projectPath)
  }

  internal fun incorrectConfigurationIssueFor(projectPath: String): List> {
    return globalDslService.incorrectConfigurationIssueFor(projectPath)
  }

  internal fun compileOnlyIssueFor(projectPath: String): List> {
    return globalDslService.compileOnlyIssueFor(projectPath)
  }

  internal fun runtimeOnlyIssueFor(projectPath: String): List> {
    return globalDslService.runtimeOnlyIssueFor(projectPath)
  }

  internal fun unusedAnnotationProcessorsIssueFor(projectPath: String): List> {
    return globalDslService.unusedAnnotationProcessorsIssueFor(projectPath)
  }

  internal fun redundantPluginsIssueFor(projectPath: String): Provider {
    return globalDslService.redundantPluginsIssueFor(projectPath)
  }

  internal fun moduleStructureIssueFor(projectPath: String): Provider {
    return globalDslService.moduleStructureIssueFor(projectPath)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy