Skip to content

Commit cf5d1ca

Browse files
committed
Proposed solution for issue cucumber#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?)
1 parent 979c496 commit cf5d1ca

File tree

7 files changed

+157
-19
lines changed

7 files changed

+157
-19
lines changed

examples/scala-calculator/pom.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</dependency>
2121
<dependency>
2222
<groupId>info.cukes</groupId>
23-
<artifactId>cucumber-scala</artifactId>
23+
<artifactId>cucumber-scala_2.10</artifactId>
2424
<scope>test</scope>
2525
</dependency>
2626
<dependency>
@@ -36,11 +36,13 @@
3636
<dependency>
3737
<groupId>org.scala-lang</groupId>
3838
<artifactId>scala-library</artifactId>
39+
<version>2.10.0</version>
3940
<scope>test</scope>
4041
</dependency>
4142
<dependency>
4243
<groupId>org.scala-lang</groupId>
4344
<artifactId>scala-compiler</artifactId>
45+
<version>2.10.0</version>
4446
<scope>test</scope>
4547
</dependency>
4648
</dependencies>

pom.xml

+7-12
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<hibernate.version>4.1.10.Final</hibernate.version>
2525
<hsqldb.version>2.2.9</hsqldb.version>
2626
<guice.version>3.0</guice.version>
27-
<scala.version>2.10.0</scala.version>
2827
<clojure.version>1.5.0</clojure.version>
2928
<rhino.version>1.7R4</rhino.version>
3029
<ioke.version>P-0.4.0-p11</ioke.version>
@@ -114,7 +113,12 @@
114113
</dependency>
115114
<dependency>
116115
<groupId>info.cukes</groupId>
117-
<artifactId>cucumber-scala</artifactId>
116+
<artifactId>cucumber-scala_2.10</artifactId>
117+
<version>${project.version}</version>
118+
</dependency>
119+
<dependency>
120+
<groupId>info.cukes</groupId>
121+
<artifactId>cucumber-scala_2.9.2</artifactId>
118122
<version>${project.version}</version>
119123
</dependency>
120124
<dependency>
@@ -242,16 +246,6 @@
242246
<artifactId>guice</artifactId>
243247
<version>${guice.version}</version>
244248
</dependency>
245-
<dependency>
246-
<groupId>org.scala-lang</groupId>
247-
<artifactId>scala-library</artifactId>
248-
<version>${scala.version}</version>
249-
</dependency>
250-
<dependency>
251-
<groupId>org.scala-lang</groupId>
252-
<artifactId>scala-compiler</artifactId>
253-
<version>${scala.version}</version>
254-
</dependency>
255249
<dependency>
256250
<groupId>org.clojure</groupId>
257251
<artifactId>clojure</artifactId>
@@ -380,6 +374,7 @@
380374
<module>java</module>
381375
<module>openejb</module>
382376
<module>scala</module>
377+
<module>scala/scala_2.9.2</module>
383378
</modules>
384379

385380
<profiles>

scala/pom.xml

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<version>1.1.4-SNAPSHOT</version>
99
</parent>
1010

11-
<artifactId>cucumber-scala</artifactId>
11+
<artifactId>cucumber-scala_2.10</artifactId>
1212
<packaging>jar</packaging>
13-
<name>Cucumber-JVM: Scala</name>
13+
<name>Cucumber-JVM: Scala (2.10)</name>
1414

1515
<dependencies>
1616
<dependency>
@@ -30,6 +30,7 @@
3030
<dependency>
3131
<groupId>org.scala-lang</groupId>
3232
<artifactId>scala-compiler</artifactId>
33+
<version>2.10.0</version>
3334
<scope>provided</scope>
3435
</dependency>
3536

@@ -41,6 +42,7 @@
4142
<dependency>
4243
<groupId>org.scala-lang</groupId>
4344
<artifactId>scala-library</artifactId>
45+
<version>2.10.0</version>
4446
<scope>test</scope>
4547
</dependency>
4648
<dependency>

scala/scala_2.9.2/pom.xml

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
<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">
2+
<modelVersion>4.0.0</modelVersion>
3+
4+
<parent>
5+
<groupId>info.cukes</groupId>
6+
<artifactId>cucumber-jvm</artifactId>
7+
<relativePath>../../pom.xml</relativePath>
8+
<version>1.1.3-SNAPSHOT</version>
9+
</parent>
10+
11+
<artifactId>cucumber-scala_2.9.2</artifactId>
12+
<packaging>jar</packaging>
13+
<name>Cucumber-JVM: Scala (2.9.2)</name>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>info.cukes</groupId>
18+
<artifactId>cucumber-core</artifactId>
19+
</dependency>
20+
<dependency>
21+
<groupId>info.cukes</groupId>
22+
<artifactId>cucumber-jvm-deps</artifactId>
23+
<scope>provided</scope>
24+
</dependency>
25+
<dependency>
26+
<groupId>info.cukes</groupId>
27+
<artifactId>gherkin</artifactId>
28+
<scope>provided</scope>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.scala-lang</groupId>
32+
<artifactId>scala-compiler</artifactId>
33+
<version>2.9.2</version>
34+
<scope>provided</scope>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>info.cukes</groupId>
39+
<artifactId>cucumber-junit</artifactId>
40+
<scope>test</scope>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.scala-lang</groupId>
44+
<artifactId>scala-library</artifactId>
45+
<version>2.9.2</version>
46+
<scope>test</scope>
47+
</dependency>
48+
<dependency>
49+
<groupId>junit</groupId>
50+
<artifactId>junit</artifactId>
51+
<scope>test</scope>
52+
</dependency>
53+
<dependency>
54+
<groupId>net.sourceforge.cobertura</groupId>
55+
<artifactId>cobertura</artifactId>
56+
<scope>test</scope>
57+
</dependency>
58+
</dependencies>
59+
60+
<build>
61+
<sourceDirectory>../src/main/scala</sourceDirectory>
62+
<testSourceDirectory>../src/test/scala</testSourceDirectory>
63+
<testResources>
64+
<testResource>
65+
<directory>../src/test/resources</directory>
66+
</testResource>
67+
</testResources>
68+
69+
<plugins>
70+
<plugin>
71+
<groupId>net.alchim31.maven</groupId>
72+
<artifactId>scala-maven-plugin</artifactId>
73+
<version>3.1.0</version>
74+
<configuration>
75+
<!--encoding>UTF-8</encoding-->
76+
<excludes>
77+
<exclude>**/*.java</exclude>
78+
</excludes>
79+
</configuration>
80+
<executions>
81+
<execution>
82+
<id>regular-source-compilation</id>
83+
<goals>
84+
<goal>add-source</goal>
85+
<goal>compile</goal>
86+
<goal>testCompile</goal>
87+
</goals>
88+
</execution>
89+
<execution>
90+
<goals>
91+
<goal>add-source</goal>
92+
</goals>
93+
<configuration>
94+
<sourceDir>${basedir}/target/generated-sources/i18n</sourceDir>
95+
</configuration>
96+
</execution>
97+
<execution>
98+
<id>attach-javadocs</id>
99+
<goals>
100+
<goal>doc-jar</goal>
101+
</goals>
102+
</execution>
103+
</executions>
104+
</plugin>
105+
106+
<plugin>
107+
<groupId>org.apache.maven.plugins</groupId>
108+
<artifactId>maven-antrun-plugin</artifactId>
109+
<executions>
110+
<execution>
111+
<id>generate-i18n-sources</id>
112+
<goals>
113+
<goal>run</goal>
114+
</goals>
115+
<phase>generate-sources</phase>
116+
<configuration>
117+
<target>
118+
<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="maven.plugin.classpath" />
119+
120+
<groovy><![CDATA[
121+
import groovy.text.SimpleTemplateEngine
122+
123+
def engine = new SimpleTemplateEngine()
124+
def templateSource = new File(project.baseDir.parentFile, "src${File.separator}main${File.separator}code_generator${File.separator}I18n.scala.txt").getText()
125+
126+
template = engine.createTemplate(templateSource).make(null)
127+
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")
128+
file.parentFile.mkdirs()
129+
file.write(template.toString(), "UTF-8")
130+
]]></groovy>
131+
132+
</target>
133+
</configuration>
134+
</execution>
135+
</executions>
136+
</plugin>
137+
</plugins>
138+
</build>
139+
</project>

scala/src/main/java/cucumber/api/scala/README.java

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package cucumber.api.scala
2+
3+
class README {
4+
}

0 commit comments

Comments
 (0)