org.mashupbots.socko

buildtools

package buildtools

Tool to watch for changes in the file system and trigger a build. We use this tool when developing javascript applications.

Quite often, we like to combine static javascript and/or html files. To do this, we use an Apache Ant build file. To manually run the build every time after a file is changed during the development process is tiresome.

The tools in this package helps watch for changes on the file system and will automatically trigger your build for you.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. buildtools
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class BuildRunner(commandLine: String) extends Logger with Product with Serializable

    Responsible for running the build file

    Responsible for running the build file

    commandLine

    Command line to call to build. The build is run in another process.

    There is a special command line to run ant internally within this VM rather than an external process in a new VM.

    internal-ant [build-file] [target1] [target2] [target3] ...

    This may execute your ant scripts faster because a new process does not have to be created.

    However, there are limitations:

    • build-file must be the absolute path to the build file
    • build-file and target names cannot have spaces in them.
    • No other ant options are supported. If you wish to use advance ant options, just use the normal ant.
  2. case class Builder(commandLine: String, directoryToWatch: String, watchRecursively: Boolean = true, eventDelayTimeout: Int = 100) extends Logger with Product with Serializable

    Watches a directory and if there is a change, the build is run.

    Watches a directory and if there is a change, the build is run.

    A new thread is created for watching and building.

    Usage

    // Start watching and building
    val builder = new Builder("internal-ant /my-project/build.xml build", "/my-project/src")
    
    ...
    
    // Stop
    builder.stop()
    commandLine

    Command line to run when a watched file changes. For example

    ant -f /home/username/dev/project/build.xml js

    There is a special command line to run ant internally within this VM rather than an external process in a new VM.

    internal-ant [build-file] [target1] [target2] [target3] ...

    This may execute your ant scripts faster because a new process does not have to be created.

    However, there are limitations:

    • build-file must be the absolute path to the build file
    • build-file and target names cannot have spaces in them.
    • No other ant options are supported. If you wish to use advance ant options, just use the normal ant.
    directoryToWatch

    Full path to the directory to watch

    watchRecursively

    Indicates if we wish to watch files in sub-directories as well

    eventDelayTimeout

    Milliseconds to wait after an event for more events before a build is triggered. If we do not wait, multiple builds may be kicked off when saving a single file. Defaults to 100.

  3. class DirectoryWatcher extends Runnable with Logger

    Watches a directory for changes and triggers a build

    Watches a directory for changes and triggers a build

    Thanks to Chris Eberle. Also see java tutorial

Inherited from AnyRef

Inherited from Any

Ungrouped