-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sbt
More file actions
207 lines (193 loc) · 7.52 KB
/
build.sbt
File metadata and controls
207 lines (193 loc) · 7.52 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name := "ijp-color-project"
//
// Environment variables used by the build:
// GRAPHVIZ_DOT_PATH - Full path to Graphviz dot utility. If not defined, Scaladoc will be built without diagrams.
// JAR_BUILT_BY - Name to be added to Jar metadata field "Built-By" (defaults to System.getProperty("user.name")
//
ThisBuild / version := "0.12.3.1-SNAPSHOT"
ThisBuild / scalaVersion := "3.3.7"
ThisBuild / organization := "net.sf.ij-plugins"
ThisBuild / organizationName := "IJ-Plugins"
ThisBuild / organizationHomepage := Some(url("https://github.com/ij-plugins"))
ThisBuild / homepage := Some(url("https://github.com/ij-plugins/ijp-color"))
ThisBuild / startYear := Some(2002)
ThisBuild / licenses := Seq("LGPL-2.1" -> url("https://opensource.org/licenses/LGPL-2.1"))
ThisBuild / scmInfo := Option(
ScmInfo(
url("https://github.com/ij-plugins/ijp-color"),
"scm:https://github.com/ij-plugins/ijp-color.git"
)
)
ThisBuild / versionScheme := Some("early-semver")
// Resolvers
// Add snapshots to the root project to enable compilation with Scala SNAPSHOT compiler,
// e.g., 2.11.0-SNAPSHOT
ThisBuild / resolvers += Resolver.sonatypeCentralSnapshots
ThisBuild / resolvers += Resolver.mavenLocal
publishArtifact := false
publish / skip := true
// Set the Java version target for compatibility for the current FIJI distribution
// We do not want to be over the FIJI Java version.
lazy val javaTargetVersion = "21"
lazy val libCommonsMath = "org.apache.commons" % "commons-math3" % "3.6.1"
lazy val libFXGraphics2D = "org.jfree" % "fxgraphics2d" % "1.8"
lazy val libImageJ = "net.imagej" % "ij" % "1.54p"
lazy val libJFreeChartFX = "org.jfree" % "jfreechart-fx" % "1.0.1"
lazy val libScalaTest = "org.scalatest" %% "scalatest" % "3.2.19"
lazy val libScalaFX = "org.scalafx" %% "scalafx" % "25.0.2-R37"
lazy val libScalaFXExtras = "org.scalafx" %% "scalafx-extras" % "0.12.0"
lazy val libScalaParallelCollections = "org.scala-lang.modules" %% "scala-parallel-collections" % "1.2.0"
val commonSettings = Seq(
scalacOptions ++= Seq(
"-encoding",
"UTF-8",
"-unchecked",
"-deprecation",
"-feature",
"-explain",
"-explain-types",
"-rewrite",
"-source:3.3-migration",
// "-Wvalue-discard",
"-Wunused:all",
"-release",
javaTargetVersion
),
Compile / doc / scalacOptions ++= Opts.doc.title("IJP Color API"),
Compile / doc / scalacOptions ++= Opts.doc.version(version.value),
Compile / doc / scalacOptions ++= Seq(
"-doc-footer",
s"IJP Color API v.${version.value}",
"-doc-root-content",
baseDirectory.value + "/src/main/scala/root-doc.creole"
),
Compile / doc / scalacOptions ++= (
Option(System.getenv("GRAPHVIZ_DOT_PATH")) match {
case Some(path) => Seq("-diagrams", "-diagrams-dot-path", path, "-diagrams-debug")
case None => Seq.empty[String]
}
),
Compile / compile / javacOptions ++= Seq("-deprecation", "-Xlint", "--release", javaTargetVersion),
//
exportJars := true,
//
autoCompilerPlugins := true,
// Fork a new JVM for 'run' and 'test:run'
fork := true,
// Add a JVM option to use when forking a JVM for 'run'
javaOptions += "-Xmx1G",
// Instruct `clean` to delete created plugins subdirectory created by `ijRun`/`ijPrepareRun`.
cleanFiles += ijPluginsDir.value,
//
manifestSetting
)
// The core ijp-color module
lazy val ijp_color = (project in file("ijp-color"))
.settings(
name := "ijp-color",
description := "IJP Color Core",
commonSettings,
//
libraryDependencies ++= Seq(
libImageJ,
libCommonsMath,
// Test
libScalaTest % "test"
),
libraryDependencies += libScalaParallelCollections
)
// The ijp-color UI and ImageJ plugins module
lazy val ijp_color_ui = (project in file("ijp-color-ui"))
.settings(
name := "ijp-color-ui",
description :=
"""
|<html>
| IJP Color UI and ImageJ plugins. Operations on color spaces and color images.
| <ul>
| <li>Color Calibrator - Color calibrates images using a color chart.</li>
| <li>Color Calculator - Tool for converting individual color values between different color spaces.</li>
| <li>Color Chart ROI Tool - Converts color chart ROI to individual chip ROIs. Measures the color of each chip.</li>
| <li>White Balance - Performs White Balance of an RGB image.</li>
| </ul>
|</html>
""".stripMargin,
commonSettings,
// Other dependencies
libraryDependencies ++= Seq(
libJFreeChartFX,
libFXGraphics2D,
libScalaFX,
libScalaFXExtras,
// Test
libScalaTest % "test"
),
scalacOptions ++= Seq(
// To deal with classes implementing `ControllerFX` and using @FXML annotations to passing variables from FXML declarations
// or "-Wunused:-privates"
"-Wconf:msg=unset private var:s"
),
// Customize `sbt-imagej` plugin
ijRuntimeSubDir := "sandbox",
ijPluginsSubDir := "ij-plugins",
ijCleanBeforePrepareRun := true,
cleanFiles += ijPluginsDir.value
)
.dependsOn(ijp_color)
// The 'experimental' is not a part of distribution.
// It is intended for ImageJ with plugins and fast local experimentation with new features.
lazy val experimental = (project in file("experimental"))
.settings(
name := "experimental",
commonSettings,
// Do not publish this artifact
publishArtifact := false,
publish / skip := true,
// Customize `sbt-imagej` plugin
ijRuntimeSubDir := "sandbox",
ijPluginsSubDir := "ij-plugins",
ijCleanBeforePrepareRun := true,
cleanFiles += ijPluginsDir.value
)
.dependsOn(ijp_color_ui)
lazy val manifestSetting = packageOptions += {
Package.ManifestAttributes(
"Created-By" -> "Simple Build Tool",
"Built-By" -> Option(System.getenv("JAR_BUILT_BY")).getOrElse(System.getProperty("user.name")),
"Build-Jdk" -> System.getProperty("java.version"),
"Specification-Title" -> name.value,
"Specification-Version" -> version.value,
"Specification-Vendor" -> organization.value,
"Implementation-Title" -> name.value,
"Implementation-Version" -> version.value,
"Implementation-Vendor-Id" -> organization.value,
"Implementation-Vendor" -> organization.value
)
}
//
// Customize Java style publishing
//
// Enables publishing to maven repo
ThisBuild / publishMavenStyle := true
ThisBuild / Test / publishArtifact := false
ThisBuild / publishTo := {
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
else localStaging.value
}
ThisBuild / developers := List(
Developer(
id = "jpsacha",
name = "Jarek Sacha",
email = "jpsacha@gmail.com",
url = url("https://github.com/jpsacha")
)
)
// Enable and customize `sbt-imagej` plugin
enablePlugins(SbtImageJ)
ijRuntimeSubDir := "sandbox"
ijPluginsSubDir := "ij-plugins"
ijCleanBeforePrepareRun := true
// Instruct `clean` to delete created plugins subdirectory created by `ijRun`/`ijPrepareRun`.
cleanFiles += ijPluginsDir.value
addCommandAlias("ijRun", "experimental/ijRun")