
bleep.commands.Import.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bleep-cli_2.13 Show documentation
Show all versions of bleep-cli_2.13 Show documentation
A bleeping fast scala build tool!
package bleep
package commands
import ryddig.Logger
import java.nio.file.Path
case class Import(
existingBuild: Option[model.BuildFile],
sbtBuildDir: Path,
fetchJvm: FetchJvm,
destinationPaths: BuildPaths,
logger: Logger,
options: sbtimport.ImportOptions,
bleepVersion: model.BleepVersion
) extends BleepCommand {
override def run(): Either[BleepException, Unit] = {
if (!options.skipSbt) {
val resolvedJvm = fetchJvm(model.Jvm.system)
sbtimport.runSbt(logger, sbtBuildDir, destinationPaths, resolvedJvm, options.sbtPath)
}
val inputData = sbtimport.ImportInputData.collectFromFileSystem(destinationPaths, logger)
val generatedBuildFiles = sbtimport
.generateBuild(
sbtBuildDir = sbtBuildDir,
destinationPaths = destinationPaths,
logger = logger,
options = options,
bleepVersion = bleepVersion,
inputData = inputData,
bleepTasksVersion = model.BleepVersion(model.Replacements.known.BleepVersion),
maybeExistingBuildFile = existingBuild
)
.map { case (path, content) => (RelPath.relativeTo(destinationPaths.buildDir, path), content) }
FileSync
.syncStrings(destinationPaths.buildDir, generatedBuildFiles, deleteUnknowns = FileSync.DeleteUnknowns.No, soft = false)
.log(logger, "Wrote build files")
Right(())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy