Properly run the hellowarld demo from within the jruby-gradle-war-plugin

Currently we're still deependending on a pre-release (i.e. maven local) version
This commit is contained in:
R. Tyler Croy 2014-11-24 11:22:50 -08:00
parent 55c6e75c46
commit 4c7fb534c8
5 changed files with 52 additions and 3 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
.ruby-*
.gradle/
build/
*.sw*
*.war

View File

@ -1,5 +1,7 @@
require 'rubygems'
require 'colorize'
desc 'Say Hello warld!'
task :hello do
puts "Hello there"
puts "Hello there".yellow
end

View File

@ -9,12 +9,23 @@ buildscript {
dependencies {
classpath group: 'com.github.jruby-gradle', name: 'jruby-gradle-war-plugin', version: '0.1.2-SNAPSHOT'
classpath group: 'com.github.jruby-gradle', name: 'jruby-gradle-plugin', version: '0.1.2'
classpath group: 'com.github.jruby-gradle', name: 'jruby-gradle-plugin', version: '0.1.9'
}
}
dependencies {
gems 'rubygems:rake:10.0.+'
gems 'rubygems:colorize:0.7.3'
gems 'rubygems:sinatra:1.4.5'
}
jrubyWar {
include 'Rakefile'
webInf {
from 'Rakefile'
from 'config.ru'
into('app') { from 'app' }
}
webXml file('web.xml')
}

1
gradle.properties Normal file
View File

@ -0,0 +1 @@
org.gradle.daemon=true

33
web.xml Normal file
View File

@ -0,0 +1,33 @@
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- <display-name>Uncomment and put name :here: for Tomcat Dashboard</display-name> -->
<context-param>
<param-name>public.root</param-name>
<param-value>/</param-value>
</context-param>
<context-param>
<param-name>rack.env</param-name>
<param-value>production</param-value>
</context-param>
<filter>
<filter-name>RackFilter</filter-name>
<filter-class>org.jruby.rack.RackFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>RackFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.jruby.rack.RackServletContextListener</listener-class>
</listener>
</web-app>