Skip to content

Commit

Permalink
update scala/java version, jdk 15 supported
Browse files Browse the repository at this point in the history
without breaking compile or tests, compile is still targetting java 8
  • Loading branch information
TK009 committed Feb 2, 2021
1 parent 0773c2f commit d4c3857
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion O-MI-Node/src/main/scala/types/Odf/package.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package types

import java.lang.{Iterable => JavaIterable}
import java.time.{ZoneId, OffsetDateTime$}
import java.time.{ZoneId, OffsetDateTime}
import java.sql.Timestamp
import java.util.{Dictionary, GregorianCalendar, TimeZone}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ class InternalAgentLoaderTest(implicit ee: ExecutionEnv) extends Specification {
"store successfully started agents to agents " >> successfulAgents
}

// DEBUG WITH `VeryNoisyActorstest` !
def missingPropsJavaAgentTest = new NoisyActorstest() {
val classname = "agentSystem.JavaNoPropsAgent"
val exception = new java.lang.NoSuchMethodException(s"$classname.props(com.typesafe.config.Config, akka.actor.ActorRef, akka.actor.ActorRef)")
val exception = new java.lang.NoSuchMethodException(s"$classname.props(com.typesafe.config.Config")
val configStr =
s"""
agent-system{
Expand Down Expand Up @@ -372,7 +373,7 @@ class InternalAgentLoaderTest(implicit ee: ExecutionEnv) extends Specification {

val requestHandler = TestActorRef(new TestDummyRequestHandler())
val dbHandler = TestActorRef(new TestDummyDBHandler())
val filters = warnings.map { msg => EventFilter.warning(message = msg, occurrences = 1) }
val filters = warnings.map { msg => EventFilter.warning(start = msg, occurrences = 1) }
filterEvents(filters) {
_system.actorOf(TestLoader.props(config, dbHandler, requestHandler), "agent-loader")
}
Expand Down
2 changes: 1 addition & 1 deletion O-MI-Node/src/test/scala/http/OmiServiceTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ class OmiServiceTest(implicit ee: ExecutionEnv)
case e => e.getMessage
}

decoded must beEqualTo("Invalid url encoding: For input string: \"2M\"").await
decoded must startWith("Invalid url encoding: For input string: \"2M\"").await
}
}

Expand Down
22 changes: 15 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,21 @@ addCommandAlias("systemTest", "omiNode/testOnly http.SystemTest")
//}
//}

// Fail fast if wrong java version
//initialize := {
// val _ = initialize.value // run the previous initialization
// val required = "1.8" // JAVA VERSION
// val current = sys.props("java.specification.version")
// assert(current == required, s"Unsupported JDK: java.specification.version $current != $required")
//}

def commonSettings(moduleName: String) = Seq(
name := s"O-MI-$moduleName",
version := "3.1.5", // WARN: Release ver must be "x.y.z" (no dashes, '-')
scalaVersion := "2.12.6",
scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8", "-Xlint", s"-P:genjavadoc:out=${target.value}/java"),
scalaVersion := "2.12.11",
scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8", "-Xlint", s"-P:genjavadoc:out=${target.value}/java", "-target:jvm-1.8"),
scalacOptions in (Compile,doc) ++= Seq("-groups", "-deprecation", "-implicits", "-diagrams", "-diagrams-debug", "-encoding", "utf8"),
//javacOptions += "-Xlint:unchecked",
javacOptions ++= Seq("-source", "1.8", "-target", "1.8"), //"-Xlint:unchecked",
autoAPIMappings := true,
exportJars := true,
EclipseKeys.withSource := true,
Expand All @@ -48,12 +56,12 @@ def commonSettings(moduleName: String) = Seq(
lazy val Javadoc = config("genjavadoc") extend Compile

lazy val javadocSettings = inConfig(Javadoc)(Defaults.configSettings) ++ Seq(
addCompilerPlugin("com.typesafe.genjavadoc" %% "genjavadoc-plugin" % "0.11" cross CrossVersion.full),
addCompilerPlugin("com.typesafe.genjavadoc" %% "genjavadoc-plugin" % "0.16" cross CrossVersion.full),
packageDoc in Compile := (packageDoc in Javadoc).value,
sources in Javadoc :=
(target.value / "java" ** "*.java").get ++
(sources in Compile).value.filter(_.getName.endsWith(".java")),
javacOptions in Javadoc := Seq(),
javacOptions in Javadoc := Seq("--ignore-source-errors"),
artifactName in packageDoc in Javadoc := ((sv, mod, art) =>
"" + mod.name + "_" + sv.binary + "-" + mod.revision + "-javadoc.jar")
)
Expand Down Expand Up @@ -110,7 +118,7 @@ lazy val root = (project in file(".")).
///////////////////////
//Package information//
///////////////////////
maintainer := "Tuomas Kinnunen <tuomas.kinnunen@aalto.fi>",
maintainer := "Tuomas Keyriläinen <tuomas.keyrilainen@aalto.fi>",
packageDescription := "Internet of Things data server",
packageSummary := """Internet of Things data server implementing Open Messaging Interface and Open Data Format""",

Expand Down Expand Up @@ -250,7 +258,7 @@ lazy val root = (project in file(".")).
//Prevent aggregation of following commands to sub projects//
/////////////////////////////////////////////////////////////
aggregate in reStart := false,
javaOptions in reStart ++= Seq("-XX:+UseG1GC", "-Xms128m", "-Xmx4g", "-XX:+CMSClassUnloadingEnabled"),
javaOptions in reStart ++= Seq("-XX:+UseG1GC", "-Xms128m", "-Xmx4g"), //, "-XX:+CMSClassUnloadingEnabled"),
aggregate in reStop := false
): _*
).
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ addSbtPlugin("io.kamon" % "sbt-aspectj-runner" % "1.1.0")
addSbtPlugin("com.lightbend.sbt" % "sbt-javaagent" % "0.1.4")

//https://github.com/sbt/sbt-unidoc
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.2")
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3")

0 comments on commit d4c3857

Please sign in to comment.