Skip to content

Commit

Permalink
Merge pull request #11 from rossabaker/master
Browse files Browse the repository at this point in the history
Cross build for Scala 2.9 and 2.10
  • Loading branch information
jsuereth committed Nov 12, 2012
2 parents 07cd770 + 678ebb7 commit 5d70901
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 15 deletions.
18 changes: 7 additions & 11 deletions pom.xml → parent-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.version>3.0</maven.version>
<scala.version>2.8.0</scala.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<groupId>com.jsuereth</groupId>
<artifactId>scala-mojo-support</artifactId>
<packaging>jar</packaging>
<packaging>pom</packaging>
<version>0.5-SNAPSHOT</version>
<name>Scala Mojo Support</name>
<description>The scala-mojo-support project contains helper code for creating Mojos in scala.</description>
Expand Down Expand Up @@ -47,11 +46,6 @@
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-api</artifactId>
Expand Down Expand Up @@ -112,9 +106,9 @@
</extensions>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.3-SNAPSHOT</version>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>compile</id>
Expand All @@ -134,13 +128,14 @@
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<args>
<arg>-target:jvm-1.5</arg>
<arg>-target:jvm-${target.jvm}</arg>
<arg>-no-specialization</arg>
<arg>-deprecation</arg>
<!--<arg>-Ystop:erasure</arg>-->
<!--<arg>-Xprint:typer</arg>-->
<!--<arg>-explaintypes</arg>-->
</args>
<recompileMode>incremental</recompileMode>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -211,6 +206,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
Expand Down
16 changes: 16 additions & 0 deletions pom-2.10.0-RC2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.jsuereth</groupId>
<artifactId>scala-mojo-support</artifactId>
<version>0.5-SNAPSHOT</version>
<relativePath>./parent-pom.xml</relativePath>
</parent>
<properties>
<scala.version>2.10.0-RC2</scala.version>
<target.jvm>1.6</target.jvm>
</properties>
<artifactId>scala-mojo-support_2.10.0-RC2</artifactId>
<packaging>jar</packaging>
</project>
16 changes: 16 additions & 0 deletions pom-2.9.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.jsuereth</groupId>
<artifactId>scala-mojo-support</artifactId>
<version>0.5-SNAPSHOT</version>
<relativePath>./parent-pom.xml</relativePath>
</parent>
<properties>
<scala.version>2.9.0</scala.version>
<target.jvm>1.5</target.jvm>
</properties>
<artifactId>scala-mojo-support_2.9</artifactId>
<packaging>jar</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.scala_tools.maven.mojo.annotations

import scala.annotation.StaticAnnotation

sealed abstract class MavenAnnotation extends StaticAnnotation

Expand All @@ -9,7 +10,7 @@ object MavenAnnotation {
def unapply(ann: String) = try {
Some(Class.forName(ann + "$").getField("MODULE$").get(null))
} catch {
case _ => None
case _: Throwable => None
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/scala_tools/maven/mojo/util/Resource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ object Resource {
import java.io._
object RichBufferedReader {
implicit def pimpBufferedReader(reader : BufferedReader) = new Iterable[String] {
override def elements = new BufferedReaderIterator(reader)
def iterator = elements
override def iterator = new BufferedReaderIterator(reader)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ScalaComponentFactory extends AbstractComponentFactory {
(for {
child <- componentDescriptor.getConfiguration.getChildren
if child.getName.startsWith(constructorPrefix)
val order = child.getName.substring(constructorPrefix.length)
order = child.getName.substring(constructorPrefix.length)
} yield (child, order)).toList.sortWith(_._2 < _._2).map(_._1).toArray
} else {
Array()
Expand Down

0 comments on commit 5d70901

Please sign in to comment.