Skip to content

Commit

Permalink
reduced number of artifacts/projects down to two;
Browse files Browse the repository at this point in the history
wandlet now inclusive
  • Loading branch information
machisuji committed Mar 29, 2012
1 parent f62b788 commit b1fbe5b
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public interface Response {
/**The (xhtml) file to be rendered as a response through Wandledi.
*/
public String getFile();

/**The scroll describing the transformations to be applied to
* to the file.
*/
Expand Down
27 changes: 4 additions & 23 deletions project/build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object Wandledi extends Build {
val description = SettingKey[String]("description")

val wandlediSettings = Defaults.defaultSettings ++ Seq (
version := "0.8.2-SNAPSHOT",
version := "0.8.3-SNAPSHOT",
organization := "org.wandledi",
scalaVersion := "2.8.1",
crossScalaVersions := Seq("2.8.0", "2.8.1", "2.8.2", "2.9.0", "2.9.1"),
Expand Down Expand Up @@ -61,17 +61,18 @@ object Wandledi extends Build {
"wandledi-project",
file("."),
settings = wandlediSettings ++ Seq (

description := "An HTML transformation library",
publishArtifact in Compile := false
)
).aggregate(wandlediCore, wandlediScala, wandletCore, wandletScala)
).aggregate(wandlediCore, wandlediScala)

lazy val wandlediCore = Project (
"wandledi",
file("core"),
settings = javaSettings ++ Seq (
description := "Wandledi Java Core",
libraryDependencies ++= Seq(htmlparser, testng),
libraryDependencies ++= Seq(htmlparser, testng, servletApi),
libraryDependencies <+= scalaVersion(scalatest(_))
)
)
Expand All @@ -84,26 +85,6 @@ object Wandledi extends Build {
libraryDependencies <+= scalaVersion(scalatest(_))
)
).dependsOn(wandlediCore % "compile;provided->provided;test->test")

lazy val wandletCore = Project (
"wandlet",
file("wandlet"),
settings = javaSettings ++ Seq (
description := "Wandledi utilities for Servlet API based Java applications",
libraryDependencies ++= Seq(servletApi)
)
).dependsOn(wandlediCore % "compile;provided->provided;test->test")

lazy val wandletScala = Project (
"wandlet-scala",
file("wandlet-scala"),
settings = scalaSettings ++ Seq (
description := "Wandledi utilities for Servlet API based Scala applications"
)
).dependsOn(
wandlediScala % "compile;provided->provided;test->test",
wandletCore % "compile;provided->provided;test->test"
)
}

object Dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import org.wandledi.CssSelector
import org.wandledi.Selector

class EmbeddedPage(
file: String,
hostFile: String,
embedAt: Selector
) extends Page(null) {
file: String,
hostFile: String,
embedAt: Selector
) extends Page(null) {
val gantry = new Page(hostFile)
gantry.get(embedAt).includeFile(file, scroll)

def this(file: String, hostFile: String, embedAt: String) =
this(file, hostFile, CssSelector.valueOf(embedAt))

override def getFile = gantry.getFile

override def getScroll = gantry.getScroll
}
24 changes: 24 additions & 0 deletions scala-lib/src/main/scala/org/wandledi/wandlet/scala/Page.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.wandledi.wandlet.scala

import org.wandledi.Scroll
import org.wandledi.wandlet.Response
import org.wandledi.scala.SelectableImpl
import org.wandledi.Selector
import org.wandledi.PathSelector

class Page(val file: String) extends SelectableImpl(new Scroll) with Response {
override def getFile = file

/**
* Extracts the target Element.
*
* @param sel Target Element to extract.
* @param block Block to execute in the context of the extracted Element.
*/
def extract(sel: Selector)(block: => Unit = {}) {
get(new PathSelector).extract(sel)
using(this at sel)(block)
}

override def toString = "scala.Page(" + getFile + ")"
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,24 @@ trait Wandlet {

object settings {
def contentType_=(contentType: String) = javaWandlet.setContentType(contentType)

def contentType = javaWandlet.getContentType

def charset_=(charset: String) = javaWandlet.setCharset(charset)

def charset = javaWandlet.getCharset

def html5_=(html5: Boolean) = javaWandlet.setHtml5(html5)

def html5 = javaWandlet.isHtml5

def debug_=(debug: Boolean) = javaWandlet.setDebug(debug)

def debug = javaWandlet.isDebug

def directFileAccess_=(dfa: Boolean) = javaWandlet.setDirectFileAccess(dfa)

def directFileAccess = javaWandlet.isDirectFileAccess
}

}
24 changes: 0 additions & 24 deletions wandlet-scala/src/main/scala/org/wandledi/wandlet/scala/Page.scala

This file was deleted.

0 comments on commit b1fbe5b

Please sign in to comment.