-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
118 lines (102 loc) · 3.87 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import java.net.URL
// @formatter:off
name := "ijp-toolkit"
organization := "net.sf.ij-plugins"
version := "2.3.1.1-SNAPSHOT"
homepage := Some(new URL("https://github.com/ij-plugins/ijp-toolkit"))
startYear := Some(2002)
licenses := Seq(("LGPL-2.1", new URL("http://opensource.org/licenses/LGPL-2.1")))
description := "<html>" +
"IJ Plugins Toolkit is a set of ImageJ plugins grouped into:" +
"<ul>" +
" <li>3D IO - import and export of data in 3D formats.</li>" +
" <li>3D Toolkit - operations on stacks interpreted as 3D images, including morphological operations.</li>" +
" <li>Color - color space conversion, color edge detection (color and multi-band images).</li>" +
" <li>Filters - fast median filters and various anisotropic diffusion filters.</li>" +
" <li>Graphics - Texture Synthesis - A plugin to perform texture synthesis using the image quilting algorithm of " +
" Efros and Freeman.</li>" +
" <li>Segmentation - image segmentation through clustering, thresholding, and region growing.</li>" +
"</ul>" +
"</html>"
crossScalaVersions := Seq("3.3.3", "2.13.14", "2.12.20")
scalaVersion := crossScalaVersions.value.head
def isScala2_13plus(scalaVersion: String): Boolean = {
CrossVersion.partialVersion(scalaVersion) match {
case Some((major, minor)) if major > 2 || (major == 2 && minor >= 13) => true
case _ => false
}
}
libraryDependencies ++= Seq(
"org.apache.commons" % "commons-math3" % "3.6.1",
"com.jgoodies" % "jgoodies-binding" % "2.13.0",
"net.imagej" % "ij" % "1.54k",
// Test
"junit" % "junit" % "4.13.2" % "test",
"org.scalatest" %% "scalatest" % "3.2.19" % "test",
// JUnit runner SBT plugin
"com.novocode" % "junit-interface" % "0.11" % "test->default"
)
libraryDependencies ++= (
if (isScala2_13plus(scalaVersion.value)) {
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.4")
} else {
Seq.empty[ModuleID]
}
)
// Add example directories to test compilation
Test / unmanagedSourceDirectories += baseDirectory.value / "examples/scala"
Test / unmanagedSourceDirectories += baseDirectory.value / "examples/java"
scalacOptions ++= {
Seq(
"-encoding", "UTF-8",
"-feature",
"-language:implicitConversions",
// disabled during the migration
// "-Xfatal-warnings"
) ++
(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq(
"-unchecked"
)
case _ => Seq(
"-deprecation",
// "-Xfatal-warnings",
// "-Wunused:imports,privates,locals",
// "-Wvalue-discard"
)
})
}
// Options for ScalaDoc
Compile / doc / scalacOptions ++= Seq(
"-doc-title", "IJ-Plugins Toolkit",
"-doc-version", version.value,
"-doc-root-content", baseDirectory.value + "/src/main/scala/overview.txt",
"-doc-footer", s"IJ-Plugins Toolkit API v.${version.value}"
)
// fork a new JVM for 'run' and 'test:run'
fork := true
// add a JVM option to use when forking a JVM for 'run'
javaOptions ++= Seq("-Xmx2G", "-server")
Compile / compile / javacOptions ++= Seq(
// "-deprecation", "-Xlint:all",
"--release", "8")
//
// Setup sbt-imagej plugin
//
enablePlugins(SbtImageJ)
ijRuntimeSubDir := "sandbox"
ijPluginsSubDir := "ij-plugins"
ijCleanBeforePrepareRun := true
cleanFiles += ijPluginsDir.value
run / baseDirectory := baseDirectory.value / "sandbox"
//
// Customize Java style publishing
//
// Enables publishing to maven repo
publishMavenStyle := true
publishTo := sonatypePublishToBundle.value
import xerial.sbt.Sonatype._
sonatypeProjectHosting := Some(GitHubHosting("ij-plugins", "ijp-toolkit", "[email protected]"))
developers := List(
Developer(id="jpsacha", name="Jarek Sacha", email="[email protected]", url=url("https://github.com/jpsacha"))
)