public
Last active

testgist

  • Download Gist
.gitignore
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
logs
project/project
project/target
target
tmp
.history
dist
/.idea
/*.iml
/out
/.idea_modules
/.classpath
/.project
/RUNNING_PID
/.settings
app/controllers/Application.scala
Scala
1 2 3 4 5 6 7 8 9 10 11 12 13 14
package controllers
 
import play.api._
import play.api.mvc._
 
object Application extends Controller {
def index = Action {
 
 
Ok(so.Example.hello)
}
}
conf/application.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
# This is the main configuration file for the application.
# ~~~~~
 
# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
application.secret="[O62eawT;]t7lyQd9CsilTFQ2dJUo>iXlsbp``PAolHOIs6bopSPhGOvlqy:I@l?"
 
# The application languages
# ~~~~~
application.langs="en"
 
# Global object class
# ~~~~~
# Define the Global object class for this application.
# Default to Global in the root package.
# application.global=Global
 
# Router
# ~~~~~
# Define the Router object to use for this application.
# This router will be looked up first when the application is starting up,
# so make sure this is the entry point.
# Furthermore, it's assumed your route file is named properly.
# So for an application router like `my.application.Router`,
# you may need to define a router file `conf/my.application.routes`.
# Default to Routes in the root package (and conf/routes)
# application.router=my.application.Routes
 
# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
# db.default.driver=org.h2.Driver
# db.default.url="jdbc:h2:mem:play"
# db.default.user=sa
# db.default.password=""
 
# Evolutions
# ~~~~~
# You can disable evolutions if needed
# evolutionplugin=disabled
 
# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
 
# Root logger:
logger.root=ERROR
 
# Logger used by the framework:
logger.play=INFO
 
# Logger provided to your application:
logger.application=DEBUG
conf/routes
1 2 3 4 5 6 7 8 9
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
 
# Home page
GET / controllers.Application.index
 
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)
project/Build.scala
Scala
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
import org.apache.ivy.util.FileUtil
import sbt._
import sbt.Keys._
import play.Project._
import java.io.File
 
object ApplicationBuild extends Build {
 
val appName = "so13835581"
val appVersion = "1.0-SNAPSHOT"
 
val appDependencies = Seq(
// Add your project dependencies here,
jdbc,
anorm
)
 
val rhinoJarName = "rhino.jar"
val folderForRhinoJar = unmanagedBase
val rhinoClasspath = (baseDirectory) map { base => Attributed.blank(base / "rhino")}
val rhinoClassesToJar = TaskKey[Unit]("rhino-classes-to-jar")
val rhinoClassesToJarInitializer = (base: File, folderForJar: File) => {
val rhinoFolder = new File(base, "rhino")
val isClassFile = (file: File) => file.getName.endsWith("class")
val classFiles = rhinoFolder.***.filter(isClassFile).get
val sources = classFiles map { file =>
file -> file.getCanonicalPath.drop(rhinoFolder.getCanonicalPath.length + 1)
}
IO.jar(sources, folderForJar / rhinoJarName, new java.util.jar.Manifest())
}
 
val main = play.Project(appName, appVersion, appDependencies).settings(
unmanagedClasspath in Compile <+= rhinoClasspath,
unmanagedClasspath in Runtime <+= rhinoClasspath,
rhinoClassesToJar <<= (baseDirectory, folderForRhinoJar) map rhinoClassesToJarInitializer,
playStage <<= playStage.dependsOn(rhinoClassesToJar),
playStage <<= (playStage, folderForRhinoJar) map {(unused, folder) =>
IO.delete(folder / rhinoJarName)
},
cleanFiles <+= folderForRhinoJar { _ / rhinoJarName } //make sure jar will be deleted if play stage does not finish and cleanup jar
)
}
project/build.properties
INI
1
sbt.version=0.12.1
project/plugins.sbt
Scala
1 2 3 4 5 6 7 8
// Comment to get more information during initialization
logLevel := Level.Warn
 
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
 
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1-RC1")

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.