Skip to content

A very simple SBT plugin for tasks runnable from the Play sbt console

License

Notifications You must be signed in to change notification settings

btmcnellis/play-sbt-tasks

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Play sbt tasks

A very simple SBT plugin for creating tasks that require a Play application to run one-off tasks within the sbt/activator console.

Installation:

Play SBT tasks is available on maven central. Just add the following to project/plugins.sbt:

addSbtPlugin("com.jaroop" %% "play-sbt-tasks-plugin" % "2.0.0")

and Build.scala, or build.sbt:

libraryDependencies += "com.jaroop" %% "play-sbt-tasks" % "2.0.0"

Usage

To create a new task, extend the abstract class RunnableTask, and implement the execute method:

package com.example

class MyTask(args: String) extends RunnableTask(args) {
	
	def execute: Unit = println("This is my new task.. it doesn't really do anything.")

}

Then register the task in Play's Build.scala:

import com.jaroop.play.sbt.Task

...

  val main = play.Project(appName, appVersion, appDependencies).settings(
      Task.register("myTask", "com.example.MyTask", "Displays a test message.")
  )

Or build.sbt:

import com.jaroop.play.sbt.Task

Task.register("myTask", "com.example.MyTask", "Displays a test message.")

About

A very simple SBT plugin for tasks runnable from the Play sbt console

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%