Code Monkey home page Code Monkey logo

sbt-appengine's Introduction

sbt-appengine is a sbt 0.10+ port of the awesome Yasushi/sbt-appengine-plugin.

requirements

export environment variables (JREBEL_PATH is optional).

export APPENGINE_SDK_HOME=/Applications/appengine-java-sdk-1.6.2.1
export JREBEL_PATH=/Applications/ZeroTurnaround/JRebel/jrebel.jar

setup for sbt 0.13

put the following in the project/appengine.sbt:

addSbtPlugin("com.eed3si9n" % "sbt-appengine" % "0.6.0")

and the following in appengine.sbt:

libraryDependencies += "org.mortbay.jetty" % "jetty" % "6.1.22" % "container"

appengineSettings

setup for sbt 0.12

put the following in the project/plugins.sbt:

addSbtPlugin("com.eed3si9n" % "sbt-appengine" % "0.5.0")

resolvers += "spray repo" at "http://repo.spray.cc"

for build.sbt:

libraryDependencies += "org.eclipse.jetty" % "jetty-webapp" % "7.6.8.v20121106" % "container"

appengineSettings

for build.scala:

import sbtappengine.Plugin._
import AppengineKeys._

lazy val example = Project("web", file("web"),
  settings = buildSettings ++ appengineSettings ++
             Seq( // your settings here
             ))

usage

deploy

you can deploy your application like this:

> appengineDeploy

development server

to (re)start the development server in the background:

> appengineDevServer

to redeploy development server continuously:

> ~ appengineDevServer

hot loading!

to hot reload development server continuously, set JREBEL_PATH and:

> appengineDevServer
> ~ packageWar

by default development server runs in debug mode. IDE can connect to it via port 1044.

appengineDevServer lifecyle hooks

to run a code on start/stop of dev server:

(gae.onStartHooks in gae.devServer in Compile) += { () =>
  println("hello")
}

(gae.onStopHooks in gae.devServer in Compile) += { () =>
  println("bye")
}

backend support

you can deploy your backend application(s) like this:

> appengineDeployBackends

to start a backend instance in the cloud:

> appengineStartBackend <backend-name>

to stop a backend instance:

> appengineStopBackend <backend-name>

DataNucleous enhancer support (experimental)

sbt-appengine provides experimental support for DataNucleous enhancer. to use this, include the following in build.sbt:

appengineSettings

appengineDataNucleusSettings

gae.persistenceApi in gae.enhance in Compile := "JDO"

this will call the enhancer automatically on packageWar task. since DataNucleous expects plain Java fields, the entity class looks a bit ugly in Scala:

import javax.jdo.annotations._
import com.google.appengine.api.datastore.Key
import scala.annotation.target.field

@PersistenceCapable
case class Counter(
  @(PrimaryKey @field)
  @(Persistent @field)(valueStrategy = IdGeneratorStrategy.IDENTITY)
  var key: Key,
  @(Persistent @field)
  var count: Int)

sample

note

When trying to launch the dev server with appengine-dev-server, you might run into the following exception: java.lang.RuntimeException: Unable to restore the previous TimeZone. This issue has been resolved in the latest App Engine SDK.

sbt-appengine's People

Contributors

chrislewis avatar eed3si9n avatar philcali avatar stephanos avatar xuwei-k avatar yasushi avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.