Last active
February 24, 2018 16:12
-
-
Save saint1991/e19c3c63dfcd09d7250e551738f861a9 to your computer and use it in GitHub Desktop.
SampleGreetPlugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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