Skip to content

Commit

Permalink
Merge pull request #846 from pstutz/scala-2.12
Browse files Browse the repository at this point in the history
Migrate to Scala 2.12
  • Loading branch information
Mats-SX authored Mar 7, 2019
2 parents 3af20a2 + 79a2811 commit fd334b3
Show file tree
Hide file tree
Showing 55 changed files with 148 additions and 2,358 deletions.
28 changes: 13 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
id 'com.github.hierynomus.license' version '0.15.0' apply false
id 'com.github.johnrengelman.shadow' version '4.0.3' apply false
id 'com.github.alisiikh.scalastyle_2.11' version '2.1.0' apply false
id 'me.champeau.gradle.jmh' version '0.4.8' apply false
id 'com.github.hierynomus.license' version '0.15.0' apply false
id 'com.github.johnrengelman.shadow' version '4.0.3' apply false
id 'com.github.alisiikh.scalastyle_2.12' version '2.1.0' apply false
id 'me.champeau.gradle.jmh' version '0.4.8' apply false
}

apply from: 'build.params.gradle'
apply plugin: 'base'

allprojects {
group = 'org.opencypher'
group = 'org.opencypher'
version = ver.self
}

Expand All @@ -24,19 +24,19 @@ subprojects {
}

dependencies {
compile group: 'org.scala-lang', name: 'scala-library', version: ver.scala.full
compile group: 'org.scala-lang', name: 'scala-library', version: ver.scala.full

// Seems we need to lock these down, otherwise we get runtime errors on reflection
compile group: 'org.scala-lang', name: 'scala-reflect', version: ver.scala.full
compile group: 'org.scala-lang', name: 'scala-reflect', version: ver.scala.full
compile group: 'org.scala-lang', name: 'scala-compiler', version: ver.scala.full

compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: ver.log4j.main
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: ver.log4j.main
compile group: 'org.apache.logging.log4j', name: "log4j-api-scala".scala(), version: ver.log4j.scala

testCompile group: 'org.apache.logging.log4j', name: 'log4j-core', version: ver.log4j.main
testCompile group: 'org.scalatest', name: "scalatest".scala(), version: ver.scalatest
testCompile group: 'org.scalacheck', name: "scalacheck".scala(), version: ver.scalacheck
testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: ver.junit.runner
testCompile group: 'org.apache.logging.log4j', name: 'log4j-core', version: ver.log4j.main
testCompile group: 'org.scalatest', name: "scalatest".scala(), version: ver.scalatest
testCompile group: 'org.scalacheck', name: "scalacheck".scala(), version: ver.scalacheck
testCompile group: 'org.junit.platform', name: 'junit-platform-runner', version: ver.junit.runner
}

