Skip to content

Commit

Permalink
updated xsbt-web-plugin from 0.1.x to 0.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
cdietze committed Jan 4, 2012
1 parent 4b65aed commit 27b61b8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version := "1.1-SNAPSHOT"

resolvers += "Web plugin repo" at "http://siasia.github.com/maven2"

addSbtPlugin("com.github.siasia" %% "xsbt-web-plugin" % "0.1.2")
libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % (v+"-0.2.10"))

seq(ScriptedPlugin.scriptedSettings: _*)

Expand Down
13 changes: 8 additions & 5 deletions src/main/scala/GwtPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import sbt._
import sbt.Keys._
import java.io.File
import com.github.siasia.WebPlugin._
import com.github.siasia.PluginKeys._

object GwtPlugin extends Plugin {

Expand All @@ -13,6 +14,7 @@ object GwtPlugin extends Plugin {
val gwtCompile = TaskKey[Unit]("gwt-compile", "Runs the GWT compiler")
val gwtDevMode = TaskKey[Unit]("gwt-devmode", "Runs the GWT devmode shell")
val gwtVersion = SettingKey[String]("gwt-version")
val gwtTemporaryPath = SettingKey[File]("gwt-temporary-path")
val gaeSdkPath = SettingKey[Option[String]]("gae-sdk-path")

var gwtModule: Option[String] = None
Expand All @@ -37,6 +39,7 @@ object GwtPlugin extends Plugin {
(cp, up) => cp ++ Classpaths.managedJars(Provided, Set("src"), up)
},
unmanagedClasspath in Gwt <<= (unmanagedClasspath in Compile).identity,
gwtTemporaryPath <<= (target) { (target) => target / "gwt" },
gwtVersion := "2.3.0",
gaeSdkPath := None,
libraryDependencies <++= gwtVersion(gwtVersion => Seq(
Expand All @@ -49,7 +52,7 @@ object GwtPlugin extends Plugin {
},

gwtDevMode <<= (dependencyClasspath in Gwt, javaSource in Compile, javaOptions in Gwt,
gwtModules, gaeSdkPath, temporaryWarPath, streams) map {
gwtModules, gaeSdkPath, gwtTemporaryPath, streams) map {
(dependencyClasspath, javaSource, javaOpts, gwtModules, gaeSdkPath, warPath, s) => {
def gaeFile (path :String*) = gaeSdkPath.map(_ +: path mkString(File.separator))
val module = gwtModule.getOrElse(gwtModules.head)
Expand All @@ -71,10 +74,9 @@ object GwtPlugin extends Plugin {
command !
}
},
gwtDevMode <<= gwtDevMode.dependsOn(prepareWebapp),

gwtCompile <<= (dependencyClasspath in Gwt, javaSource in Compile, javaOptions in Gwt,
gwtModules, temporaryWarPath, streams) map {
gwtModules, gwtTemporaryPath, streams) map {
(dependencyClasspath, javaSource, javaOpts, gwtModules, warPath, s) => {
val cp = dependencyClasspath.map(_.data.absolutePath) :+ javaSource.absolutePath
val command = mkGwtCommand(
Expand All @@ -84,8 +86,9 @@ object GwtPlugin extends Plugin {
command !
}
},
gwtCompile <<= gwtCompile.dependsOn(prepareWebapp),
packageWar <<= packageWar.dependsOn(gwtCompile),
webappResources in Compile <+= (gwtTemporaryPath) { (t: File) => t },

packageWar in Compile <<= (packageWar in Compile).dependsOn(gwtCompile),

commands ++= Seq(gwtSetModule)
)
Expand Down
2 changes: 2 additions & 0 deletions src/sbt-test/plugintest/hello/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
import net.thunderklaus.GwtPlugin._

seq(gwtSettings :_*)

libraryDependencies += "org.mortbay.jetty" % "jetty" % "6.1.22" % "container"
3 changes: 2 additions & 1 deletion src/sbt-test/plugintest/hello/project/plugins/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ resolvers += "GWT plugin repo" at "http://thunderklaus.github.com/maven"

resolvers += Resolver.file("Local Maven Repository", Path.userHome / "thunderklaus.github.com" / "maven" asFile)(Patterns(true, Resolver.mavenStyleBasePattern))

libraryDependencies += "net.thunderklaus" %% "sbt-gwt-plugin" % "1.1-SNAPSHOT"
addSbtPlugin("net.thunderklaus" % "sbt-gwt-plugin" % "1.1-SNAPSHOT")

4 changes: 2 additions & 2 deletions src/sbt-test/plugintest/hello/test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> update
> prepare-webapp
> package-war

$ exists target/webapp/hello_gwt_sbt/hello_gwt_sbt.nocache.js
$ exists target/gwt/hello_gwt_sbt/hello_gwt_sbt.nocache.js

0 comments on commit 27b61b8

Please sign in to comment.