commit 4a5b18a8657bc46ff43a46c22ce2e865e23a8d29 Author: Mauro Talevi <mauro.tal...@aquilonia.org> AuthorDate: Thu Aug 30 20:10:21 2012 +0100 Commit: Mauro Talevi <mauro.tal...@aquilonia.org> CommitDate: Thu Aug 30 20:12:43 2012 +0100
JBEHAVE-828: Made build independent of local installation of jrubyc by downloading it on the fly. A more efficient solution would be to have the jruby-bin.zip on Maven Central or to use a maven plugin for jruby compilation. diff --git a/examples/jruby/pom.xml b/examples/jruby/pom.xml index 453d1f5..4c5abec 100755 --- a/examples/jruby/pom.xml +++ b/examples/jruby/pom.xml @@ -11,6 +11,9 @@ <name>JBehave JRuby Example</name> <properties> + <jruby.version>1.6.7.2</jruby.version> + <jruby.download.url>http://jruby.org.s3.amazonaws.com/downloads/${jruby.version}/jruby-bin-${jruby.version}.zip</jruby.download.url> + <jruby.install.dir>${project.build.directory}/jruby-${jruby.version}</jruby.install.dir> <jruby.generated.sources>${project.build.directory}/generated-sources/jruby</jruby.generated.sources> </properties> @@ -23,7 +26,7 @@ <dependency> <groupId>org.jruby</groupId> <artifactId>jruby</artifactId> - <version>1.6.7.2</version> + <version>${jruby.version}</version> </dependency> </dependencies> @@ -50,10 +53,17 @@ <phase>generate-sources</phase> <configuration> <tasks> + <property name="jruby.dist" + value="${project.build.directory}/jruby.zip" /> + <get src="${jruby.download.url}" dest="${jruby.dist}" /> + <unzip src="${jruby.dist}" dest="${project.build.directory}" /> + <property name="jrubyc.bin" + value="${jruby.install.dir}/bin/jrubyc" /> + <chmod file="${jrubyc.bin}" perm="ugo+rx" /> <pathconvert pathsep=":" property="jruby.classpath" refid="maven.runtime.classpath" /> <mkdir dir="${jruby.generated.sources}" /> - <exec dir="${basedir}" executable="jrubyc" + <exec dir="${basedir}" executable="${jrubyc.bin}" failonerror="true"> <arg line="--javac -c ${jruby.classpath} --target ${jruby.generated.sources} src/main/rb/*.rb" /> @@ -151,5 +161,4 @@ </plugins> </pluginManagement> </build> - </project>