Created
July 7, 2013 14:18
-
-
Save dmacvicar/5943611 to your computer and use it in GitHub Desktop.
Scala & Vaadin 7 & Gradle src/main/scala/com/foo/UI.scala
src/main/webapp/WEB-INF/web.xml
build.gradle
lib/scaladin_2.10-3.0-SNAPSHOT.jar gradle build
gradle jettyRun
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
/.gradle | |
/.settings | |
/bin | |
/build | |
/.classpath | |
/.project |
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
apply plugin: 'scala' | |
apply plugin: 'war' | |
apply plugin: 'jetty' | |
apply plugin: 'eclipse' | |
apply plugin: 'eclipse-wtp' | |
version = '0.1-SNAPSHOT' | |
repositories { | |
mavenCentral() | |
mavenRepo(url: 'http://maven.vaadin.com/vaadin-addons') | |
} | |
dependencies { | |
// scala | |
compile 'org.scala-lang:scala-library:2.10.2' | |
// Vaadin libraries | |
compile 'com.vaadin:vaadin-server:7.1.0' | |
compile 'com.vaadin:vaadin-themes:7.1.0' | |
compile 'com.vaadin:vaadin-client-compiled:7.1.0' | |
// scaladin3 not yet published, only 2.x is | |
// either build https://github.com/henrikerola/scaladin | |
// your self, or download the jar from | |
// http://oss.arcusys.com/mvn/content/groups/public/vaadin/scala/scaladin_2.10/3.0.0-SNAPSHOT/ | |
// and put it in lib/ | |
// | |
//compile 'org.vaadin.addons:scaladin:3.0' | |
compile files('lib/scaladin_2.10-3.0-SNAPSHOT.jar') | |
// because of https://issues.scala-lang.org/browse/SI-7439 | |
compile 'javax.servlet:javax.servlet-api:3.1.0' | |
} |
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.foo | |
import com.vaadin.server.VaadinRequest | |
import com.vaadin.ui._ | |
class UI extends com.vaadin.ui.UI { | |
override def init(request: VaadinRequest) { | |
val view = new VerticalLayout() | |
view.addComponent(new Label("Hello Vaadin!")) | |
setContent(view) | |
} | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> | |
<display-name>Demo App</display-name> | |
<context-param> | |
<description>Vaadin production mode</description> | |
<param-name>productionMode</param-name> | |
<param-value>false</param-value> | |
</context-param> | |
<servlet> | |
<servlet-name>Application</servlet-name> | |
<servlet-class>com.vaadin.server.VaadinServlet</servlet-class> | |
<init-param> | |
<param-name>UI</param-name> | |
<param-value>com.foo.UI</param-value> | |
</init-param> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>Application</servlet-name> | |
<url-pattern>/*</url-pattern> | |
</servlet-mapping> | |
</web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment