-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sbt
97 lines (91 loc) · 3.04 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
name := "pdal-jni"
val scala212 = "2.12.19"
val scala213 = "2.13.15"
val scala3 = "3.5.0"
val scalaVersions = Seq(scala3, scala213, scala212)
lazy val commonSettings = Seq(
scalaVersion := scalaVersions.head,
crossScalaVersions := scalaVersions,
organization := "io.pdal",
description := "PDAL JNI bindings",
licenses := Seq("BSD" -> url("https://github.com/PDAL/PDAL/blob/master/LICENSE.txt")),
homepage := Some(url("https://www.pdal.io")),
versionScheme := Some("semver-spec"),
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-language:implicitConversions",
"-language:reflectiveCalls",
"-language:higherKinds",
"-language:postfixOps",
"-language:existentials",
"-feature",
"-target:jvm-1.8"
),
shellPrompt := { s => Project.extract(s).currentProject.id + " > " },
Test / publishArtifact := false,
developers := List(
Developer(
"pomadchin",
"Grigory Pomadchin",
"@pomadchin",
url("https://github.com/pomadchin")
)
)
)
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.settings(
scalaVersion := scalaVersions.head,
crossScalaVersions := Nil,
publish := {},
publishLocal := {}
)
.aggregate(`core-scala`, core, native)
lazy val `core-scala` = project
.settings(commonSettings: _*)
.settings(Dependencies.macroSettings)
.settings(Dependencies.licenseSettings)
.settings(scalaVersion := scala213, crossScalaVersions := Seq(scala213, scala212))
.settings(name := "pdal-scala")
.settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include")
.settings(
libraryDependencies ++= Seq(
Dependencies.circe("core"),
Dependencies.circe("generic"),
Dependencies.circe("generic-extras"),
Dependencies.circe("parser"),
Dependencies.jtsCore,
Dependencies.scalaTest % Test
)
)
.dependsOn(core)
.dependsOn(Environment.dependOnNative(native % Runtime): _*)
lazy val core = project
.settings(commonSettings: _*)
.settings(name := "pdal")
.settings(javah / target := (native / nativeCompile / sourceDirectory).value / "include")
.settings(sbtJniCoreScope := Compile)
.settings(
libraryDependencies ++= Seq(
Dependencies.scalaTest % Test,
Dependencies.circe("parser") % Test
)
)
.dependsOn(Environment.dependOnNative(native % Runtime): _*)
lazy val native = project
.settings(commonSettings: _*)
.settings(crossPaths := false)
.settings(name := "pdal-native")
.settings(nativeCompile / sourceDirectory := sourceDirectory.value)
.settings(
Compile / unmanagedPlatformDependentNativeDirectories := Seq(
"x86_64-linux" -> target.value / "native/x86_64-linux/bin/",
"x86_64-darwin" -> target.value / "native/x86_64-darwin/bin/",
"arm64-darwin" -> target.value / "native/arm64-darwin/bin/"
)
)
.settings(artifactName := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
artifact.name + "-" + nativePlatform.value + "-" + module.revision + "." + artifact.extension
})
.enablePlugins(JniNative, JniPackage)