Skip to content

Commit d4bb232

Browse files
committed
Merge branch 'master' into release
2 parents 6f148f6 + febbee8 commit d4bb232

File tree

5 files changed

+48
-28
lines changed

5 files changed

+48
-28
lines changed

build.sbt

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import java.net.URL
44

55
name := "ijp-toolkit"
66
organization := "net.sf.ij-plugins"
7-
version := "2.3.0"
7+
version := "2.3.0.1-SNAPSHOT"
88

99
homepage := Some(new URL("https://github.com/ij-plugins/ijp-toolkit"))
1010
startYear := Some(2002)
@@ -22,57 +22,77 @@ description := "<html>" +
2222
"</ul>" +
2323
"</html>"
2424

25-
crossScalaVersions := Seq("2.13.4", "2.12.13")
25+
crossScalaVersions := Seq("2.13.6", "3.0.1", "2.12.14")
2626
scalaVersion := crossScalaVersions.value.head
2727

2828
def isScala2_13plus(scalaVersion: String): Boolean = {
2929
CrossVersion.partialVersion(scalaVersion) match {
30-
case Some((2, n)) if n >= 13 => true
30+
case Some((major, minor)) if major > 2 || (major == 2 && minor >= 13) => true
3131
case _ => false
3232
}
3333
}
3434

3535
libraryDependencies ++= Seq(
3636
"org.apache.commons" % "commons-math3" % "3.6.1",
3737
"com.jgoodies" % "jgoodies-binding" % "2.13.0",
38-
"net.imagej" % "ij" % "1.53g",
38+
"net.imagej" % "ij" % "1.53j",
3939
// Test
4040
"junit" % "junit" % "4.13.2" % "test",
41-
"org.scalatest" %% "scalatest" % "3.2.3" % "test",
41+
"org.scalatest" %% "scalatest" % "3.2.9" % "test",
4242
// JUnit runner SBT plugin
4343
"com.novocode" % "junit-interface" % "0.11" % "test->default"
4444
)
4545

4646
libraryDependencies ++= (
4747
if (isScala2_13plus(scalaVersion.value)) {
48-
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "0.2.0")
48+
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.3")
4949
} else {
5050
Seq.empty[ModuleID]
5151
}
5252
)
5353

5454
// Add example directories to test compilation
55-
unmanagedSourceDirectories in Test += baseDirectory.value / "examples/scala"
56-
unmanagedSourceDirectories in Test += baseDirectory.value / "examples/java"
55+
Test / unmanagedSourceDirectories += baseDirectory.value / "examples/scala"
56+
Test / unmanagedSourceDirectories += baseDirectory.value / "examples/java"
57+
58+
scalacOptions ++= {
59+
Seq(
60+
"-encoding", "UTF-8",
61+
"-feature",
62+
"-language:implicitConversions",
63+
// disabled during the migration
64+
// "-Xfatal-warnings"
65+
) ++
66+
(CrossVersion.partialVersion(scalaVersion.value) match {
67+
case Some((3, _)) => Seq(
68+
"-unchecked"
69+
)
70+
case _ => Seq(
71+
"-deprecation",
72+
// "-Xfatal-warnings",
73+
// "-Wunused:imports,privates,locals",
74+
// "-Wvalue-discard"
75+
)
76+
})
77+
}
5778

