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

com.autonomousapps.internal.parse.BuildScriptDependenciesRewriter.kt Maven / Gradle / Ivy

There is a newer version: 2.6.1
Show newest version
package com.autonomousapps.internal.parse

import com.autonomousapps.internal.advice.AdvicePrinter
import com.autonomousapps.internal.advice.DslKind
import com.autonomousapps.model.Advice
import java.io.File

internal interface BuildScriptDependenciesRewriter {
  fun rewritten(): String

  companion object {
    fun of(
      file: File,
      advice: Set,
      advicePrinter: AdvicePrinter,
      reversedDependencyMap: (String) -> String = { it },
    ): BuildScriptDependenciesRewriter {
      val dslKind = DslKind.from(file)
      val filePath = file.toPath()

      return when (dslKind) {
        DslKind.KOTLIN -> KotlinBuildScriptDependenciesRewriter.of(filePath, advice, advicePrinter, reversedDependencyMap)
        DslKind.GROOVY -> GroovyBuildScriptDependenciesRewriter.of(filePath, advice, advicePrinter, reversedDependencyMap)
      }
    }
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy