Skip to content

Instantly share code, notes, and snippets.

@Yasushi
Created April 24, 2010 12:23
Show Gist options
  • Save Yasushi/377611 to your computer and use it in GitHub Desktop.
Save Yasushi/377611 to your computer and use it in GitHub Desktop.
$ mkdir helloworld
$ cd helloworld
$ wget http://simple-build-tool.googlecode.com/files/sbt-launch-0.7.3.jar
$ java -jar sbt-launch-0.7.3.jar
Project does not exist, create new project? (y/N/s) y
Name: helloworld
Organization: helloworld
Version [1.0]:
Scala version [2.7.7]: 2.8.0.Beta1
sbt version [0.7.3]:
Getting Scala 2.7.7 ...
:: retrieving :: org.scala-tools.sbt#boot-scala
confs: [default]
2 artifacts copied, 0 already retrieved (9911kB/124ms)
Getting org.scala-tools.sbt sbt_2.7.7 0.7.3 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
15 artifacts copied, 0 already retrieved (4023kB/59ms)
[success] Successfully initialized directory structure.
Getting Scala 2.8.0.Beta1 ...
:: retrieving :: org.scala-tools.sbt#boot-scala
confs: [default]
2 artifacts copied, 0 already retrieved (12552kB/105ms)
[info] Building project helloworld 1.0 against Scala 2.8.0.Beta1
[info] using sbt.DefaultProject with sbt 0.7.3 and Scala 2.7.7
> exit
[info]
[info] Total session time: 2 s, completed 2010/04/24 20:56:59
[success] Build completed successfully.
$ mkdir project/build project/plugins
$ cat > project/plugins/Plugins.scala
...snip...
$ cat > project/build/HelloworldProject.scala
...snip...
$ mkdir -p src/main/scala/helloworld src/main/webapp/WEB-INF
$ cat > src/main/scala/helloworld/HelloworldServlet.scala
...snip...
$ cat > src/main/webapp/WEB-INF/app.yaml
...snip...
$ export export APPENGINE_SDK_HOME=~/appengine-java-sdk-1.4.0
$ java -jar sbt-launch-0.7.3.jar
[info] Recompiling plugin definition...
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info]
[info] Updating plugins...
[info] :: retrieving :: plugin-builder#plugin-builder_2.7.7 [sync]
[info] confs: [compile, runtime, test, provided, system, optional, sources, javadoc]
[info] 1 artifacts copied, 0 already retrieved (2kB/51ms)
[success] Plugins updated successfully.
[info]
[info] Extracted source plugin ./lib_managed/scala_2.7.7/sbt-appengine-plugin-2.0.jar ...
[info] Recompiling plugin...
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info] Recompiling project definition...
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info] Building project helloworld 1.0 against Scala 2.8.0.Beta1
[info] using HelloworldProject with sbt 0.7.3 and Scala 2.7.7
> update
[info]
[info] == update ==
[info] :: retrieving :: helloworld#helloworld_2.8.0.Beta1 [sync]
[info] confs: [compile, runtime, test, provided, system, optional, sources, javadoc]
[info] 1 artifacts copied, 0 already retrieved (102kB/49ms)
[info] == update ==
[success] Successful.
[info]
[info] Total time: 1 s, completed 2010/04/24 21:15:29
> dev-appserver-start -a mauna -p 18080
[info]
[info] == copy-resources ==
[info] == copy-resources ==
[info]
[info] == compile ==
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[info] Compilation successful.
[info] Post-analysis: 1 classes.
[info] == compile ==
[info]
[info] == prepare-webapp ==
[info] == prepare-webapp ==
[info]
[info] == dev-appserver-start ==
[info] == dev-appserver-start ==
[success] Successful.
[info]
[info] Total time: 6 s, completed 2010/04/24 21:15:58
application: helloworld
version: 1
runtime: java
handlers:
- url: /
servlet: helloworld.HelloworldServlet
import sbt._
class HelloworldProject(info: ProjectInfo) extends AppengineProject(info)
package helloworld
import javax.servlet.http._
class HelloworldServlet extends HttpServlet {
override def doGet(req: HttpServletRequest, resp: HttpServletResponse) = {
resp.setContentType("text/plain")
resp.getWriter.println("Hello, world");
}
}
import sbt._
class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
val appenginePlugin = "net.stbbs.yasushi" % "sbt-appengine-plugin" % "2.1" from "http://github.com/downloads/Yasushi/sbt-appengine-plugin/sbt-appengine-plugin-2.1.jar"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment