|
35 | 35 | <sbt.project.name>repl</sbt.project.name> |
36 | 36 | <deb.install.path>/usr/share/spark</deb.install.path> |
37 | 37 | <deb.user>root</deb.user> |
| 38 | + <extra.source.dir>scala-2.10/src/main/scala</extra.source.dir> |
| 39 | + <extra.testsource.dir>scala-2.10/src/test/scala</extra.testsource.dir> |
38 | 40 | </properties> |
39 | 41 |
|
40 | 42 | <dependencies> |
|
122 | 124 | </environmentVariables> |
123 | 125 | </configuration> |
124 | 126 | </plugin> |
| 127 | + <!-- Include a source dir depending on the Scala version --> |
| 128 | + <plugin> |
| 129 | + <groupId>org.codehaus.mojo</groupId> |
| 130 | + <artifactId>build-helper-maven-plugin</artifactId> |
| 131 | + <executions> |
| 132 | + <execution> |
| 133 | + <id>add-scala-sources</id> |
| 134 | + <phase>generate-sources</phase> |
| 135 | + <goals> |
| 136 | + <goal>add-source</goal> |
| 137 | + </goals> |
| 138 | + <configuration> |
| 139 | + <sources> |
| 140 | + <source>src/main/scala</source> |
| 141 | + <source>${extra.source.dir}</source> |
| 142 | + </sources> |
| 143 | + </configuration> |
| 144 | + </execution> |
| 145 | + <execution> |
| 146 | + <id>add-scala-test-sources</id> |
| 147 | + <phase>generate-test-sources</phase> |
| 148 | + <goals> |
| 149 | + <goal>add-test-source</goal> |
| 150 | + </goals> |
| 151 | + <configuration> |
| 152 | + <sources> |
| 153 | + <source>src/test/scala</source> |
| 154 | + <source>${extra.testsource.dir}</source> |
| 155 | + </sources> |
| 156 | + </configuration> |
| 157 | + </execution> |
| 158 | + </executions> |
| 159 | + </plugin> |
125 | 160 | </plugins> |
126 | 161 | </build> |
127 | 162 | <profiles> |
128 | | - <profile> |
129 | | - <id>scala-2.10</id> |
130 | | - <build> |
131 | | - <plugins> |
132 | | - <plugin> |
133 | | - <groupId>org.codehaus.mojo</groupId> |
134 | | - <artifactId>build-helper-maven-plugin</artifactId> |
135 | | - <executions> |
136 | | - <execution> |
137 | | - <id>add-scala-sources</id> |
138 | | - <phase>generate-sources</phase> |
139 | | - <goals> |
140 | | - <goal>add-source</goal> |
141 | | - </goals> |
142 | | - <configuration> |
143 | | - <sources> |
144 | | - <source>src/main/scala</source> |
145 | | - <source>scala-2.10/src/main/scala</source> |
146 | | - </sources> |
147 | | - </configuration> |
148 | | - </execution> |
149 | | - <execution> |
150 | | - <id>add-scala-test-sources</id> |
151 | | - <phase>generate-test-sources</phase> |
152 | | - <goals> |
153 | | - <goal>add-test-source</goal> |
154 | | - </goals> |
155 | | - <configuration> |
156 | | - <sources> |
157 | | - <source>src/test/scala</source> |
158 | | - <source>scala-2.10/src/test/scala</source> |
159 | | - </sources> |
160 | | - </configuration> |
161 | | - </execution> |
162 | | - </executions> |
163 | | - </plugin> |
164 | | - </plugins> |
165 | | - </build> |
166 | | - </profile> |
167 | 163 | <profile> |
168 | 164 | <id>scala-2.11</id> |
169 | | - <build> |
170 | | - <plugins> |
171 | | - <plugin> |
172 | | - <groupId>org.codehaus.mojo</groupId> |
173 | | - <artifactId>build-helper-maven-plugin</artifactId> |
174 | | - <executions> |
175 | | - <execution> |
176 | | - <id>add-scala-sources</id> |
177 | | - <phase>generate-sources</phase> |
178 | | - <goals> |
179 | | - <goal>add-source</goal> |
180 | | - </goals> |
181 | | - <configuration> |
182 | | - <sources> |
183 | | - <source>src/main/scala</source> |
184 | | - <source>scala-2.11/src/main/scala</source> |
185 | | - </sources> |
186 | | - </configuration> |
187 | | - </execution> |
188 | | - <execution> |
189 | | - <id>add-scala-test-sources</id> |
190 | | - <phase>generate-test-sources</phase> |
191 | | - <goals> |
192 | | - <goal>add-test-source</goal> |
193 | | - </goals> |
194 | | - <configuration> |
195 | | - <sources> |
196 | | - <source>src/test/scala</source> |
197 | | - <source>scala-2.11/src/test/scala</source> |
198 | | - </sources> |
199 | | - </configuration> |
200 | | - </execution> |
201 | | - </executions> |
202 | | - </plugin> |
203 | | - </plugins> |
204 | | - </build> |
| 165 | + <activation> |
| 166 | + <property><name>scala-2.11</name></property> |
| 167 | + </activation> |
| 168 | + <properties> |
| 169 | + <extra.source.dir>scala-2.11/src/main/scala</extra.source.dir> |
| 170 | + <extra.testsource.dir>scala-2.11/src/test/scala</extra.testsource.dir> |
| 171 | + </properties> |
205 | 172 | </profile> |
206 | 173 | </profiles> |
207 | 174 | </project> |
0 commit comments