Permalink
Browse files

Proposed solution for issue #432

The main scala build has been modified to generate an artifact named cucumber-scala_2.10
A new sub-directory of the scala build has been created. This uses the same source files as its parent but builds a cucumber-scala_2.9.2 artifact using the Scala 2.9.2 compiler and library
To get this to work correctly the README.java and package.html files were moved into the scala source tree
The scala-calculator example was modified to use the cucumber-scala_2.10 artifact
The root pom.xml file no longer directly references Scala library dependencies as there are now different versions between the 2.10 and 2.9.2 build. (Is the a solution to this?)
  • Loading branch information...
1 parent 9114f7c commit 4f673858875551999e57e01b79ba8a50021436d3 @skipoleschris skipoleschris committed Feb 14, 2013
@@ -20,7 +20,7 @@
</dependency>
<dependency>
<groupId>info.cukes</groupId>
- <artifactId>cucumber-scala</artifactId>
+ <artifactId>cucumber-scala_2.10</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -36,11 +36,13 @@
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
+ <version>2.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
+ <version>2.10.0</version>
<scope>test</scope>
</dependency>
</dependencies>
View
@@ -24,7 +24,6 @@
<hibernate.version>4.1.9.Final</hibernate.version>
<hsqldb.version>2.2.9</hsqldb.version>
<guice.version>3.0</guice.version>
- <scala.version>2.10.0</scala.version>
<clojure.version>1.5.0-RC4</clojure.version>
<rhino.version>1.7R4</rhino.version>
<ioke.version>P-0.4.0-p11</ioke.version>
@@ -114,7 +113,12 @@
</dependency>
<dependency>
<groupId>info.cukes</groupId>
- <artifactId>cucumber-scala</artifactId>
+ <artifactId>cucumber-scala_2.10</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>info.cukes</groupId>
+ <artifactId>cucumber-scala_2.9.2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -243,16 +247,6 @@
<version>${guice.version}</version>
</dependency>
<dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- <version>${scala.version}</version>
- </dependency>
- <dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-compiler</artifactId>
- <version>${scala.version}</version>
- </dependency>
- <dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<!-- Remember to bounce version in examples/clojure_cukes/project.clj as well -->
@@ -380,6 +374,7 @@
<module>java</module>
<module>openejb</module>
<module>scala</module>
+ <module>scala/scala_2.9.2</module>
</modules>
<profiles>
View
@@ -8,9 +8,9 @@
<version>1.1.3-SNAPSHOT</version>
</parent>
- <artifactId>cucumber-scala</artifactId>
+ <artifactId>cucumber-scala_2.10</artifactId>
<packaging>jar</packaging>
- <name>Cucumber-JVM: Scala</name>
+ <name>Cucumber-JVM: Scala (2.10)</name>
<dependencies>
<dependency>
@@ -30,6 +30,7 @@
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
+ <version>2.10.0</version>
<scope>provided</scope>
</dependency>
@@ -41,6 +42,7 @@
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
+ <version>2.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -0,0 +1,139 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>info.cukes</groupId>
+ <artifactId>cucumber-jvm</artifactId>
+ <relativePath>../../pom.xml</relativePath>
+ <version>1.1.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>cucumber-scala_2.9.2</artifactId>
+ <packaging>jar</packaging>
+ <name>Cucumber-JVM: Scala (2.9.2)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>info.cukes</groupId>
+ <artifactId>cucumber-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>info.cukes</groupId>
+ <artifactId>cucumber-jvm-deps</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>info.cukes</groupId>
+ <artifactId>gherkin</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-compiler</artifactId>
+ <version>2.9.2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>info.cukes</groupId>
+ <artifactId>cucumber-junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ <version>2.9.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.cobertura</groupId>
+ <artifactId>cobertura</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <sourceDirectory>../src/main/scala</sourceDirectory>
+ <testSourceDirectory>../src/test/scala</testSourceDirectory>
+ <testResources>
+ <testResource>
+ <directory>../src/test/resources</directory>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>net.alchim31.maven</groupId>
+ <artifactId>scala-maven-plugin</artifactId>
+ <version>3.1.0</version>
+ <configuration>
+ <!--encoding>UTF-8</encoding-->
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <id>regular-source-compilation</id>
+ <goals>
+ <goal>add-source</goal>
+ <goal>compile</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ <execution>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sourceDir>${basedir}/target/generated-sources/i18n</sourceDir>
+ </configuration>
+ </execution>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>doc-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-i18n-sources</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>generate-sources</phase>
+ <configuration>
+ <target>
+ <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="maven.plugin.classpath" />
+
+ <groovy><![CDATA[
+import groovy.text.SimpleTemplateEngine
+
+def engine = new SimpleTemplateEngine()
+def templateSource = new File(project.baseDir.parentFile, "src${File.separator}main${File.separator}code_generator${File.separator}I18n.scala.txt").getText()
+
+template = engine.createTemplate(templateSource).make(null)
+def file = new File(project.baseDir, "target${File.separator}generated-sources${File.separator}i18n${File.separator}cucumber${File.separator}api${File.separator}scala${File.separator}I18n.scala")
+file.parentFile.mkdirs()
+file.write(template.toString(), "UTF-8")
+ ]]></groovy>
+
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
@@ -1,4 +0,0 @@
-package cucumber.api.scala;
-
-public class README {
-}
@@ -0,0 +1,4 @@
+package cucumber.api.scala
+
+class README {
+}

0 comments on commit 4f67385

Please sign in to comment.