test {
Expand All @@ -50,10 +50,8 @@ subprojects {
'-feature',
'-Xfatal-warnings',
'-Xfuture',
'-Ywarn-adapted-args',
'-Yopt-warnings:at-inline-failed',
'-Yopt:l:project',
'-Ypartial-unification',
'-Ywarn-adapted-args'
]

tasks.withType(ScalaCompile) {
Expand Down
3 changes: 3 additions & 0 deletions build.licenses.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// All licenses that we accept, and their aliases
def whitelist = [
[name: 'BSD-2-Clause', url: 'http://opensource.org/licenses/BSD-2-Clause', aliases: [
[name: 'BSD-style', url:'http://www.opensource.org/licenses/bsd-license.php'],
]],
[name: 'BSD-3-Clause', url: 'http://opensource.org/licenses/BSD-3-Clause', aliases: [
[name: 'The BSD 3-Clause License'],
[name: 'The 3-Clause BSD License'],
Expand Down
11 changes: 5 additions & 6 deletions build.params.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ ext {

jvm : '1.8',

scala : [major: '2.11',
full : '2.11.12'],
scala : [major: '2.12',
full : '2.12.8'],

cypher : [frontend: '9.0.20181030',
tck : '1.0.0-M12'],
cypher : [frontend: '9.0.20190305',
tck : '1.0.0-M13'],

neo4j : [main : '3.4.10',
neo4j : [main : '4.0.0-SNAPSHOT',
driver: '1.7.2'],

spark : '2.4.0',
Expand All @@ -27,7 +27,6 @@ ext {
bctls : '1.59',
netty : '4.1.24.Final',
h2 : '1.4.196',
sparkmeasure: '0.11',

log4j : [main : '2.11.0',
scala: '11.0'],
Expand Down
4 changes: 2 additions & 2 deletions build.style.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
subprojects {
apply plugin: 'com.github.alisiikh.scalastyle_2.11'
apply plugin: 'com.github.alisiikh.scalastyle'.scala()

scalaStyle {
config = rootProject.file("etc/scalastyle_config.xml")
}
}
}
22 changes: 22 additions & 0 deletions etc/licenses/text/BSD-2-Clause
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright <year> <copyright holder>

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 change: 0 additions & 1 deletion graph-ddl/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

description = 'Graph DDL'

dependencies {
Expand Down
11 changes: 5 additions & 6 deletions okapi-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@

description = 'Okapi - openCypher API'

dependencies {
compile project(':okapi-trees')

compile(group: 'org.opencypher', name: 'front-end-9.0', version: ver.cypher.frontend) {
exclude group: 'org.scalatest', module: 'scalatest_2.11'
exclude group: 'org.scalatest', module: 'scalatest_2.11'
exclude group: 'org.scalacheck', module: 'scalacheck_2.11'
}

compile group: 'org.typelevel', name: "cats-core".scala(), version: ver.cats
compile(group: 'com.lihaoyi', name: "upickle".scala(), version: ver.upickle) {
compile group: 'org.typelevel', name: "cats-core".scala(), version: ver.cats
compile(group: 'com.lihaoyi', name: "upickle".scala(), version: ver.upickle) {
exclude group: 'com.lihaoyi', module: 'utest_2.11'
}
compile group: 'com.lihaoyi', name: "fastparse".scala(), version: ver.fastparse
compile group: 'com.lihaoyi', name: "fastparse".scala(), version: ver.fastparse

testCompile group: 'org.mockito', name: 'mockito-all', version: ver.mockito
testCompile group: 'junit', name: 'junit', version: ver.junit.main
testCompile group: 'junit', name: 'junit', version: ver.junit.main
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
*/
package org.opencypher.okapi.api.graph

import org.opencypher.okapi.api.io.PropertyGraphDataSource
import org.opencypher.okapi.impl.annotations.experimental
import org.opencypher.v9_0.ast.ViewInvocation
import org.opencypher.okapi.api.io.PropertyGraphDataSource

/**
* The Catalog manages a sessions [[org.opencypher.okapi.api.io.PropertyGraphDataSource]]s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
*/
package org.opencypher.okapi.impl.graph

import org.opencypher.v9_0.ast._
import org.opencypher.okapi.api.graph._
import org.opencypher.okapi.api.io.PropertyGraphDataSource
import org.opencypher.okapi.api.value.CypherValue.CypherString
import org.opencypher.okapi.impl.annotations.experimental
import org.opencypher.okapi.impl.exception.{IllegalArgumentException, UnsupportedOperationException, ViewAlreadyExistsException}
import org.opencypher.okapi.impl.io.SessionGraphDataSource
import org.opencypher.v9_0.ast.{FromGraph, GraphByParameter, GraphLookup, ViewInvocation}

object CypherCatalog {
def apply(graphs: (QualifiedGraphName, PropertyGraph)*): CypherCatalog = {
Expand Down
12 changes: 3 additions & 9 deletions okapi-ir/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@

description = 'Okapi IR - Declarative representation of Cypher queries'

dependencies {
compile project(':okapi-api')

compile group: 'org.atnos', name: "eff".scala(), version: ver.eff
compile(group: 'org.opencypher', name: 'front-end-9.0', version: ver.cypher.frontend) {
exclude group: 'org.scalatest', module: 'scalatest_2.11'
exclude group: 'org.scalacheck', module: 'scalacheck_2.11'
}
compile group: 'org.atnos', name: "eff".scala(), version: ver.eff

testCompile project(':okapi-testing')

testCompile group: 'org.neo4j', name: 'neo4j-cypher-util-3.4', version: ver.neo4j.main, classifier: 'tests'
testCompile group: 'org.opencypher', name: 'ast-9.0', version: ver.cypher.frontend, classifier: 'tests'
testCompile group: 'org.opencypher', name: 'util-9.0', version: ver.cypher.frontend, classifier: 'tests'
testCompile group: 'org.opencypher', name: 'ast-9.0', version: ver.cypher.frontend, classifier: 'tests'
testCompile group: 'org.opencypher', name: 'util-9.0', version: ver.cypher.frontend, classifier: 'tests'
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
*/
package org.opencypher.okapi.ir.api.pattern

import org.opencypher.v9_0.expressions.SemanticDirection
import org.opencypher.v9_0.expressions.SemanticDirection.OUTGOING
import org.opencypher.okapi.api.types.CTRelationship
import org.opencypher.okapi.ir.api._
import org.opencypher.okapi.ir.api.pattern.Orientation.{Cyclic, Directed, Undirected}
import org.opencypher.v9_0.expressions.SemanticDirection
import org.opencypher.v9_0.expressions.SemanticDirection.OUTGOING

import scala.language.higherKinds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
*/
package org.opencypher.okapi.ir.impl

import org.opencypher.v9_0.expressions.{RegexMatch, functions}
import org.opencypher.v9_0.util.Ref
import org.opencypher.v9_0.{expressions => ast}
import org.opencypher.okapi.api.types._
import org.opencypher.okapi.impl.exception.NotImplementedException
import org.opencypher.okapi.ir.api._
import org.opencypher.okapi.ir.api.expr._
import org.opencypher.okapi.ir.impl.FunctionUtils._
import org.opencypher.v9_0.expressions.{RegexMatch, functions}
import org.opencypher.v9_0.util.Ref
import org.opencypher.v9_0.{expressions => ast}

import scala.language.implicitConversions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ case object FunctionExtensions {
Date.name -> Date,
Duration.name -> Duration,
ToBoolean.name -> ToBoolean,
ToString.name -> ToString,
Min.name -> Min,
Max.name -> Max,
Id.name -> Id
Expand Down Expand Up @@ -95,6 +96,24 @@ case object ToBoolean extends Function with TypeSignatures {
)
}

case object ToString extends Function with TypeSignatures {
override val name = functions.ToString.name

override val signatures = Vector(
TypeSignature(argumentTypes = Vector(CTFloat), outputType = CTString),
TypeSignature(argumentTypes = Vector(CTInteger), outputType = CTString),
TypeSignature(argumentTypes = Vector(CTBoolean), outputType = CTString),
TypeSignature(argumentTypes = Vector(CTString), outputType = CTString),
TypeSignature(argumentTypes = Vector(CTDuration), outputType = CTString),
TypeSignature(argumentTypes = Vector(CTDate), outputType = CTString),
TypeSignature(argumentTypes = Vector(CTTime), outputType = CTString),
TypeSignature(argumentTypes = Vector(CTDateTime), outputType = CTString),
TypeSignature(argumentTypes = Vector(CTLocalTime), outputType = CTString),
TypeSignature(argumentTypes = Vector(CTLocalDateTime), outputType = CTString),
TypeSignature(argumentTypes = Vector(CTPoint), outputType = CTString)
)
}

case object Min extends AggregatingFunction with TypeSignatures {
override def name: String = functions.Min.name

Expand Down
1 change: 0 additions & 1 deletion okapi-logical/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

description = 'Okapi Logical - Logical representation of Cypher queries'

dependencies {
Expand Down
6 changes: 2 additions & 4 deletions okapi-neo4j-io-testing/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

description = 'Okapi - Neo4j IO test utils'

dependencies {
compile project(':okapi-neo4j-io')
compile project(':okapi-testing')

compile group: 'org.neo4j.test', name: 'neo4j-harness', version: ver.neo4j.main
compile group: 'org.neo4j.test', name: 'neo4j-harness-enterprise', version: ver.neo4j.main
compile group: 'org.bouncycastle', name: 'bctls-jdk15on', version: ver.bctls
compile group: 'org.bouncycastle', name: 'bctls-jdk15on', version: ver.bctls

}

This file was deleted.

Loading

0 comments on commit fd334b3

Please sign in to comment.