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

mill.scalalib.giter8.Giter8Module.scala Maven / Gradle / Ivy

There is a newer version: 0.12.0-RC2-17-07e173
Show newest version
package mill.scalalib.giter8

import mill.T
import mill.define.{Command, Discover, ExternalModule}
import mill.util.Jvm
import mill.scalalib.api.ZincWorkerUtil
import mill.scalalib._
import mill.main.BuildInfo
import mill.api.Loose

object Giter8Module extends ExternalModule with Giter8Module {
  lazy val millDiscover: Discover[this.type] = Discover[this.type]
}

trait Giter8Module extends CoursierModule {

  def init(args: String*): Command[Unit] = T.command {
    T.log.info("Creating a new project...")
    val giter8Dependencies = defaultResolver().resolveDeps {
      val scalaBinVersion = ZincWorkerUtil.scalaBinaryVersion(BuildInfo.scalaVersion)
      Loose.Agg(ivy"org.foundweekends.giter8:giter8_${scalaBinVersion}:0.14.0"
        .bindDep("", "", ""))
    }

    Jvm.runSubprocess(
      "giter8.Giter8",
      giter8Dependencies.map(_.path),
      mainArgs = args,
      workingDir = T.workspace
    )
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy