Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Last active August 29, 2015 14:07
Show Gist options
  • Save xuwei-k/faa43513841015453cc8 to your computer and use it in GitHub Desktop.
Save xuwei-k/faa43513841015453cc8 to your computer and use it in GitHub Desktop.
val removeIdeaDotSbt = "remove-idea-dot-sbt"
TaskKey[Unit](removeIdeaDotSbt) := {
val f = baseDirectory.value / "project" / "idea.sbt"
assert(f.isFile)
IO.delete(f)
}
commands += Command.command("gen-idea-plugin"){ state =>
val extracted = Project.extract(state)
val f = extracted.get(baseDirectory) / "project" / "idea.sbt"
IO.write(f, """ addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0") """)
"reload" :: "gen-idea" :: removeIdeaDotSbt :: "reload" :: state
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment