Skip to content

Instantly share code, notes, and snippets.

@saint1991
Last active February 24, 2018 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saint1991/e19c3c63dfcd09d7250e551738f861a9 to your computer and use it in GitHub Desktop.
Save saint1991/e19c3c63dfcd09d7250e551738f861a9 to your computer and use it in GitHub Desktop.
SampleGreetPlugin
package com.github.saint1991
import sbt._
import sbt.Keys._
object SamplePlugin extends AutoPlugin {
object autoImport {
val greet = TaskKey[Unit]("greet", "greet to a person")
}
import autoImport._
override def trigger = allRequirements
override def projectSettings: Seq[Def.Setting[_]] = super.projectSettings ++ Seq(
name in greet := "saint1991",
greet := Def.task {
println(s"Hello ${(name in greet).value}")
}.value
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment