Skip to content

Commit

Permalink
base scaffold plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jto committed Jul 4, 2012
1 parent ac7ae26 commit e9b6a32
Show file tree
Hide file tree
Showing 18 changed files with 366 additions and 17 deletions.
29 changes: 13 additions & 16 deletions project/build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ object Builds extends sbt.Build {
import ls.Plugin.{lsSettings,LsKeys}
import sbtbuildinfo.Plugin._

val g8version = "0.4.5"
val g8version = "0.4.6-SNAPSHOT"

val typesafeRepo = "Typesafe repo" at "http://repo.typesafe.com/typesafe/repo/"
val jgitRepo = "jGit repo" at "http://download.eclipse.org/jgit/maven/"
Expand Down Expand Up @@ -38,13 +38,13 @@ object Builds extends sbt.Build {
</developer>
</developers>)
)

// posterous title needs to be giter8, so both app and root are named giter8
lazy val root = Project("root", file("."),
settings = buildSettings ++ Seq(
name := "giter8",
LsKeys.skipWrite := true
)) aggregate(plugin, app, lib)
)) aggregate(app, lib, scaffold)

lazy val app = Project("app", file("app"),
settings = buildSettings ++ conscript.Harness.conscriptSettings ++ buildInfoSettings ++ Seq(
Expand All @@ -61,20 +61,17 @@ object Builds extends sbt.Build {
resolvers += typesafeRepo
)) dependsOn (lib)

lazy val plugin = Project("giter8-plugin", file("plugin"),

This comment has been minimized.

Copy link
@xuwei-k

xuwei-k Dec 26, 2012

Member

Why plugin project deleted? I think scaffold project is not alternative plugin project

lazy val scaffold = Project("giter8-scaffold", file("scaffold"),
settings = buildSettings ++ Seq(
description :=
"sbt 0.11 plugin for testing giter8 templates",
sbtPlugin := true,
resolvers ++= Seq(
Resolver.url("Typesafe repository", new java.net.URL("http://typesafe.artifactoryonline.com/typesafe/ivy-releases/"))(Resolver.defaultIvyPatterns),
typesafeRepo
),
libraryDependencies <++= (sbtDependency, sbtVersion) { (sd, sv) =>
Seq(sd,
"org.scala-tools.sbt" %% "scripted-plugin" % sv
)
}
description := "sbt 0.11 plugin for scaffolding giter8 templates",
sbtPlugin := true//,
// resolvers ++= Seq(
// Resolver.url("Typesafe repository", new java.net.URL("http://typesafe.artifactoryonline.com/typesafe/ivy-releases/"))(Resolver.defaultIvyPatterns),
// typesafeRepo
// ),
// libraryDependencies <++= (sbtDependency, sbtVersion) { (sd, sv) =>
// Seq(sd)
// }
)) dependsOn (lib)

lazy val lib = Project("giter8-lib", file("library"),
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ resolvers += Resolver.url("sbt-plugin-releases",

addSbtPlugin("me.lessis" % "ls-sbt" % "0.1.1")

addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.1.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.1.2")
2 changes: 2 additions & 0 deletions sample/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
4 changes: 4 additions & 0 deletions sample/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This is your new Play 2.0 application
=====================================

This file will be packaged with your application, when using `play dist`.
14 changes: 14 additions & 0 deletions sample/app/controllers/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package controllers;

import play.*;
import play.mvc.*;

import views.html.*;

public class Application extends Controller {

public static Result index() {
return ok(index.render("Your new application is ready."));
}

}
7 changes: 7 additions & 0 deletions sample/app/views/index.scala.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@(message: String)

@main("Welcome to Play 2.0") {

@welcome(message)

}
15 changes: 15 additions & 0 deletions sample/app/views/main.scala.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@(title: String)(content: Html)

<!DOCTYPE html>

<html>
<head>
<title>@title</title>
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
<script src="@routes.Assets.at("javascripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
</head>
<body>
@content
</body>
</html>
53 changes: 53 additions & 0 deletions sample/conf/application.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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="CHANGEME12345678-134j1tq8iu7qn5ukodq4tk359140nreumh49h94emij7mdn2o1tv"

# 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.
# Default to Routes in the root package.
# application.routers=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

9 changes: 9 additions & 0 deletions sample/conf/routes
Original file line number Diff line number Diff line change
@@ -0,0 +1,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)
18 changes: 18 additions & 0 deletions sample/project/Build.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import sbt._
import Keys._
import PlayProject._

object ApplicationBuild extends Build {

val appName = "sample"
val appVersion = "1.0"

val appDependencies = Seq(
// Add your project dependencies here,
)

val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
giter8.ScaffoldPlugin.scaffoldSettings:_*
)

}
1 change: 1 addition & 0 deletions sample/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=0.11.3
10 changes: 10 additions & 0 deletions sample/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// 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.0.2")

addSbtPlugin("net.databinder.giter8" % "giter8-scaffold" % "0.4.6-SNAPSHOT")
2 changes: 2 additions & 0 deletions sample/public/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions sample/public/javascripts/jquery-1.7.1.min.js

Large diffs are not rendered by default.

113 changes: 113 additions & 0 deletions sample/public/stylesheets/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e9b6a32

Please sign in to comment.