Skip to content

Commit

Permalink
Change handling of Cypher dependencies to prepare adding scala 2.11 m…
Browse files Browse the repository at this point in the history
…odules

o Explicit scala version per module that needs it
o Define scala test dependency versions in top level and include in submodules
o Updated minor versions of 3rd party dependencies to be in line with 2.2
  • Loading branch information
boggle committed Apr 23, 2015
1 parent 0b68f22 commit a6b1e07
Show file tree
Hide file tree
Showing 7 changed files with 319 additions and 70 deletions.
60 changes: 60 additions & 0 deletions community/cypher/cypher-commons/pom.xml
Expand Up @@ -18,6 +18,8 @@

<properties>
<version-package>cypher.internal.helpers</version-package>
<scala.version>2.10.5</scala.version>
<scala.binary.version>2.10</scala.binary.version>
</properties>

<scm>
Expand All @@ -44,10 +46,68 @@
</license>
</licenses>

<build>
<plugins>

<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
<args>
<arg>-Xmax-classfile-name</arg>
<arg>100</arg>
<arg>-Xlint</arg>
</args>
</configuration>
</plugin>

</plugins>
</build>

<dependencies>

<!-- shared versions are defined in the parent pom -->

<!-- scala -->

<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>

<!-- scala test dependencies -->

<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>scala-library</artifactId>
<groupId>org.scala-lang</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.scalautils</groupId>
<artifactId>scalautils_2.10</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>scala-library</artifactId>
<groupId>org.scala-lang</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.scalacheck</groupId>
<artifactId>scalacheck_2.10</artifactId>
<scope>test</scope>
</dependency>

<!-- neo4j -->

<dependency>
Expand Down
61 changes: 60 additions & 1 deletion community/cypher/cypher-compiler-1.9/pom.xml
Expand Up @@ -17,6 +17,8 @@

<properties>
<version-package>cypher.internal.compiler.v1_9</version-package>
<scala.version>2.10.5</scala.version>
<scala.binary.version>2.10</scala.binary.version>
</properties>

<scm>
Expand All @@ -43,10 +45,68 @@
</license>
</licenses>

<build>
<plugins>

<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
<args>
<arg>-Xmax-classfile-name</arg>
<arg>100</arg>
<arg>-Xlint</arg>
</args>
</configuration>
</plugin>

</plugins>
</build>

<dependencies>

<!-- shared versions are defined in the parent pom -->

<!-- scala -->

<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>

<!-- scala test dependencies -->

<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>scala-library</artifactId>
<groupId>org.scala-lang</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.scalautils</groupId>
<artifactId>scalautils_2.10</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>scala-library</artifactId>
<groupId>org.scala-lang</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.scalacheck</groupId>
<artifactId>scalacheck_2.10</artifactId>
<scope>test</scope>
</dependency>

<!-- neo4j -->

<dependency>
Expand Down Expand Up @@ -87,5 +147,4 @@
</dependency>

</dependencies>

</project>
60 changes: 60 additions & 0 deletions community/cypher/cypher-compiler-2.0/pom.xml
Expand Up @@ -22,6 +22,8 @@

<properties>
<version-package>cypher.internal.compiler.v2_0</version-package>
<scala.version>2.10.5</scala.version>
<scala.binary.version>2.10</scala.binary.version>
</properties>

<licenses>
Expand All @@ -44,10 +46,68 @@
</license>
</licenses>

<build>
<plugins>

<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
<args>
<arg>-Xmax-classfile-name</arg>
<arg>100</arg>
<arg>-Xlint</arg>
</args>
</configuration>
</plugin>

</plugins>
</build>

<dependencies>

<!-- shared versions are defined in the parent pom -->

<!-- scala -->

<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>

<!-- scala test dependencies -->

<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>scala-library</artifactId>
<groupId>org.scala-lang</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.scalautils</groupId>
<artifactId>scalautils_2.10</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>scala-library</artifactId>
<groupId>org.scala-lang</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.scalacheck</groupId>
<artifactId>scalacheck_2.10</artifactId>
<scope>test</scope>
</dependency>

<!-- neo4j -->

<dependency>
Expand Down
Expand Up @@ -53,10 +53,10 @@ class InvalidInputErrorFormatter extends DefaultInvalidInputErrorFormatter {
sb.toString
}
}

override def getExpectedString(error: InvalidInputError) : String = {
val pathStartIndex = error.getStartIndex - error.getIndexDelta

val labels = error.getFailedMatchers.toList.flatMap(path => {
val labelMatcher = findProperLabelMatcher(path, pathStartIndex)
if (labelMatcher == null) {
Expand All @@ -71,17 +71,17 @@ class InvalidInputErrorFormatter extends DefaultInvalidInputErrorFormatter {

join(labels)
}

private def findProperLabelMatcher(path: MatcherPath, errorIndex: Int) : Matcher = {
val elements = unfoldRight(path) { p => if (p == null) None else Some(p.element, p.parent) }.reverse
val elements = unfoldRight(path) { p => if (p == null) None else Some(p.element -> p.parent) }.reverse

val matcher = for (element <- elements.takeWhile(!_.matcher.isInstanceOf[TestNotMatcher]).find(e => {
e.startIndex == errorIndex && e.matcher.hasCustomLabel
})) yield element.matcher

matcher.getOrElse(null)
}

private def unfoldRight[A, B](seed: B)(f: B => Option[(A, B)]): List[A] = f(seed) match {
case Some((a, b)) => a :: unfoldRight(b)(f)
case None => Nil
Expand Down
62 changes: 61 additions & 1 deletion community/cypher/cypher-docs/pom.xml
Expand Up @@ -38,16 +38,76 @@
</comments>
</license>
</licenses>

<properties>
<version-package>cypher.internal.docs</version-package>
<docs-plugin.skip>false</docs-plugin.skip>
<scala.version>2.10.5</scala.version>
<scala.binary.version>2.10</scala.binary.version>
</properties>

<build>
<plugins>

<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
<args>
<arg>-Xmax-classfile-name</arg>
<arg>100</arg>
<arg>-Xlint</arg>
</args>
</configuration>
</plugin>

</plugins>
</build>

<dependencies>

<!-- shared versions are defined in the parent pom -->

<!-- scala -->

<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>

<!-- scala test dependencies -->

<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.10</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>scala-library</artifactId>
<groupId>org.scala-lang</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.scalautils</groupId>
<artifactId>scalautils_2.10</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>scala-library</artifactId>
<groupId>org.scala-lang</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.scalacheck</groupId>
<artifactId>scalacheck_2.10</artifactId>
<scope>test</scope>
</dependency>

<!-- neo4j -->

<dependency>
Expand Down

0 comments on commit a6b1e07

Please sign in to comment.