This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: name of the compiler | |
// files: the function to find files to compile from the assets directory | |
// naming: how to name the generated file from the original file and whether it should be minified or not | |
// compile: compile the file and return the compiled sources, the minified source (if relevant) and the list of dependencies | |
def AssetsCompiler(name: String, | |
watch: File => PathFinder, | |
filesSetting: sbt.SettingKey[PathFinder], | |
naming: (String, Boolean) => String, | |
compile: (File, Seq[String]) => (String, Option[String], Seq[File]), | |
optionsSettings: sbt.SettingKey[Seq[String]]) = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.hexx | |
import java.io.File | |
import scala.sys.process._ | |
import scala.util.control.Exception._ | |
import sbt.PlayExceptions.AssetCompilationException | |
import play.api._ | |
import play.core.jscompile.JavascriptCompiler | |
object JsxCompiler { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.hexx | |
import sbt._ | |
import sbt.Keys._ | |
object PlayJsxPlugin extends Plugin { | |
val jsxEntryPoints = SettingKey[PathFinder]("play-jsx-entry-points") | |
val jsxOptions = SettingKey[Seq[String]]("play-jsx-options") | |
val JsxCompiler = PlayProject.AssetsCompiler("jsx", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "js.jsx"; | |
native class jQuery { | |
function click(: function(): void) : void; | |
} | |
class _Main { | |
static function main() : void { | |
var jq = js.global["$"] as function (: string) : jQuery; | |
var alert = js.global["alert"] as function (: string) : void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ -> | |
$("#coffee").click -> | |
alert "Hello CoffeeScript!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Haxe { | |
static function main() { | |
new js.JQuery(js.Lib.document).ready(function(evt) { | |
new js.JQuery("#haxe").click(function(evt) { | |
js.Lib.alert("Hello Haxe!"); | |
}); | |
}); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$("#javascript").click(function() { | |
alert("Hello JavaScript!"); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sbtPlugin := true | |
name := "play-jsx" | |
organization := "com.github.hexx" | |
version := "0.0.1" | |
scalacOptions := Seq("-deprecation", "-unchecked") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description = This template generates a Google App Engine project using Gaeds, Unfiltered and Twirl. | |
gae_app_name = mygoogleappengineapp | |
gae_app_version = 1 | |
org_id = com.example | |
gae_sessions_enabled = false | |
name = My Google App Engine Project | |
version = 0.1.0-SNAPSHOT | |
unfiltered_version = ls(unfiltered, unfiltered) | |
sbt_appengine_version = ls(sbt-appengine, sbt) | |
verbatim = *.js *.css |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@main("Message Board") { | |
@form() | |
@board() | |
} |