58-
scalacOptions in(Compile, doc) ++= Seq(
79+
// Options for ScalaDoc
80+
Compile / doc / scalacOptions ++= Seq(
5981
"-doc-title", "IJ-Plugins Toolkit",
6082
"-doc-version", version.value,
6183
"-doc-root-content", baseDirectory.value + "/src/main/scala/overview.txt",
6284
"-doc-footer", s"IJ-Plugins Toolkit API v.${version.value}"
6385
)
6486

6587

66-
6788
// fork a new JVM for 'run' and 'test:run'
6889
fork := true
6990

7091
// add a JVM option to use when forking a JVM for 'run'
7192
javaOptions ++= Seq("-Xmx2G", "-server")
72-
javacOptions in(Compile, compile) ++= Seq("-deprecation", "-Xlint:all", "-source", "1.8", "-target", "1.8")
73-
74-
// Set the prompt (for this build) to include the project id.
75-
shellPrompt in ThisBuild := { state => "sbt:" + Project.extract(state).currentRef.project + "> "}
93+
Compile / compile / javacOptions ++= Seq(
94+
// "-deprecation", "-Xlint:all",
95+
"-source", "1.8", "-target", "1.8")
7696

7797
//
7898
// Setup sbt-imagej plugin
@@ -83,7 +103,7 @@ ijPluginsSubDir := "ij-plugins"
83103
ijCleanBeforePrepareRun := true
84104
cleanFiles += ijPluginsDir.value
85105

86-
baseDirectory in run := baseDirectory.value / "sandbox"
106+
run / baseDirectory := baseDirectory.value / "sandbox"
87107

88108
//
89109
// Customize Java style publishing

examples/scala/ij_plugins/toolkit/ui/progress/ProgressReporterExample.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* IJ-Plugins
3-
* Copyright (C) 2002-2021 Jarek Sacha
4-
* Author's email: jpsacha at gmail dot com
2+
* IJ-Plugins
3+
* Copyright (C) 2002-2021 Jarek Sacha
4+
* Author's email: jpsacha at gmail dot com
55
*
66
* This library is free software; you can redistribute it and/or
77
* modify it under the terms of the GNU Lesser General Public
@@ -42,7 +42,7 @@ object ProgressReporterExample extends App {
4242
*/
4343
class CounterWithProgress(marker: Char) extends ProgressReporter4J {
4444

45-
def count(max: Int) {
45+
def count(max: Int): Unit = {
4646
val progressIncrement = Math.max(max / 10, 1)
4747

4848
println("Counting " + max + " '" + marker + "'.")

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
#
2020
# Latest release available at https://github.com/ij-plugins/ijp-toolkit/
2121
#
22-
sbt.version=1.4.7
22+
sbt.version=1.5.5
2323

src/main/scala/ij_plugins/toolkit/util/IJPUtils.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* IJ-Plugins
3-
* Copyright (C) 2002-2021 Jarek Sacha
4-
* Author's email: jpsacha at gmail dot com
2+
* IJ-Plugins
3+
* Copyright (C) 2002-2021 Jarek Sacha
4+
* Author's email: jpsacha at gmail dot com
55
*
66
* This library is free software; you can redistribute it and/or
77
* modify it under the terms of the GNU Lesser General Public
@@ -191,7 +191,7 @@ object IJPUtils {
191191
private def createTitleLabel(title: String): JLabel = {
192192
val titleLabel = new JLabel(title)
193193
val font = titleLabel.getFont
194-
titleLabel.setFont(font.deriveFont(Font.BOLD, font.getSize * 2))
194+
titleLabel.setFont(font.deriveFont(Font.BOLD, font.getSize * 2f))
195195
titleLabel
196196
}
197197
}

src/test/scala/ij_plugins/toolkit/ui/progress/ProgressReporterSpec.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* IJ-Plugins
3-
* Copyright (C) 2002-2021 Jarek Sacha
4-
* Author's email: jpsacha at gmail dot com
2+
* IJ-Plugins
3+
* Copyright (C) 2002-2021 Jarek Sacha
4+
* Author's email: jpsacha at gmail dot com
55
*
66
* This library is free software; you can redistribute it and/or
77
* modify it under the terms of the GNU Lesser General Public
@@ -31,7 +31,7 @@ import org.scalatest.matchers.should
3131
class ProgressReporterSpec extends AnyFlatSpec with should.Matchers {
3232

3333
private class CounterWithProgress extends ProgressReporter {
34-
def count(max: Int) {
34+
def count(max: Int): Unit = {
3535
for (i <- 1 to max)
3636
notifyProgressListeners(i, max)
3737
}

0 commit comments

Comments
 (0)